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): flatten inventory workspace scan path
rcourtmancd37e5943f9b
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 7132aaa0db..1f82da0582 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -672,11 +672,11 @@ That same row contract should avoid duplicating context that already has adedicated column. When `Item Type` and `Platform` columns are visible, theprimary item cell should not restate those same badges on desktop; duplicatecontext belongs only as a small-screen fallback when those columns collapse.-That same inventory surface should use structural grouping to surface posture,-not just local row styling. When the protected-item page mixes healthy and-problematic coverage, the table body should section attention items ahead of-healthy coverage so operators can scan the recovery estate the way they scan-other grouped monitoring tables in Pulse.+That same inventory surface should stay on the flat monitoring-table pattern+already used elsewhere in Pulse. Protected items should surface posture through+row-level status cues, outcome pills, and filters rather than inserting extra+`Needs Attention` / `Healthy Coverage` section rows that add height and turn+the primary table into a recovery-only grouped report.That same table-shell contract must avoid duplicate framing once the view tabsalready establish the active workspace. `RecoveryProtectedInventorySection.tsx`should keep page/count/sort orientation inside a slim table-shell status rowdiff --git a/frontend-modern/src/components/Recovery/Recovery.tsx b/frontend-modern/src/components/Recovery/Recovery.tsxindex 04aa73bb83..09ee6007a2 100644--- a/frontend-modern/src/components/Recovery/Recovery.tsx+++ b/frontend-modern/src/components/Recovery/Recovery.tsx@@ -485,13 +485,13 @@ const Recovery: Component = () => {/><div ref={historySectionRef} class="flex flex-col gap-4">- <div class="flex flex-col gap-2 rounded-md border border-border bg-surface px-3 py-1.5 sm:flex-row sm:items-center sm:justify-between">+ <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"><Subtabsvalue={workspaceView()}onChange={(value) => setWorkspaceView(value as RecoveryWorkspaceView)}ariaLabel="Recovery data view"- listClass="flex flex-wrap items-center gap-2"- tabClass="min-h-7 px-2.5 py-1 text-sm"+ listClass="flex flex-wrap items-center gap-1.5"+ tabClass="min-h-7 px-2 py-1 text-sm"tabs={[{value: 'inventory',@@ -514,7 +514,7 @@ const Recovery: Component = () => {]}/><Show when={rollupId().trim().length > 0}>- <span class="inline-flex w-fit items-center rounded-md border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-900/40 dark:bg-amber-950/30 dark:text-amber-300">+ <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>diff --git a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsxindex 64718ba2e7..327beff030 100644--- a/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx+++ b/frontend-modern/src/components/Recovery/RecoveryProtectedInventorySection.tsx@@ -32,7 +32,6 @@ import {import {getRecoveryArtifactColumnLabel,getRecoveryRollupAgeTextClass,- getRecoveryRollupIssueTone,getRecoveryProtectedSearchPlaceholder,getRecoverySearchHistoryEmptyMessage,isRecoveryRollupStale,@@ -50,7 +49,6 @@ import { titleCaseDelimitedLabel } from '@/utils/textPresentation';type VerificationFilter = 'all' | 'verified' | 'unverified' | 'unknown';type ProtectedSortCol = 'item' | 'type' | 'platform' | 'lastBackup' | 'outcome';type SortDir = 'asc' | 'desc';-type ProtectedInventoryGroupKey = 'attention' | 'healthy';interface RecoveryRollupSummary {total: number;@@ -59,12 +57,6 @@ interface RecoveryRollupSummary {neverSucceeded: number;}-interface ProtectedInventoryGroup {- key: ProtectedInventoryGroupKey;- label: string;- items: ProtectionRollup[];-}-interface RecoveryProtectedInventorySectionProps {filteredRollups: Accessor<ProtectionRollup[]>;historyOutcomeFilter: Accessor<'all' | RecoveryOutcome>;@@ -177,38 +169,6 @@ export const RecoveryProtectedInventorySection: Component<return sortedRollups().slice(start, start + PROTECTED_ITEMS_PAGE_SIZE);});- const isAttentionRollup = (rollup: ProtectionRollup): boolean => {- const nowMs = Date.now();- const outcome = normalizeRecoveryOutcome(rollup.lastOutcome);- if (outcome === 'failed' || outcome === 'warning' || outcome === 'unknown') return true;- if (isRecoveryRollupStale(rollup, nowMs)) return true;- const successMs = rollup.lastSuccessAt ? Date.parse(rollup.lastSuccessAt) : 0;- const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;- return successMs <= 0 && attemptMs > 0;- };-- const visibleGroupedRollups = createMemo<ProtectedInventoryGroup[]>(() => {- const attention: ProtectionRollup[] = [];- const healthy: ProtectionRollup[] = [];-- for (const rollup of visibleRollups()) {- if (isAttentionRollup(rollup)) {- attention.push(rollup);- } else {- healthy.push(rollup);- }- }-- const groups: ProtectedInventoryGroup[] = [];- if (attention.length > 0) {- groups.push({ key: 'attention', label: 'Needs Attention', items: attention });- }- if (healthy.length > 0) {- groups.push({ key: 'healthy', label: 'Healthy Coverage', items: healthy });- }- return groups;- });-const pageStart = createMemo(() =>sortedRollups().length === 0 ? 0 : (protectedPage() - 1) * PROTECTED_ITEMS_PAGE_SIZE + 1,);@@ -457,24 +417,8 @@ export const RecoveryProtectedInventorySection: Component<</TableRow></TableHeader><TableBody class="divide-y divide-border">- <For each={visibleGroupedRollups()}>- {(group) => (- <>- <TableRow class="bg-surface-alt/75">- <TableCell- colspan={5}- class="py-1 pr-3 pl-3 text-[12px] sm:text-sm font-semibold text-base-content"- >- <div class="flex items-center gap-2">- <span>{group.label}</span>- <span class="text-[10px] font-normal uppercase tracking-wide text-muted">- {group.items.length} item{group.items.length === 1 ? '' : 's'}- </span>- </div>- </TableCell>- </TableRow>- <For each={group.items}>- {(rollup) => {+ <For each={visibleRollups()}>+ {(rollup) => {const resourceIndex = props.resourcesById();const label = getRecoveryRollupItemLabel(rollup, resourceIndex);const attemptMs = rollup.lastAttemptAt ? Date.parse(rollup.lastAttemptAt) : 0;@@ -618,10 +562,7 @@ export const RecoveryProtectedInventorySection: Component<</TableCell></TableRow>);- }}- </For>- </>- )}+ }}</For></TableBody></Table>diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsxindex 35a3c51a88..91d6550fd5 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.test.tsx@@ -57,7 +57,6 @@ describe('RecoverySummary', () => {expect(screen.getByText('Protected Footprint')).toBeInTheDocument();expect(screen.getByText('Freshness')).toBeInTheDocument();expect(screen.getByText('Recent History')).toBeInTheDocument();- expect(screen.getAllByText('Attention Queue').length).toBeGreaterThan(0);expect(screen.getAllByText('Stale').length).toBeGreaterThan(0);expect(screen.getAllByText('Attention').length).toBeGreaterThan(0);expect(screen.getByText('Recovery Points')).toBeInTheDocument();@@ -65,6 +64,7 @@ describe('RecoverySummary', () => {expect(screen.getByText('Primary Item')).toBeInTheDocument();expect(screen.getByText('Primary Platform')).toBeInTheDocument();expect(screen.getByText('Platform Mix')).toBeInTheDocument();+ expect(screen.getByText('Avg / Day')).toBeInTheDocument();expect(screen.getByText('2 protected')).toBeInTheDocument();expect(screen.getByText('1 healthy')).toBeInTheDocument();expect(screen.getAllByText('Never succeeded').length).toBeGreaterThan(0);diff --git a/frontend-modern/src/components/Recovery/RecoverySummary.tsx b/frontend-modern/src/components/Recovery/RecoverySummary.tsxindex c4902c1728..6251cb419b 100644--- a/frontend-modern/src/components/Recovery/RecoverySummary.tsx+++ b/frontend-modern/src/components/Recovery/RecoverySummary.tsx@@ -103,30 +103,31 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {timeRanges={RECOVERY_SUMMARY_TIME_RANGES}timeRangeLabels={RECOVERY_SUMMARY_TIME_RANGE_LABELS}testId="recovery-summary"+ class="overflow-hidden"><SummaryMetricCard label="Recovery Posture" loaded={true} hasData={hasRollups()}>- <div class="flex h-full flex-col gap-3">- <div class="grid grid-cols-3 gap-2 border-b border-border-subtle pb-2.5 text-sm">+ <div class="flex h-full flex-col gap-2.5">+ <div class="grid grid-cols-3 gap-2 text-sm"><div><div class="text-[11px] uppercase tracking-wide text-muted">Healthy</div>- <div class="mt-1 text-xl font-semibold text-emerald-600 dark:text-emerald-400">+ <div class="mt-1 text-lg font-semibold text-emerald-600 dark:text-emerald-400">{healthyCount()}</div></div><div><div class="text-[11px] uppercase tracking-wide text-muted">Attention</div>- <div class="mt-1 text-xl font-semibold text-amber-600 dark:text-amber-400">+ <div class="mt-1 text-lg font-semibold text-amber-600 dark:text-amber-400">{attentionCount()}</div></div><div><div class="text-[11px] uppercase tracking-wide text-muted">Protected</div>- <div class="mt-1 text-xl font-semibold text-base-content">{summary().total}</div>+ <div class="mt-1 text-lg font-semibold text-base-content">{summary().total}</div></div></div>- <div class="space-y-2">- <div class="h-2 overflow-hidden rounded-full bg-surface-alt">+ <div class="space-y-1.5">+ <div class="h-1.5 overflow-hidden rounded-full bg-surface-alt"><div class="flex h-full"><For each={postureSegments()}>{(segment) => (@@ -139,10 +140,10 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {</For></div></div>- <div class="grid grid-cols-2 gap-x-3 gap-y-1.5">+ <div class="grid grid-cols-2 gap-x-3 gap-y-1 text-xs"><For each={postureSegments()}>{(segment) => (- <div class="flex items-center justify-between gap-3 text-sm">+ <div class="flex items-center justify-between gap-3"><div class="flex items-center gap-2 text-base-content"><span class={`h-2 w-2 rounded-full ${segment.color}`} /><span>{segment.label}</span>@@ -159,79 +160,64 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {</SummaryMetricCard><SummaryMetricCard label="Freshness" loaded={true} hasData={hasRollups()}>- <div class="flex h-full flex-col gap-3">- <dl class="space-y-2 text-sm">- <div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2">- <dt class="text-[11px] uppercase tracking-wide text-muted">Stale</dt>- <dd class="font-semibold text-amber-600 dark:text-amber-400">{summary().stale}</dd>+ <div class="flex h-full flex-col gap-2.5">+ <div class="grid grid-cols-2 gap-2">+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-2">+ <div class="text-[10px] uppercase tracking-wide text-muted">Stale</div>+ <div class="mt-1 text-lg font-semibold text-amber-600 dark:text-amber-400">+ {summary().stale}+ </div></div>- <div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2">- <dt class="text-[11px] uppercase tracking-wide text-muted">Never succeeded</dt>- <dd class="font-semibold text-rose-600 dark:text-rose-400">+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-2">+ <div class="text-[10px] uppercase tracking-wide text-muted">Never succeeded</div>+ <div class="mt-1 text-lg font-semibold text-rose-600 dark:text-rose-400">{summary().neverSucceeded}- </dd>+ </div></div>- <div class="flex items-center justify-between gap-3">- <dt class="text-[11px] uppercase tracking-wide text-muted">Running</dt>- <dd class="font-semibold text-blue-600 dark:text-blue-400">+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-2">+ <div class="text-[10px] uppercase tracking-wide text-muted">Running</div>+ <div class="mt-1 text-lg font-semibold text-blue-600 dark:text-blue-400">{postureSummary().running}- </dd>- </div>- </dl>-- <div>- <div class="mb-2 text-[11px] font-medium uppercase tracking-wide text-muted">- Attention Queue+ </div></div>- <div class="space-y-1.5">- <For each={attentionItems()}>- {(item) => (- <div class="flex items-center justify-between gap-3 text-sm">- <div class="flex items-center gap-2 text-base-content">- <span- class={`h-2.5 w-2.5 rounded-full ${getRecoveryAttentionDotClass(item.tone)}`}- />- <span>{item.label}</span>- </div>- <span- class={`font-semibold tabular-nums ${- item.tone === 'rose'- ? 'text-rose-600 dark:text-rose-400'- : item.tone === 'blue'- ? 'text-blue-600 dark:text-blue-400'- : 'text-amber-600 dark:text-amber-400'- }`}- >- {item.count}- </span>- </div>- )}- </For>+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-2">+ <div class="text-[10px] uppercase tracking-wide text-muted">Attention</div>+ <div class="mt-1 text-lg font-semibold text-amber-600 dark:text-amber-400">+ {attentionCount()}+ </div></div></div>- <div class="border-t border-border-subtle pt-2.5">- <div class="mb-2 text-[11px] font-medium uppercase tracking-wide text-muted">- Freshness Bands- </div>- <div class="flex flex-wrap gap-1.5">- <For each={freshnessBuckets()}>- {(bucket) => (- <div class="inline-flex items-center gap-2 rounded-md border border-border-subtle bg-surface-alt/35 px-2 py-1 text-xs">- <span class={`h-2 w-2 rounded-full ${bucket.color}`} />- <span class="text-base-content">{bucket.label}</span>- <span class="tabular-nums text-base-content">{bucket.count}</span>+ <div class="flex flex-wrap gap-1.5 border-t border-border-subtle pt-2">+ <For each={freshnessBuckets()}>+ {(bucket) => (+ <div class="inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-surface-alt/35 px-2 py-1 text-[11px]">+ <span class={`h-2 w-2 rounded-full ${bucket.color}`} />+ <span class="text-base-content">{bucket.label}</span>+ <span class="tabular-nums text-base-content">{bucket.count}</span>+ </div>+ )}+ </For>+ <For each={attentionItems()}>+ {(item) => (+ <Show when={item.label === 'Never succeeded' || item.label === 'Running'}>+ <div class="inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-surface-alt/35 px-2 py-1 text-[11px]">+ <span+ class={`h-2 w-2 rounded-full ${getRecoveryAttentionDotClass(item.tone)}`}+ />+ <span class="text-base-content">{item.label}</span>+ <span class="tabular-nums text-base-content">{item.count}</span></div>- )}- </For>- </div>+ </Show>+ )}+ </For></div></div></SummaryMetricCard><SummaryMetricCard label="Protected Footprint" loaded={true} hasData={hasRollups()}>- <div class="flex h-full flex-col gap-2.5">- <dl class="space-y-2 text-sm">+ <div class="flex h-full flex-col gap-2">+ <dl class="space-y-1.5 text-sm"><div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2"><dt class="text-[11px] uppercase tracking-wide text-muted">Item Types</dt><dd class="font-semibold text-base-content">{itemCoverage().itemTypeCount}</dd>@@ -255,30 +241,25 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {</dl><Show when={itemCoverage().items.length > 0}>- <div>- <div class="mb-2 text-[11px] font-medium uppercase tracking-wide text-muted">- Item Types- </div>- <div class="flex flex-wrap gap-1.5">+ <div class="flex flex-wrap gap-1.5 pt-1"><For each={itemCoverage().items.slice(0, 6)}>{(item) => (- <div class="inline-flex items-center gap-2 text-[10px]">+ <div class="inline-flex items-center gap-2 text-[11px]"><span class={item.toneClass}>{item.label}</span><span class="tabular-nums text-base-content">{item.count}</span><span class="text-muted">{item.percent}%</span></div>)}</For>- </div></div></Show>- <div>- <div class="mb-2 text-[11px] font-medium uppercase tracking-wide text-muted">+ <div class="border-t border-border-subtle pt-2">+ <div class="mb-1.5 text-[11px] font-medium uppercase tracking-wide text-muted">Platform Mix</div><Show when={platformCoverage().multiPlatformCount > 0}>- <div class="mb-2 text-xs text-muted">+ <div class="mb-1.5 text-xs text-muted">{platformCoverage().multiPlatformCount} multi-platform item{platformCoverage().multiPlatformCount === 1 ? '' : 's'}</div>@@ -288,7 +269,7 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {{(item) => {const badge = getSourcePlatformBadge(item.key);return (- <div class="inline-flex items-center gap-2 text-[10px]">+ <div class="inline-flex items-center gap-2 text-[11px]"><span class={badge?.classes || 'inline-flex items-center rounded px-2 py-0.5 text-[10px] font-medium whitespace-nowrap bg-surface-alt text-base-content'}>{badge?.label || item.label}</span>@@ -309,8 +290,8 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {hasData={activity().hasData}emptyMessage={props.seriesFailed?.() ? 'Trend data unavailable' : 'No recovery activity yet'}>- <div class="flex h-full flex-col gap-2.5">- <dl class="space-y-2 text-sm">+ <div class="flex h-full flex-col gap-2">+ <dl class="space-y-1.5 text-sm"><Show when={recentWindowLabel()}><div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2"><dt class="text-[11px] uppercase tracking-wide text-muted">Window</dt>@@ -321,10 +302,6 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<dt class="text-[11px] uppercase tracking-wide text-muted">Recovery Points</dt><dd class="font-semibold text-base-content">{activity().totalEvents}</dd></div>- <div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2">- <dt class="text-[11px] uppercase tracking-wide text-muted">Avg / Day</dt>- <dd class="font-semibold text-base-content">{activity().averagePerDay.toFixed(1)}</dd>- </div><div class="flex items-center justify-between gap-3 border-b border-border-subtle pb-2"><dt class="text-[11px] uppercase tracking-wide text-muted">Days Active</dt><dd class="font-semibold text-base-content">{activity().activeDays}</dd>@@ -338,14 +315,20 @@ export const RecoverySummary: Component<RecoverySummaryProps> = (props) => {<dd class="font-semibold text-base-content">{activity().latestLabel ?? 'n/a'}</dd></div></dl>- <div class="flex flex-wrap gap-2 border-t border-border-subtle pt-3 text-xs">- <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-1">- <span class="text-muted">Peak Throughput</span>- <span class="ml-2 font-semibold text-base-content">{activity().busiestCount}</span>+ <div class="grid grid-cols-3 gap-2 border-t border-border-subtle pt-2 text-[11px]">+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-1.5">+ <div class="uppercase tracking-wide text-muted">Avg / Day</div>+ <div class="mt-1 font-semibold text-base-content">+ {activity().averagePerDay.toFixed(1)}+ </div>+ </div>+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-1.5">+ <div class="uppercase tracking-wide text-muted">Peak</div>+ <div class="mt-1 font-semibold text-base-content">{activity().busiestCount}</div></div>- <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-1">- <span class="text-muted">Latest Throughput</span>- <span class="ml-2 font-semibold text-base-content">{activity().latestCount}</span>+ <div class="rounded-md border border-border-subtle bg-surface-alt/35 px-2.5 py-1.5">+ <div class="uppercase tracking-wide text-muted">Latest</div>+ <div class="mt-1 font-semibold text-base-content">{activity().latestCount}</div></div></div></div>diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsxindex 28065c9ee4..3620abe8e9 100644--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx@@ -205,8 +205,8 @@ describe('Recovery', () => {expect(screen.getByText('Recovery Posture')).toBeInTheDocument();expect(await screen.findByRole('tab', { name: /protected items/i })).toBeInTheDocument();await screen.findByText('VM 123');- expect(screen.getByText('Needs Attention')).toBeInTheDocument();expect(screen.queryByText('Protected inventory')).not.toBeInTheDocument();+ expect(screen.queryByText('Needs Attention')).not.toBeInTheDocument();expect(screen.getAllByText(/Page 1 \/ 1/i).length).toBeGreaterThan(0);expect(screen.getAllByText((_, element) =>