Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

Make host table disk, alert and view toggles readable

rcourtmand07461dbbf5b
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index f3d676707b..e437389784 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -15,6 +15,24 @@
## Purpose
+### Host rows show their own alerts, including Proxmox physical disks (2 November 2026)
+
+The Proxmox node row's alert stripe and tint read the node's own alerts
+through `getUnifiedResourceAlertStyles`, the matcher the Docker, Machines and
+Kubernetes host tables already use, instead of every alert whose `node` field
+equals the node name. A guest's alert marks its guest row, not its host's, so
+a tinted host row is explained by something on that host. The unified matcher
+(`getAlertsForUnifiedResource` in `frontend-modern/src/utils/alerts.ts`) now
+also admits a Proxmox node's physical-disk health and wearout alerts, raised on
+`<instance>:<node>:disk:<device>` (`ProxmoxPhysicalDiskAlertResourceID`), which
+only the name match used to catch; it builds that prefix from the node's
+`proxmox.instance` and `proxmox.nodeName`, as the backend does. Node metric
+alerts keyed on the node source id and agent component alerts under
+`agent:<id>/` are unchanged. `alerts.test.ts` and `ProxmoxNodesTable.test.tsx`
+cover the admitted disk alerts, the excluded guest and sibling-node alerts,
+and the row accent. No alert evaluation, identity, history or notification
+behaviour changes.
+
### Runtime alert controls describe only supported scope (28 October 2026)
Container Runtime rows expose their existing Offline Alerts control, not an
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 094f635375..c6dfe95422 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -20,6 +20,21 @@
## Purpose
+### Compact toggles mark selection by colour, and icon labels stay on one line (2 November 2026)
+
+The compact `FilterButtonGroup` variant (View preferences, type and status
+chips, the history range) marked its default-tone selection only with
+`bg-surface` on a `bg-surface-hover` track. In dark mode that fill is darker
+than the track, so the selected option read as unselected. The default active
+tone in `filterButtonGroupModel.ts` now carries blue text and a blue ring
+(`text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-800`), as the
+default and segmented variants already do; explicitly toned options keep their
+own colours. A `visualLabel` that contains an icon wraps in an
+`inline-flex items-center gap-1` span in `FilterButtonGroup.tsx`, because
+preflight makes an svg a block box and stacked Layout and Metrics icons above
+their text. `FilterButtonGroup.test.tsx` covers the selected tone and the icon
+row. No option, value, keyboard or count behaviour changes.
+
### Audit viewer state belongs to its reader and accepted page
The existing Audit Log panel receives live principal, non-secret token/scope
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index dc9db4d140..86ffe5911e 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -3423,13 +3423,15 @@ resize-observer plus tooltip lifecycle live in
`frontend-modern/src/components/Workloads/useStackedDiskBarState.ts`.
Future disk-bar runtime changes must extend through those owners instead of
reintroducing mixed resize state and presentation branching into the shell.
-The multi-disk `vertical-bars` mode (Proxmox nodes, Machines, and Docker
-hosts with more than one agent-reported disk) draws one equal-weight micro-bar
-per disk and labels the cell with the fullest disk's usage percentage, derived
-in the model from the existing max-disk summary, so a multi-disk host answers
-"how close is this host to running out of space?" at a glance in Bars mode
-instead of only on hover or in Trends mode. The label names no disk in the
-row; the mount and the per-disk breakdown stay in the title and tooltip.
+Proxmox nodes, Machines, and Docker hosts with more than one agent-reported
+disk render the `aggregate` mode with `summaryStrategy="max"`: the same
+horizontal bar a single-disk host gets, sized and coloured by the fullest
+disk and labelled with its percentage plus `max`, so every row in a host
+Disk column reads in one shape and compares down the column. The label names
+no disk in the row; the mount and the per-disk breakdown stay in the title
+and tooltip. The `vertical-bars` mode (one equal-weight micro-bar per disk,
+labelled with the fullest disk's percentage) is no longer used by those
+tables; mixing it with single-disk bars gave one column three shapes.
The dashboard stacked memory bar now follows that same pattern: the shell
stays in `frontend-modern/src/components/Workloads/StackedMemoryBar.tsx`,
while memory-capacity math, balloon/swap tooltip derivation, anomaly label
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 075d411a6c..6320124007 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -23,6 +23,22 @@ and sort the complete canonical change table while startup and ingestion wait.
## Purpose
+### Host Disk columns draw one bar shape (2 November 2026)
+
+Proxmox node, Docker host and Machines tables render a host with more than one
+agent-reported disk through `StackedDiskBar` `mode="aggregate"` with
+`summaryStrategy="max"`: the single horizontal bar a one-disk host gets, sized
+and coloured by the fullest measured disk and labelled `NN% max` when the cell
+is wide enough, so a Disk column reads in one shape down its rows. The
+`vertical-bars` micro-bars are no longer used by these tables. The max summary
+holds while any reported disk is unmeasured, so a full disk is not hidden
+behind a low aggregate. The Proxmox node row's alert accent reads the node's
+own alerts through `getUnifiedResourceAlertStyles`, like the other host
+tables, and no longer tints for a guest's alert. `DockerHostsTable.test.tsx`,
+`AgentsMachinesTable.test.tsx` and `ProxmoxNodesTable.test.tsx` cover the
+rendered shape and the accent. No resource identity, projection or metric
+change.
+
### Backup views share bounded owned-focus restoration
Coverage posture sorting and By date regrouping use the same existing backups
diff --git a/frontend-modern/browser-verification/0a1f48046836b244.json b/frontend-modern/browser-verification/0a1f48046836b244.json
new file mode 100644
index 0000000000..e59f1cc477
--- /dev/null
+++ b/frontend-modern/browser-verification/0a1f48046836b244.json
@@ -0,0 +1,52 @@
+{
+ "version": 1,
+ "base_sha": "daa183bfda853796173c8f5f0a1e04b4ff084fcb",
+ "verified_at": "2026-11-02T09:12:08Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts",
+ "frontend-modern/src/components/shared/FilterButtonGroup.tsx",
+ "frontend-modern/src/components/shared/filterButtonGroupModel.ts",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx",
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx",
+ "frontend-modern/src/utils/alerts.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts": "ff836f9655be9d655411ee86f6e97322bdcb8fa24e1181cadd1c041760d6a17d",
+ "frontend-modern/src/components/shared/FilterButtonGroup.tsx": "c9aa539958b8fce09fe851aeed65e21e1a60cd421854682427abf922e73e870c",
+ "frontend-modern/src/components/shared/filterButtonGroupModel.ts": "428db55df9674f1ddc52f1d5efc0aac98d6c5d1d2d9d5793b506962ced9acca1",
+ "frontend-modern/src/features/docker/DockerHostsTable.tsx": "c6f5d0d926559661ea3b4e1313ac74379c23b4644e3ce6f75d37e7e6c659946c",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx": "7c70e1f7160bac309c9c96ebc475ef7ecdcc736486ba1c57b7c51369cabc4512",
+ "frontend-modern/src/features/standalone/AgentsMachinesTable.tsx": "3566f0c84a3b186c6a62abb67de0324c8562d156dfc29361d563ec4b7da92589",
+ "frontend-modern/src/utils/alerts.ts": "99fae16fcef2e6fa030a18509818c117adb6ee6de02668d4a19b70fda1c2d0ad"
+ },
+ "routes": [
+ "/proxmox/overview",
+ "/standalone/machines",
+ "/docker/overview"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 1000
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "production vite build of this change served by vite preview on pulse-dev against a mock backend built from origin/main (4 Proxmox nodes, 3 machines, 2 Docker hosts, dark theme)",
+ "multi-disk Proxmox nodes and machines, single-disk Proxmox node and Docker hosts",
+ "View preferences open with Grouped, Bars, History, Guest and Show selected",
+ "Mac in-app preview (dark and light themes) for the toggle colours before the pulse-dev pass"
+ ],
+ "interactions": [
+ "read every host Disk cell at 1440 and 390: one horizontal bar per row, no vertical micro-bars, multi-disk rows labelled 'NN% max' on desktop and 'NN%' on phone, single-disk rows keep used/total on desktop",
+ "measured disk labels for clipping (scrollWidth vs clientWidth): none clipped at either width; row heights 33px desktop, 32px phone; no horizontal page overflow",
+ "hovered a multi-disk machine's disk bar: the Disk Breakdown tooltip lists each mount with its percentage and capacity",
+ "opened View preferences: selected toggles render blue text with a blue ring, unselected stay muted; Layout and Metrics icons sit on the label's line (button height 28px)",
+ "no page errors in any route at either width"
+ ]
+}
diff --git a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
index 8cce8f6596..a69379ee8d 100644
--- a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
@@ -619,6 +619,27 @@ describe('StackedDiskBar', () => {
// Bar color should be critical (based on max disk at 92%)
expect(bar?.getAttribute('fill')).toContain('239, 68, 68');
});
+
+ it('draws a multi-disk host as one bar of its fullest disk, as host tables do', () => {
+ const { container } = render(() => (
+ <StackedDiskBar
+ mode="aggregate"
+ summaryStrategy="max"
+ aggregateDisk={makeDisk({ usage: 20, used: 20, total: 100 })}
+ disks={[
+ makeDisk({ mountpoint: '/', usage: 24, used: 24, total: 100 }),
+ makeDisk({ mountpoint: '/data', usage: 93, used: 93, total: 100 }),
+ makeDisk({ mountpoint: '/scratch', usage: -1 }),
+ ]}
+ />
+ ));
+
+ // Same shape as a single-disk row: one fill, no per-disk micro-bars.
+ expect(container.querySelectorAll('[data-stacked-disk-fill="single"]')).toHaveLength(1);
+ expect(container.querySelectorAll('[data-stacked-disk-fill="vertical"]')).toHaveLength(0);
+ expect(getSingleBarFill(container)?.getAttribute('fill')).toContain('239, 68, 68');
+ expect(screen.getByText('93%')).toBeInTheDocument();
+ });
});
describe('vertical-bars mode', () => {
diff --git a/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts b/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
index 8efac72b7d..890321c516 100644
--- a/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/stackedDiskBarModel.branchcov0712b.test.ts
@@ -424,6 +424,44 @@ describe('stackedDiskBarModel (branch coverage 2)', () => {
expect(p.barColor).toBe(CRITICAL); // getMetricColorRgba(90)
});
+ it('keeps the max summary when only one of several reported disks is measured', () => {
+ // An unmeasured sibling must not drop the host to a low aggregate and
+ // hide the full disk it can still read.
+ const p = buildStackedDiskBarPresentation(
+ {
+ mode: 'aggregate',
+ summaryStrategy: 'max',
+ aggregateDisk: makeDisk({ total: 1000, used: 200, free: 800, usage: 20 }),
+ disks: [
+ makeDisk({ mountpoint: '/data', total: 100, used: 95, free: 5, usage: 95 }),
+ makeDisk({ mountpoint: '/scratch', total: 100, used: 0, usage: -1 }),
+ ],
+ },
+ 400,
+ );
+ expect(p.displayPercentValue).toBe(95);
+ expect(p.maxLabelShort).toBe('max');
+ expect(p.showMaxLabel).toBe(true);
+ expect(p.barColor).toBe(CRITICAL);
+ });
+
+ it('drops the max marker rather than clip the percentage in a narrow cell', () => {
+ const p = buildStackedDiskBarPresentation(
+ {
+ mode: 'aggregate',
+ summaryStrategy: 'max',
+ disks: [
+ makeDisk({ mountpoint: '/a', total: 100, used: 30, free: 70, usage: 30 }),
+ makeDisk({ mountpoint: '/b', total: 100, used: 61, free: 39, usage: 61 }),
+ ],
+ },
+ 30,
+ );
+ expect(p.displayPercentValue).toBe(61);
+ expect(p.showMaxLabel).toBe(false);
+ expect(p.maxLabelFull).toBe('Highest usage: /b 61%');
+ });
+
it('builds vertical bars clamped to 0..100 and the vertical-bars container class', () => {
// verticalBarsMode = mode === 'vertical-bars' && hasDisks; fillPercent uses
// Math.max(0, Math.min(percent, 100)) -> exercises the upper clamp. A
diff --git a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
index 6d13c86cdc..fef7bc2cb3 100644
--- a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
+++ b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
@@ -341,8 +341,10 @@ export function buildStackedDiskBarPresentation(
: (aggregatePercent ?? 0);
const anomalyRatio = formatAnomalyRatio(anomaly) ?? '';
const maxInfo = getMaxDiskInfo(disks);
+ // A reported disk without a usable reading must not drop a multi-disk host
+ // back to its aggregate: the measured disk may be the one that is full.
const useMaxSummary =
- aggregateMode && hasMultipleDisks && summaryStrategy === 'max' && maxInfo !== null;
+ aggregateMode && allDisks.length > 1 && summaryStrategy === 'max' && maxInfo !== null;
const displayPercentValue = useMaxSummary && maxInfo ? maxInfo.percent : overallPercent;
const barPercent = Math.min(displayPercentValue, 100);
const maxLabelShort = maxInfo
@@ -374,13 +376,13 @@ export function buildStackedDiskBarPresentation(
? `${disks.length} ${current ? 'operational' : 'last known'} disks in breakdown`
: '';
const showDiskCount = Boolean(props.showDiskCount && hasMultipleDisks);
+ // The max marker is a hint, never worth clipping the percentage for: on a
+ // narrow cell it drops and the tooltip still names the fullest disk.
const showMaxLabel =
- useMaxSummary ||
- (aggregateMode &&
- hasMultipleDisks &&
- maxLabelShort.length > 0 &&
- containerWidth >=
- estimateTextWidth(displayLabel, { detail: ` ${maxLabelShort}` }) + LABEL_PADDING_PX);
+ (useMaxSummary || (aggregateMode && hasMultipleDisks)) &&
+ maxLabelShort.length > 0 &&
+ containerWidth >=
+ estimateTextWidth(displayLabel, { detail: ` ${maxLabelShort}` }) + LABEL_PADDING_PX;
// The anomaly marker shares the label's line whenever it renders.
const anomalyMarker = anomaly?.description && anomalyRatio ? ` ${anomalyRatio}` : '';
const showSublabel =
@@ -394,7 +396,7 @@ export function buildStackedDiskBarPresentation(
LABEL_PADDING_PX;
const barColor = !current
? UNKNOWN_DISK_COLOR
- : aggregateMode && hasMultipleDisks && maxInfo
+ : (useMaxSummary || (aggregateMode && hasMultipleDisks)) && maxInfo
? getMetricColorRgba(maxInfo.percent, 'disk', props.thresholds)
: getMetricColorRgba(overallPercent, 'disk', props.thresholds);
const segments =
diff --git a/frontend-modern/src/components/shared/FilterButtonGroup.test.tsx b/frontend-modern/src/components/shared/FilterButtonGroup.test.tsx
index 9a4bb4079b..3b9f5f8cc6 100644
--- a/frontend-modern/src/components/shared/FilterButtonGroup.test.tsx
+++ b/frontend-modern/src/components/shared/FilterButtonGroup.test.tsx
@@ -238,9 +238,11 @@ describe('FilterButtonGroup', () => {
const activeButton = within(group).getByRole('button', { name: 'All' });
const inactiveButton = within(group).getByRole('button', { name: 'VMs' });
- expect(activeButton.className).toContain('text-base-content');
+ expect(activeButton.className).toContain('text-blue-700');
+ expect(activeButton.className).toContain('dark:text-blue-300');
expect(activeButton.className).toContain('shadow-xs');
expect(inactiveButton.className).toContain('text-muted');
+ expect(inactiveButton.className).not.toContain('text-blue-700');
});
it('keeps every filter option touch-sized on phones and compact above the phone breakpoint', () => {
@@ -285,6 +287,34 @@ describe('FilterButtonGroup', () => {
expect(visualLabel).toHaveClass('whitespace-nowrap');
});
+ it('lays an icon in a visual label beside its text, not above it', () => {
+ render(() => (
+ <FilterButtonGroup
+ ariaLabel="Layout"
+ options={[
+ {
+ value: 'grouped',
+ label: 'Grouped',
+ visualLabel: (
+ <>
+ <svg data-testid="layout-icon" />
+ Grouped
+ </>
+ ),
+ },
+ { value: 'flat', label: 'List' },
+ ]}
+ value="grouped"
+ onChange={() => undefined}
+ variant="compact"
+ />
+ ));
+
+ // Preflight makes an svg a block box; its wrapper must be a row.
+ const iconWrapper = screen.getByTestId('layout-icon').parentElement;
+ expect(iconWrapper).toHaveClass('inline-flex', 'items-center');
+ });
+
it('supports equal-width segmented controls for compact feature settings', () => {
render(() => (
<FilterButtonGroup
diff --git a/frontend-modern/src/components/shared/FilterButtonGroup.tsx b/frontend-modern/src/components/shared/FilterButtonGroup.tsx
index 35c24e8a27..3809045f75 100644
--- a/frontend-modern/src/components/shared/FilterButtonGroup.tsx
+++ b/frontend-modern/src/components/shared/FilterButtonGroup.tsx
@@ -101,7 +101,7 @@ export function FilterButtonGroup<T extends string | number>(props: FilterButton
)
}
>
- <span>{renderedLabel()}</span>
+ <span class="inline-flex items-center gap-1">{renderedLabel()}</span>
</Show>
<Show when={option().count !== undefined}>
<span
diff --git a/frontend-modern/src/components/shared/filterButtonGroupModel.ts b/frontend-modern/src/components/shared/filterButtonGroupModel.ts
index 043e8f4ec9..0d9b9e92ea 100644
--- a/frontend-modern/src/components/shared/filterButtonGroupModel.ts
+++ b/frontend-modern/src/components/shared/filterButtonGroupModel.ts
@@ -48,8 +48,11 @@ const labelClassByVariant: Partial<Record<FilterButtonGroupVariant, string>> = {
default: 'px-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted',
};
+// The compact track is surface-hover, which in dark mode is lighter than the
+// active surface, so the selected button cannot rely on its fill to stand out.
+// Default selection carries the accent colour, as the other variants do.
const activeToneClassByOptionTone: Record<FilterButtonGroupOptionTone, string> = {
- default: 'text-base-content ring-border-subtle',
+ default: 'text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-800',
info: 'text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-800',
success: 'text-emerald-700 dark:text-emerald-300 ring-emerald-200 dark:ring-emerald-800',
warning: 'text-amber-700 dark:text-amber-300 ring-amber-200 dark:ring-amber-800',
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsx
index eb19a93a1d..273dcb7dc9 100644
--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx
@@ -526,7 +526,8 @@ export const DockerHostsTable: Component<{
fallback={<PlatformTableMetricFallback />}
>
<StackedDiskBar
- mode={(disks()?.length ?? 0) > 1 ? 'vertical-bars' : undefined}
+ mode={(disks()?.length ?? 0) > 1 ? 'aggregate' : undefined}
+ summaryStrategy="max"
disks={disks()}
aggregateDisk={aggregateDisk()}
thresholds={diskThresholds()}
diff --git a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
index 89f84ea97a..8f646fe15c 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
@@ -82,11 +82,13 @@ vi.mock('@/components/Workloads/StackedDiskBar', () => ({
disks?: Disk[];
aggregateDisk?: Disk;
mode?: string;
+ summaryStrategy?: string;
thresholds?: MetricDisplayThresholds | null;
}) => (
<div
data-testid="stacked-disk-bar"
data-mode={props.mode ?? ''}
+ data-summary-strategy={props.summaryStrategy ?? ''}
data-disks={String(props.disks?.length ?? 0)}
data-aggregate-usage={String(props.aggregateDisk?.usage ?? '')}
data-thresholds={formatThresholds(props.thresholds)}
@@ -187,7 +189,9 @@ describe('DockerHostsTable', () => {
expect(screen.getByTestId('responsive-cpu-metric')).toHaveAttribute('data-running', 'true');
expect(screen.getByTestId('stacked-memory-bar')).toHaveAttribute('data-used', '3200');
expect(screen.getByTestId('stacked-memory-bar')).toHaveAttribute('data-total', '8000');
- expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-mode', 'vertical-bars');
+ // One bar shape for every host: a multi-disk host reads its fullest disk.
+ expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-mode', 'aggregate');
+ expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-summary-strategy', 'max');
expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-disks', '2');
});
diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
index 409027cbde..9a917e899b 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
@@ -10,7 +10,7 @@ import {
} from 'solid-js';
import { useWebSocket } from '@/contexts/appRuntime';
import { useAlertsActivation } from '@/stores/alertsActivation';
-import { getAlertsForResource, getAlertStyles } from '@/utils/alerts';
+import { getAlertsForResource, getUnifiedResourceAlertStyles } from '@/utils/alerts';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
@@ -510,8 +510,11 @@ export const ProxmoxNodesTable: Component<{
const currentNode = drawerNode();
return currentNode ? hasCurrentProxmoxUpdateEvidence(currentNode) : false;
};
+ // The node's own alerts, the set its drawer lists, as on every
+ // other host table. Matching on the node name would also tint
+ // the row for any guest's alert, with nothing in it to say why.
const alertStyles = createMemo(() =>
- getAlertStyles(node.id, activeAlerts, alertsEnabled(), node.name),
+ getUnifiedResourceAlertStyles(node, activeAlerts, alertsEnabled()),
);
const alertAccentTone = createMemo<
'critical' | 'warning' | 'acknowledged' | undefined
@@ -705,12 +708,11 @@ export const ProxmoxNodesTable: Component<{
fallback={
<StackedDiskBar
mode={
- usesCompactMetrics()
+ usesCompactMetrics() || (node.agent?.disks?.length ?? 0) > 1
? 'aggregate'
- : (node.agent?.disks?.length ?? 0) > 1
- ? 'vertical-bars'
- : undefined
+ : undefined
}
+ summaryStrategy="max"
disks={normalizeDiskArray(node.agent?.disks)}
aggregateDisk={aggregateDisk()}
thresholds={diskThresholds()}
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx
index 95a4569fd0..f17abf0624 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxNodesTable.test.tsx
@@ -528,6 +528,46 @@ describe('ProxmoxNodesTable', () => {
expect(offlineRow).toHaveTextContent('Offline');
});
+ it("accents a node row for its own disks' alerts, not for its guests' alerts", () => {
+ const nodeAlert = (id: string, resourceId: string) => ({
+ id,
+ resourceId,
+ node: 'pve-node-1',
+ level: 'critical',
+ type: 'disk-health',
+ acknowledged: false,
+ });
+ const renderNode = () =>
+ render(() => (
+ <ProxmoxNodesTable
+ nodes={[
+ makeNodeResource({
+ proxmox: { clusterName: 'homelab', instance: 'homelab', nodeName: 'pve-node-1' },
+ }),
+ ]}
+ guests={[]}
+ emptyIcon={<span />}
+ emptyTitle="No Proxmox VE nodes"
+ emptyDescription="No nodes"
+ />
+ ));
+
+ // A guest on the node shares its node name; its row carries that alert.
+ activeAlertsMock.value = { guest: nodeAlert('guest', 'homelab:pve-node-1:101') };
+ renderNode();
+ expect(screen.getByText('pve-node-1').closest('tr')).not.toHaveAttribute(
+ 'data-workload-alert-accent',
+ );
+ cleanup();
+
+ activeAlertsMock.value = { disk: nodeAlert('disk', 'homelab:pve-node-1:disk:/dev/sda') };
+ renderNode();
+ expect(screen.getByText('pve-node-1').closest('tr')).toHaveAttribute(
+ 'data-workload-alert-accent',
+ 'critical',
+ );
+ });
+
it('does not present a retained stale update count as current in the node row', () => {
render(() => (
<ProxmoxNodesTable
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index ec355ed9df..8c0e3b42e1 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -1833,7 +1833,8 @@ export const AgentsMachinesTable: Component<{
fallback={telemetryFallbackMarker()}
>
<StackedDiskBar
- mode={(disks()?.length ?? 0) > 1 ? 'vertical-bars' : undefined}
+ mode={(disks()?.length ?? 0) > 1 ? 'aggregate' : undefined}
+ summaryStrategy="max"
disks={disks()}
aggregateDisk={aggregateDisk()}
thresholds={diskThresholds()}
diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
index 6fbf0669d7..4d93caaf6e 100644
--- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
+++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
@@ -720,7 +720,7 @@ describe('AgentsMachinesTable', () => {
expect(screen.getByTitle(/Agent has stopped reporting/)).toBeInTheDocument();
});
- it('renders multi-disk machine usage as vertical mini-bars', () => {
+ it('renders multi-disk machine usage as one bar for the fullest disk', () => {
const { container } = render(() => (
<AgentsMachinesTable
resources={[
@@ -757,9 +757,11 @@ describe('AgentsMachinesTable', () => {
/>
));
- expect(container.querySelectorAll('[data-stacked-disk-fill="vertical"]')).toHaveLength(2);
- expect(screen.queryByText('max')).not.toBeInTheDocument();
- expect(screen.queryByText('2 disks')).not.toBeInTheDocument();
+ // Same bar shape as a single-disk machine, sized and coloured by /data.
+ expect(container.querySelectorAll('[data-stacked-disk-fill="vertical"]')).toHaveLength(0);
+ expect(container.querySelectorAll('[data-stacked-disk-fill="single"]')).toHaveLength(1);
+ expect(screen.getByText('91%')).toBeInTheDocument();
+ expect(screen.getByText('max')).toBeInTheDocument();
});
it('searches machine-native fields and exposes host-style search affordances', async () => {
diff --git a/frontend-modern/src/utils/__tests__/alerts.test.ts b/frontend-modern/src/utils/__tests__/alerts.test.ts
index ad9ffadc6c..7cfca54046 100644
--- a/frontend-modern/src/utils/__tests__/alerts.test.ts
+++ b/frontend-modern/src/utils/__tests__/alerts.test.ts
@@ -320,6 +320,24 @@ describe('getAlertsForUnifiedResource', () => {
expect(getAlertsForUnifiedResource(host, active, false)).toEqual([]);
});
+ it("matches a Proxmox node's physical-disk alerts but not its guests' alerts", () => {
+ const node = resource({
+ id: 'agent:pve1',
+ proxmox: { sourceId: 'homelab-pve1', instance: 'homelab', nodeName: 'pve1' },
+ } as Partial<Resource>);
+ const active = byId(
+ alert('node-memory', 'homelab-pve1', { node: 'pve1' }),
+ alert('disk-health', 'homelab:pve1:disk:/dev/sda', { level: 'critical', node: 'pve1' }),
+ alert('guest-cpu', 'homelab:pve1:101', { node: 'pve1' }),
+ alert('other-node-disk', 'homelab:pve10:disk:/dev/sda', { node: 'pve10' }),
+ );
+
+ expect(ids(getAlertsForUnifiedResource(node, active, true))).toEqual([
+ 'disk-health',
+ 'node-memory',
+ ]);
+ });
+
it("matches a Docker container's alerts on its host and container ID, or its name", () => {
const container = resource({
id: 'app-container-b858bc8f1caf601a',
diff --git a/frontend-modern/src/utils/alerts.ts b/frontend-modern/src/utils/alerts.ts
index 0c6326cb9a..5de41bba25 100644
--- a/frontend-modern/src/utils/alerts.ts
+++ b/frontend-modern/src/utils/alerts.ts
@@ -183,7 +183,7 @@ const ALERT_LEVEL_RANK: Record<Alert['level'], number> = { critical: 0, warning:
// "agent:<id>/raid:<device>", "docker:<id>/<container>".
const getUnifiedResourceAlertKeys = (
resource: Resource,
-): { exact: Set<string>; machine: string[] } => {
+): { exact: Set<string>; componentPrefixes: string[] } => {
const exact = new Set<string>();
const add = (value: string | undefined) => {
const trimmed = value?.trim();
@@ -211,6 +211,7 @@ const getUnifiedResourceAlertKeys = (
}
const machine = new Set<string>();
+ const componentPrefixes: string[] = [];
if (resource.type === 'agent' || resource.type === 'docker-host') {
const agentId = getActionableAgentIdFromResource(resource);
if (agentId) machine.add(agentId.startsWith('agent:') ? agentId : `agent:${agentId}`);
@@ -227,9 +228,15 @@ const getUnifiedResourceAlertKeys = (
? resource.metricsTarget.resourceId?.trim()
: undefined);
if (dockerHostId) machine.add(`docker:${dockerHostId}`);
+ // A Proxmox node's physical disks raise health and wearout alerts on
+ // "<instance>:<node>:disk:<device>" (ProxmoxPhysicalDiskAlertResourceID).
+ const instance = resource.proxmox?.instance?.trim();
+ const nodeName = resource.proxmox?.nodeName?.trim();
+ if (instance && nodeName) componentPrefixes.push(`${instance}:${nodeName}:disk:`);
}
machine.forEach(add);
- return { exact, machine: [...machine] };
+ componentPrefixes.push(...[...machine].map((key) => `${key}/`));
+ return { exact, componentPrefixes };
};
/**
@@ -252,13 +259,12 @@ export function getAlertsForUnifiedResource(
alertsEnabled: boolean | undefined = isAlertsDetectionEnabled(),
): Alert[] {
if (!alertsEnabled) return [];
- const { exact, machine } = getUnifiedResourceAlertKeys(resource);
- const machinePrefixes = machine.map((key) => `${key}/`);
+ const { exact, componentPrefixes } = getUnifiedResourceAlertKeys(resource);
return Object.values(activeAlerts)
.filter(
(alert) =>
exact.has(alert.resourceId) ||
- machinePrefixes.some((prefix) => alert.resourceId?.startsWith(prefix)),
+ componentPrefixes.some((prefix) => alert.resourceId?.startsWith(prefix)),
)
.sort(
(a, b) =>