Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
refactor(recovery): embed workspace switcher in shell
rcourtmanfd008ef3243f
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex a47a3f2f58..2298f3d05b 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -695,6 +695,10 @@ already establish the active workspace. `RecoveryProtectedInventorySection.tsx`should keep page/count/sort orientation inside a slim table-shell status rowand let the filter strip lead directly into the grid instead of reintroducing asecond large inventory header card above the same table.+That same workspace rule also means the protected-items versus recovery-events+switcher should live inside the active workspace header strip, not in its own+separate band above the cards, so the page hands off from summary directly into+the active control surface the way infrastructure and workloads do.That same shell rule applies to the recovery-events workspace.`RecoveryHistorySection.tsx` should use the same slim status-row-plus-filter-rowpattern as the protected inventory surface, not a separate large titled headerdiff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsxindex 09ee6007a2..dc4a4a325a 100644--- a/frontend-modern/src/components/Recovery/Recovery.tsx+++ b/frontend-modern/src/components/Recovery/Recovery.tsx@@ -485,129 +485,123 @@ const Recovery: Component = () => {/><div ref={historySectionRef} class="flex flex-col gap-4">- <div class="flex flex-col gap-2 border-b border-border-subtle px-1 pb-2 sm:flex-row sm:items-center sm:justify-between">- <Subtabs- value={workspaceView()}- onChange={(value) => setWorkspaceView(value as RecoveryWorkspaceView)}- ariaLabel="Recovery data view"- listClass="flex flex-wrap items-center gap-1.5"- tabClass="min-h-7 px-2 py-1 text-sm"- tabs={[- {- value: 'inventory',- label: (- <span class="inline-flex items-center gap-2">- <span>Protected items</span>- <span class="text-xs text-muted">{filteredRollups().length}</span>- </span>- ),- },- {- value: 'events',- label: (- <span class="inline-flex items-center gap-2">- <span>Recovery events</span>- <span class="text-xs text-muted">{recoveryPoints.meta().total}</span>- </span>- ),- },- ]}- />- <Show when={rollupId().trim().length > 0}>- <span class="inline-flex w-fit items-center rounded-md border border-border-subtle bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted">- Focused drill-in- </span>- </Show>- </div>-- <Show when={workspaceView() === 'inventory'}>- <RecoveryProtectedInventorySection- filteredRollups={filteredRollups}- historyOutcomeFilter={historyOutcomeFilter}- isMobile={isMobile()}- kioskMode={kioskMode()}- loading={() => recoveryRollups.rollups.loading}- error={() => recoveryRollups.rollups.error}- onSelectRollup={handleSelectRollup}- protectedStaleOnly={protectedStaleOnly}- itemTypeFilter={itemTypeFilter}- itemTypeOptions={itemTypeOptions}- platformFilter={platformFilter}- platformOptions={platformOptions}- queryFilter={queryFilter}- resourcesById={resourcesById}- rollups={rollups}- rollupsSummary={rollupsSummary}- setHistoryOutcomeFilter={setHistoryOutcomeFilter}- setItemTypeFilter={setItemTypeFilter}- setProtectedStaleOnly={setProtectedStaleOnly}- setPlatformFilter={setPlatformFilter}- setQueryFilter={setQueryFilter}- setVerificationFilter={setVerificationFilter}- />- </Show>-- <Show when={workspaceView() === 'events' && !recoveryPoints.response.loading && recoveryPoints.response.error}>- <Card padding="sm">- <EmptyState- title={getRecoveryPointsFailureState().title}- description={String(- (recoveryPoints.response.error as Error)?.message || recoveryPoints.response.error,- )}- />- </Card>- </Show>-- <Show when={workspaceView() === 'events' && !recoveryPoints.response.error}>- <RecoveryHistorySection- activeAdvancedFilterCount={activeAdvancedFilterCount}- artifactColumnVisibility={artifactColumnVisibility}- availableOutcomes={['all', 'success', 'warning', 'failed', 'running']}- clusterFilter={clusterFilter}- clusterOptions={clusterOptions}- currentPage={currentPage}- groupedByDay={groupedByDay}- hasActiveArtifactFilters={hasActiveArtifactFilters}- historyOutcomeFilter={historyOutcomeFilter}- isMobile={isMobile()}- kioskMode={kioskMode()}- mobileVisibleArtifactColumns={mobileVisibleArtifactColumns}- modeFilter={modeFilter}- itemTypeFilter={itemTypeFilter}- itemTypeOptions={itemTypeOptions}- namespaceFilter={namespaceFilter}- namespaceOptions={namespaceOptions}- nodeFilter={nodeFilter}- nodeOptions={nodeOptions}- platformFilter={platformFilter}- platformOptions={platformOptions}- queryFilter={queryFilter}- recoveryPoints={recoveryPoints}- resetAdvancedArtifactFilters={resetAdvancedArtifactFilters}- resetAllArtifactFilters={resetAllArtifactFilters}- resourcesById={resourcesById}- scopeFilter={scopeFilter}- setClusterFilter={setClusterFilter}- setCurrentPage={setCurrentPage}- setHistoryOutcomeFilter={setHistoryOutcomeFilter}- setItemTypeFilter={setItemTypeFilter}- setModeFilter={setModeFilter}- setNamespaceFilter={setNamespaceFilter}- setNodeFilter={setNodeFilter}- setPlatformFilter={setPlatformFilter}- setQueryFilter={setQueryFilter}- setScopeFilter={setScopeFilter}- setVerificationFilter={setVerificationFilter}- showClusterFilter={showClusterFilter}- showNamespaceFilter={showNamespaceFilter}- showNodeFilter={showNodeFilter}- showVerificationFilter={showVerificationFilter}- tableColumnCount={tableColumnCount}- tableMinWidth={tableMinWidth}- totalPages={totalPages}- verificationFilter={verificationFilter}- />- </Show>+ {(() => {+ const workspaceControls = (+ <div class="flex flex-wrap items-center gap-2">+ <Subtabs+ value={workspaceView()}+ onChange={(value) => setWorkspaceView(value as RecoveryWorkspaceView)}+ ariaLabel="Recovery data view"+ listClass="flex flex-wrap items-center gap-1"+ tabClass="min-h-6 px-2 py-1 text-xs"+ tabs={[+ { value: 'inventory', label: 'Protected items' },+ { value: 'events', label: 'Recovery events' },+ ]}+ />+ <Show when={rollupId().trim().length > 0}>+ <span class="inline-flex w-fit items-center rounded-md border border-border-subtle bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-muted">+ Focused drill-in+ </span>+ </Show>+ </div>+ );++ return (+ <>+ <Show when={workspaceView() === 'inventory'}>+ <RecoveryProtectedInventorySection+ filteredRollups={filteredRollups}+ historyOutcomeFilter={historyOutcomeFilter}+ isMobile={isMobile()}+ kioskMode={kioskMode()}+ loading={() => recoveryRollups.rollups.loading}+ error={() => recoveryRollups.rollups.error}+ onSelectRollup={handleSelectRollup}+ protectedStaleOnly={protectedStaleOnly}+ itemTypeFilter={itemTypeFilter}+ itemTypeOptions={itemTypeOptions}+ platformFilter={platformFilter}+ platformOptions={platformOptions}+ queryFilter={queryFilter}+ resourcesById={resourcesById}+ rollups={rollups}+ rollupsSummary={rollupsSummary}+ setHistoryOutcomeFilter={setHistoryOutcomeFilter}+ setItemTypeFilter={setItemTypeFilter}+ setProtectedStaleOnly={setProtectedStaleOnly}+ setPlatformFilter={setPlatformFilter}+ setQueryFilter={setQueryFilter}+ setVerificationFilter={setVerificationFilter}+ workspaceControls={workspaceControls}+ />+ </Show>++ <Show when={workspaceView() === 'events' && !recoveryPoints.response.loading && recoveryPoints.response.error}>+ <Card padding="sm">+ <EmptyState+ title={getRecoveryPointsFailureState().title}+ description={String(+ (recoveryPoints.response.error as Error)?.message || recoveryPoints.response.error,+ )}+ />+ </Card>+ </Show>++ <Show when={workspaceView() === 'events' && !recoveryPoints.response.error}>+ <RecoveryHistorySection+ activeAdvancedFilterCount={activeAdvancedFilterCount}+ artifactColumnVisibility={artifactColumnVisibility}+ availableOutcomes={['all', 'success', 'warning', 'failed', 'running']}+ clusterFilter={clusterFilter}+ clusterOptions={clusterOptions}+ currentPage={currentPage}+ groupedByDay={groupedByDay}+ hasActiveArtifactFilters={hasActiveArtifactFilters}+ historyOutcomeFilter={historyOutcomeFilter}+ isMobile={isMobile()}+ kioskMode={kioskMode()}+ mobileVisibleArtifactColumns={mobileVisibleArtifactColumns}+ modeFilter={modeFilter}+ itemTypeFilter={itemTypeFilter}+ itemTypeOptions={itemTypeOptions}+ namespaceFilter={namespaceFilter}+ namespaceOptions={namespaceOptions}+ nodeFilter={nodeFilter}+ nodeOptions={nodeOptions}+ platformFilter={platformFilter}+ platformOptions={platformOptions}+ queryFilter={queryFilter}+ recoveryPoints={recoveryPoints}+ resetAdvancedArtifactFilters={resetAdvancedArtifactFilters}+ resetAllArtifactFilters={resetAllArtifactFilters}+ resourcesById={resourcesById}+ scopeFilter={scopeFilter}+ setClusterFilter={setClusterFilter}+ setCurrentPage={setCurrentPage}+ setHistoryOutcomeFilter={setHistoryOutcomeFilter}+ setItemTypeFilter={setItemTypeFilter}+ setModeFilter={setModeFilter}+ setNamespaceFilter={setNamespaceFilter}+ setNodeFilter={setNodeFilter}+ setPlatformFilter={setPlatformFilter}+ setQueryFilter={setQueryFilter}+ setScopeFilter={setScopeFilter}+ setVerificationFilter={setVerificationFilter}+ showClusterFilter={showClusterFilter}+ showNamespaceFilter={showNamespaceFilter}+ showNodeFilter={showNodeFilter}+ showVerificationFilter={showVerificationFilter}+ tableColumnCount={tableColumnCount}+ tableMinWidth={tableMinWidth}+ totalPages={totalPages}+ verificationFilter={verificationFilter}+ workspaceControls={workspaceControls}+ />+ </Show>+ </>+ );+ })()}<RecoveryActivitySectionactivitySummary={activitySummary}diff --git a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsxindex 1aa4686ea8..8dd3438e9b 100644--- a/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx+++ b/frontend-modern/src/components/Recovery/RecoveryHistorySection.tsx@@ -1,5 +1,5 @@import { For, Show } from 'solid-js';-import type { Accessor, Component } from 'solid-js';+import type { Accessor, Component, JSX } from 'solid-js';import { Card } from '@/components/shared/Card';import {@@ -99,6 +99,7 @@ interface RecoveryHistorySectionProps {tableMinWidth: Accessor<string>;totalPages: Accessor<number>;verificationFilter: Accessor<VerificationFilter>;+ workspaceControls?: JSX.Element;}export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (props) => {@@ -131,21 +132,25 @@ export const RecoveryHistorySection: Component<RecoveryHistorySectionProps> = (p<Card padding="none" tone="card" class="overflow-hidden border-border-subtle bg-surface"><div class="border-b border-border-subtle/80 bg-surface px-4 py-2.5"><div class="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">- <div class="flex flex-wrap items-center gap-3 text-[11px] text-muted">- <span class="font-medium text-base-content">Recovery Events</span>- <span>- {props.recoveryPoints.meta().total} event- {props.recoveryPoints.meta().total === 1 ? '' : 's'}- </span>- <span>- Page {props.currentPage()} / {props.totalPages()}- </span>- <Show when={props.groupedByDay().length > 0}>+ <div class="flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:gap-3">+ <Show when={props.workspaceControls}>+ <div class="shrink-0">{props.workspaceControls}</div>+ </Show>+ <div class="flex flex-wrap items-center gap-3 text-[11px] text-muted">+ <span class="font-medium text-base-content">+ {props.recoveryPoints.meta().total} event+ {props.recoveryPoints.meta().total === 1 ? '' : 's'}+ </span><span>- {props.groupedByDay().length} day group- {props.groupedByDay().length === 1 ? '' : 's'}+ {props.currentPage()} / {props.totalPages()}</span>- </Show>+ <Show when={props.groupedByDay().length > 0}>+ <span>+ {props.groupedByDay().length} day group+ {props.groupedByDay().length === 1 ? '' : 's'}+ </span>+ </Show>+ </div></div></div></div>diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsxindex 327beff030..7cd80aff19 100644--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx@@ -1,5 +1,5 @@import { For, Show, createEffect, createMemo, createSignal } from 'solid-js';-import type { Accessor, Component } from 'solid-js';+import type { Accessor, Component, JSX } from 'solid-js';import { Card } from '@/components/shared/Card';import { EmptyState } from '@/components/shared/EmptyState';@@ -80,6 +80,7 @@ interface RecoveryProtectedInventorySectionProps {setVerificationFilter: (value: VerificationFilter) => void;loading: Accessor<boolean>;error: Accessor<unknown>;+ workspaceControls?: JSX.Element;}const availableOutcomes = ['all', 'success', 'warning', 'failed', 'running'] as const;@@ -203,28 +204,32 @@ export const RecoveryProtectedInventorySection: Component<><div class="border-b border-border-subtle/80 bg-surface px-4 py-2"><div class="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">- <div class="flex flex-wrap items-center gap-3 text-[11px] text-muted">- <span class="font-medium text-base-content">- {sortedRollups().length} of {props.rollups().length} items shown- </span>- <span>- Page {protectedPage()} / {protectedTotalPages()}- </span>- <span>- Sort:{' '}+ <div class="flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:gap-3">+ <Show when={props.workspaceControls}>+ <div class="shrink-0">{props.workspaceControls}</div>+ </Show>+ <div class="flex flex-wrap items-center gap-3 text-[11px] text-muted"><span class="font-medium text-base-content">- {protectedSortCol() === 'lastBackup'- ? 'Latest point'- : protectedSortCol() === 'item'- ? 'Item'- : protectedSortCol() === 'type'- ? 'Item type'- : protectedSortCol() === 'platform'- ? 'Platform'- : 'Outcome'}- </span>{' '}- <span class="uppercase tracking-wide">{protectedSortDir()}</span>- </span>+ {sortedRollups().length} shown+ </span>+ <span>+ {protectedPage()} / {protectedTotalPages()}+ </span>+ <span>+ <span class="font-medium text-base-content">+ {protectedSortCol() === 'lastBackup'+ ? 'Latest point'+ : protectedSortCol() === 'item'+ ? 'Item'+ : protectedSortCol() === 'type'+ ? 'Item type'+ : protectedSortCol() === 'platform'+ ? 'Platform'+ : 'Outcome'}+ </span>{' '}+ <span class="uppercase tracking-wide text-muted">{protectedSortDir()}</span>+ </span>+ </div></div><div class="flex flex-wrap items-center gap-2 text-xs"><Show when={props.rollupsSummary().stale > 0}>diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsxindex e7fd15ff46..b7995bd12e 100644--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.layout-guards.test.tsx@@ -27,7 +27,12 @@ vi.mock('@/hooks/useColumnVisibility', () => ({}));vi.mock('@/components/Recovery/RecoveryProtectedInventorySection', () => ({- RecoveryProtectedInventorySection: () => <div data-testid="protected-inventory" />,+ RecoveryProtectedInventorySection: (props: { workspaceControls?: any }) => (+ <div>+ {props.workspaceControls}+ <div data-testid="protected-inventory" />+ </div>+ ),}));vi.mock('@/components/Recovery/RecoveryActivitySection', () => ({@@ -35,7 +40,12 @@ vi.mock('@/components/Recovery/RecoveryActivitySection', () => ({}));vi.mock('@/components/Recovery/RecoveryHistorySection', () => ({- RecoveryHistorySection: () => <div data-testid="history-section" />,+ RecoveryHistorySection: (props: { workspaceControls?: any }) => (+ <div>+ {props.workspaceControls}+ <div data-testid="history-section" />+ </div>+ ),}));import Recovery from '@/components/Recovery/Recovery';diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsxindex 6ed62af74b..ac839ec044 100644--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx@@ -210,10 +210,13 @@ describe('Recovery', () => {expect(screen.getAllByText(/Page 1 \/ 1/i).length).toBeGreaterThan(0);expect(screen.getAllByText((_, element) =>- (element?.textContent || '').replace(/\s+/g, ' ').includes('Sort: Latest point'),+ (element?.textContent || '').replace(/\s+/g, ' ').includes('Latest point'),).length,).toBeGreaterThan(0);- expect(screen.queryByText('Recovery Events')).not.toBeInTheDocument();+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'false',+ );await waitFor(() => {expect(screen.getAllByRole('table')).toHaveLength(1);});@@ -231,7 +234,12 @@ describe('Recovery', () => {fireEvent.click(await screen.findByText('VM 123'));- expect(await screen.findByText('Recovery Events')).toBeInTheDocument();+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });expect(screen.getByRole('tab', { name: /protected items/i })).toHaveAttribute('aria-selected','false',@@ -263,7 +271,12 @@ describe('Recovery', () => {render(() => <Recovery />);- expect(await screen.findByText('Recovery Events')).toBeInTheDocument();+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });expect(screen.getByRole('tab', { name: /protected items/i })).toHaveAttribute('aria-selected','false',@@ -276,7 +289,12 @@ describe('Recovery', () => {render(() => <Recovery />);- expect(await screen.findByText('Recovery Events')).toBeInTheDocument();+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });expect(screen.getByRole('tab', { name: /protected items/i })).toHaveAttribute('aria-selected','false',@@ -366,7 +384,12 @@ describe('Recovery', () => {fireEvent.click(screen.getByText('tank/legacy'));- expect(await screen.findByText('Recovery Events')).toBeInTheDocument();+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });expect(screen.getAllByText('TrueNAS').length).toBeGreaterThan(0);} finally {rollupsPayload.pop();@@ -388,7 +411,12 @@ describe('Recovery', () => {expect(within(inventoryTable).getAllByText('VM').length).toBeGreaterThan(0);fireEvent.click(screen.getByText('VM 123'));- await screen.findByText('Recovery Events');+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });const tables = await screen.findAllByRole('table');const historyTable = tables[tables.length - 1];@@ -435,7 +463,12 @@ describe('Recovery', () => {const item = await screen.findByText('default/data');fireEvent.click(item);- await screen.findByText('Recovery Events');+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });const tables = await screen.findAllByRole('table');const historyTable = tables[tables.length - 1];expect(within(historyTable).getByText('default/data')).toBeInTheDocument();@@ -1014,7 +1047,10 @@ describe('Recovery', () => {).toBe(true);});- expect(screen.getByText('Recovery Events')).toBeInTheDocument();+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );expect(screen.getByText(/Showing 1 - 1 of 1 recovery points/i)).toBeInTheDocument();if (!delayedPointsReady) {@@ -1047,7 +1083,12 @@ describe('Recovery', () => {const timelineButtons = await screen.findAllByRole('button', { name: /recovery points/i });fireEvent.click(timelineButtons[0]);- await screen.findByText('Recovery Events');+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });const selectedDay = '2026-02-13';const selectedStart = parseRecoveryDateKey(selectedDay);@@ -1087,7 +1128,12 @@ describe('Recovery', () => {render(() => <Recovery />);- await screen.findByText('Recovery Events');+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });const selectedStart = parseRecoveryDateKey('2026-02-13');selectedStart.setHours(0, 0, 0, 0);@@ -1109,7 +1155,12 @@ describe('Recovery', () => {render(() => <Recovery />);- await screen.findByText('Recovery Events');+ await waitFor(() => {+ expect(screen.getByRole('tab', { name: /recovery events/i })).toHaveAttribute(+ 'aria-selected',+ 'true',+ );+ });const selectedStart = parseRecoveryDateKey('2026-02-13');selectedStart.setHours(0, 0, 0, 0);