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
Preserve producer aggregate disk capacity in compact summaries
pulse-triage[bot]77d680f6cffb
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 5b4a9ae7da..8574d82895 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -10580,3 +10580,20 @@ not its selection; existing tab and health-count actions remain the way tochoose another view. This adds no route, assessment or backend mutation.`ProxmoxBackupsTable.test.tsx` verifies focused open evidence across both pollingdirections, deferred/failing assessment, retry and URL/history compatibility.++### Compact disk summaries preserve producer aggregate ownership++In aggregate mode, a usable supplied aggregate owns the total percentage and+byte summary even when filesystem rows are present. Aliases in the breakdown+must not be counted as independent capacity. Mount rows retain their own values,+severity, order and tooltips; explicit max and per-filesystem modes are unchanged.+Without a usable aggregate, measured-row fallback remains. Independent percentages+must not borrow byte totals from the breakdown. Current/last-known/unavailable+classification and unknown-filesystem admission remain authoritative.++`StackedDiskBar.test.tsx` exercises alias/reorder/zero, invalid and+percentage-only aggregates, fallback, severity, freshness and mounted replacements.+`DisksCard.test.tsx` checks that its normalized ratio crosses the aggregate+component boundary as a percentage. Actual producer frames must pass through+canonical resource and Workloads projection into desktop/narrow consumers, with+pixels inspected. This is presentation correction, not native guest recovery.diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 966c641453..4b1ecce048 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -4586,3 +4586,17 @@ The reserve derives from the full keyed measured-height map plus table chrome,not a DOM height sampled while a window retires. Offscreen detail measurementsremain in that map until the owning item is remeasured or removed, so a transientDOM extent cannot lower the reserve before its compensating spacer settles.++### Workloads aggregate disk summaries do not re-sum device aliases++Compact aggregate bars consume a usable producer aggregate for utilization and+byte totals, without duplicating the capacity of aliases retained in the mount+breakdown. Source-owned freshness, unknown readings, per-mount severity and+explicit maximum summaries keep their existing semantics. Other rendering modes+retain their geometry. Percentage-only aggregates cannot borrow mount bytes;+missing/invalid aggregates retain measured-row fallback. The normal+`StackedDiskBar.test.tsx` suite covers aliases, reorder, zero, fallback,+percentage-only evidence, severity and live current/retained/unavailable changes.+Desktop/narrow consuming proof uses production poll/broadcast frames through+canonical resource and Workloads projection. No collection, query, resource+identity, read cadence or native guest operation changes.diff --git a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsxindex c7fe71295d..8cce8f6596 100644--- a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx+++ b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx@@ -15,6 +15,7 @@ if (typeof globalThis.ResizeObserver === 'undefined') {}import { StackedDiskBar } from '../StackedDiskBar';+import { buildStackedDiskBarPresentation } from '../stackedDiskBarModel';// ── Helpers ──────────────────────────────────────────────────────────────────@@ -696,3 +697,134 @@ describe('reactive disk reading decorations', () => {fireEvent.mouseLeave(getBarTrigger(container));});});++const mounts = (): Disk[] => [+ { mountpoint: '/', device: '/dev/vda1', total: 1000, used: 200, usage: 20 },+ { mountpoint: '/var/lib/containers', device: '/dev/vdb1', total: 9000, used: 8820, usage: 98 },+ { mountpoint: '/data-alias', device: '/dev/vdb1', total: 9000, used: 6000, usage: 66.67 },+];+const aggregate = (): Disk => ({ total: 10_000, used: 9020, usage: 90.2 });+const present = (aggregateDisk: Disk | undefined, disks = mounts()) =>+ buildStackedDiskBarPresentation({ disks, aggregateDisk, mode: 'aggregate' }, 400);++describe('source-owned aggregate disk summary', () => {+ it.each([false, true])(+ 'uses the supplied aggregate without recounting aliases (reorder=%s)',+ (reverse) => {+ const disks = reverse ? mounts().reverse() : mounts();+ const p = present(aggregate(), disks);+ expect(p.displayPercentValue).toBe(90.2);+ expect(p.barPercent).toBe(90.2);+ expect(p.displaySublabel).toBe('8.81 KB/9.77 KB');+ expect(p.barColor).toBe('rgba(239, 68, 68, 0.6)');+ expect(p.tooltipContent.map((row) => row.label)).toEqual(+ disks.map((disk) => disk.mountpoint),+ );+ expect(p.tooltipContent.find((row) => row.label === '/var/lib/containers')?.percent).toBe(+ '98%',+ );+ expect(disks).toEqual(reverse ? mounts().reverse() : mounts());+ },+ );++ it('preserves source zero rather than counting retained mount readings', () => {+ expect(present({ total: 10_000, used: 0, usage: 0 }).displayPercentValue).toBe(0);+ expect(present({ total: 10_000, used: 0, usage: 0 }).displaySublabel).toBe('0 B/9.77 KB');+ expect(present({ total: 10_000, used: 200, usage: 2 }).displayPercentValue).toBe(2);+ });++ it.each([undefined, { total: 10_000 }, { total: 10_000, usage: -1 }, { usage: NaN }])(+ 'falls back to measured rows when the aggregate has no usable usage (%j)',+ (value) => {+ const p = present(value);+ expect(p.displayPercentValue).toBeCloseTo((15_020 / 19_000) * 100);+ expect(p.displaySublabel).toBe('14.7 KB/18.6 KB');+ },+ );++ it.each([{ usage: 0.5 }, { total: Infinity, used: 50, usage: 50 }, { total: 100, usage: 25 }])(+ 'preserves independent aggregate percentages without borrowing mount bytes (%j)',+ (value) => {+ const p = present(value);+ expect(p.displayPercentValue).toBe(value.usage);+ expect(p.displaySublabel).toBe('');+ expect(p.showSublabel).toBe(false);+ expect(p.tooltipContent).toHaveLength(3);+ },+ );++ it('retains max summary, per-filesystem colours and non-aggregate geometry', () => {+ const props = { disks: mounts(), aggregateDisk: aggregate() };+ const max = buildStackedDiskBarPresentation(+ { ...props, mode: 'aggregate', summaryStrategy: 'max' },+ 400,+ );+ expect(max.displayPercentValue).toBe(98);+ expect(max.displaySublabel).toBe('');+ expect(max.maxLabelFull).toBe('Highest usage: /var/lib/containers 98%');+ for (const mode of ['stacked', 'mini', 'vertical-bars'] as const) {+ expect(buildStackedDiskBarPresentation({ ...props, mode }, 400)).toEqual(+ buildStackedDiskBarPresentation({ disks: mounts(), mode }, 400),+ );+ }+ });++ it('does not confer freshness or usable bytes on unknown filesystems', () => {+ const disks = mounts().map((disk) => ({ ...disk, usage: -1 }));+ const retained = buildStackedDiskBarPresentation(+ {+ disks,+ aggregateDisk: aggregate(),+ mode: 'aggregate',+ reading: { state: 'last-known', message: 'Retained, not live' },+ },+ 400,+ );+ expect(retained.displayPercentValue).toBe(90.2);+ expect(retained.barColor).toBe('rgba(148, 163, 184, 0.5)');+ expect(retained.tooltipTitle).toBe('Last known disk breakdown');+ expect(retained.tooltipContent.every((row) => row.used === '?' && row.percent === '—')).toBe(+ true,+ );+ const missing = buildStackedDiskBarPresentation(+ { disks, aggregateDisk: { total: 10_000 }, mode: 'aggregate' },+ 400,+ );+ expect(missing.displayLabel).toBe('N/A');+ });++ it('updates the mounted bar and open mount breakdown through source replacements', async () => {+ const [disk, setDisk] = createSignal(aggregate());+ const [disks, setDisks] = createSignal(mounts());+ const [state, setState] = createSignal<'current' | 'last-known' | 'unavailable'>('current');+ const { container } = render(() => (+ <StackedDiskBar+ mode="aggregate"+ aggregateDisk={disk()}+ disks={disks()}+ reading={{ state: state(), message: null }}+ />+ ));+ const shell = container.firstElementChild;+ const fill = () => container.querySelector('[data-stacked-disk-fill="single"]');+ expect(fill()).toHaveAttribute('width', '90.2');+ await fireEvent.mouseEnter(container.querySelector('[data-stacked-disk-trigger]')!);+ expect(await screen.findByText('/var/lib/containers')).toBeVisible();+ expect(screen.getByText('/data-alias')).toBeVisible();+ expect(screen.getByText('98%')).toBeVisible();+ setDisks(mounts().reverse());+ expect(fill()).toHaveAttribute('width', '90.2');+ setDisk({ total: 10_000, used: 200, usage: 2 });+ expect(fill()).toHaveAttribute('width', '2');+ setState('last-known');+ expect(fill()).toHaveAttribute('fill', 'rgba(148, 163, 184, 0.5)');+ setState('unavailable');+ expect(container.querySelector('[data-stacked-disk-unavailable]')).toHaveTextContent('N/A');+ expect(fill()).toBeNull();+ setState('current');+ setDisk({ total: 10_000, used: 0, usage: 0 });+ expect(fill()).toHaveAttribute('width', '0');+ expect(container.firstElementChild).toBe(shell);+ expect(screen.getByText('/data-alias')).toBeVisible();+ });+});diff --git a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts b/frontend-modern/src/components/Workloads/stackedDiskBarModel.tsindex 83a38e007b..6d13c86cdc 100644--- a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts+++ b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts@@ -322,13 +322,19 @@ export function buildStackedDiskBarPresentation(disks.length > 0? (containerWidth - INLINE_DISK_SLOT_GAP_PX * (disks.length - 1)) / disks.length: 0;- const totalCapacity = hasDisks+ // The producer owns aggregate capacity (including device-alias admission).+ // Mount rows are a breakdown, not an independently additive inventory.+ // Keep their observations for severity/tooltips and the explicit max mode;+ // only fall back to summing measured rows when no usable aggregate exists.+ const useAggregateSummary = !unavailable && aggregateMode && hasAggregateUsage;+ const summarizeDisks = hasDisks && !useAggregateSummary;+ const totalCapacity = summarizeDisks? disks.reduce((sum, disk) => sum + (disk.total || 0), 0): (aggregateDisk?.total ?? 0);- const totalUsed = hasDisks+ const totalUsed = summarizeDisks? disks.reduce((sum, disk) => sum + (disk.used || 0), 0): (aggregateDisk?.used ?? 0);- const overallPercent = hasDisks+ const overallPercent = summarizeDisks? (totalUsed / totalCapacity) * 100: unavailable? 0@@ -354,7 +360,7 @@ export function buildStackedDiskBarPresentation(!Number.isFinite(totalUsed) ||!Number.isFinite(totalCapacity) ||totalCapacity <= 0 ||- (!hasDisks &&+ (!summarizeDisks &&!(typeof aggregateDisk?.used === 'number' &&Number.isFinite(aggregateDisk.used) &&diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 7e3ca09d3c..8606191329 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -334,6 +334,13 @@ const frontendIndexCssSource = readFileSync(join(process.cwd(), 'src/index.css')const readFrontendSource = (path: string) => readFileSync(join(process.cwd(), path), 'utf8');describe('shared primitive guardrails', () => {+ it('converts normalized disk usage ratios to percentages at the aggregate bar boundary', () => {+ const source = readFrontendSource('src/components/shared/cards/DisksCard.tsx');+ expect(source).toContain('aggregateDisk={{ ...aggregate(), usage: aggregateUsagePercent() }}');+ expect(source).toContain('(aggregate.used / aggregate.total) * 100');+ expect(source).not.toContain('aggregateDisk={aggregate()}');+ });+it('keeps disk mounts in the parent scrolling flow rather than a hidden nested list', () => {const source = readFrontendSource('src/components/shared/cards/DisksCard.tsx');expect(source).toContain('data-testid="disks-card-mounts"');diff --git a/frontend-modern/src/components/shared/cards/DisksCard.tsx b/frontend-modern/src/components/shared/cards/DisksCard.tsxindex 572600b7bf..ec9e31b8a1 100644--- a/frontend-modern/src/components/shared/cards/DisksCard.tsx+++ b/frontend-modern/src/components/shared/cards/DisksCard.tsx@@ -68,7 +68,12 @@ export const DisksCard: Component<DisksCardProps> = (props) => {value={`${formatBytes(aggregate().used)} / ${formatBytes(aggregate().total)}`}valueClass={getMetricTextColorClass(aggregateUsagePercent(), 'disk')}/>- <StackedDiskBar disks={props.disks} aggregateDisk={aggregate()} mode="aggregate" />+ {/* NormalizedDisk.usage is a ratio; aggregate Disk.usage is a percentage. */}+ <StackedDiskBar+ disks={props.disks}+ aggregateDisk={{ ...aggregate(), usage: aggregateUsagePercent() }}+ mode="aggregate"+ /></Show></div>)}diff --git a/frontend-modern/src/components/shared/cards/__tests__/DisksCard.test.tsx b/frontend-modern/src/components/shared/cards/__tests__/DisksCard.test.tsxindex a0ad9dda5f..c94bcdb3ad 100644--- a/frontend-modern/src/components/shared/cards/__tests__/DisksCard.test.tsx+++ b/frontend-modern/src/components/shared/cards/__tests__/DisksCard.test.tsx@@ -6,7 +6,7 @@ import { DisksCard } from '../DisksCard';vi.mock('@/components/Workloads/StackedDiskBar', () => ({StackedDiskBar: (props: {disks?: unknown[];- aggregateDisk?: { total?: number; used?: number };+ aggregateDisk?: { total?: number; used?: number; usage?: number };mode?: string;}) => (<div@@ -15,6 +15,7 @@ vi.mock('@/components/Workloads/StackedDiskBar', () => ({data-disk-count={props.disks?.length ?? 0}data-total={props.aggregateDisk?.total}data-used={props.aggregateDisk?.used}+ data-usage={props.aggregateDisk?.usage}/>),}));@@ -52,6 +53,7 @@ describe('DisksCard', () => {expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-disk-count', '2');expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-total', '400');expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-used', '180');+ expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-usage', '45');expect(screen.getByText('/')).toBeInTheDocument();expect(screen.getByText('/data')).toBeInTheDocument();});