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.

Lead the storage table with what is filling up, and say why

rcourtman15ffd92e432b
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index bd2fbe8a17..76a70cde65 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -4300,6 +4300,12 @@ keeps pool-growth label/tone formatting inside the shared feature presentation
layer. The storage page must keep reusing those shared owners instead of
rebuilding storage-history timers or byte-delta formatting inside row
components.
+Storage row alert reasons stay in the same feature presentation layer:
+`storageRowAlertPresentation.ts` turns the row's open alert into a short
+headline (and a compact phone form), `storagePoolsTablePresentation.ts` carries
+it on the row model with its severity tone, and `StoragePoolRow` renders it in
+the State cell through the existing issue-text classes, with no inline style
+and no new row height.
That same shared alerts feature boundary now also owns legacy shared-storage
override migration. `frontend-modern/src/features/alerts/alertOverridesModel.ts`
and `frontend-modern/src/features/alerts/useAlertOverridesState.ts` must
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 0a0168e91a..ccc9bf860a 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -3629,6 +3629,19 @@ That same owned summary path now also runs through
range and one shared storage-summary history fetch, and both the sticky
summary cards and per-pool growth column reuse that payload instead of
forking separate row-local history reads or duplicate polling loops.
+The storage table's default `priority` order is a risk list: records with an
+open, unacknowledged alert sort first by severity (fed into
+`sortStorageRecords` through `StorageSortContext.alertWeightByRecordId` from
+the page's existing per-record alert state), then by the record's own
+`incidentPriority`, then by usage percent; ties read A to Z under every sort
+key and direction. A highlighted row always states its reason: the per-record
+alert state carries a headline from the most severe, most recent open alert
+(`describeStorageAlertHeadline` in `storageRowAlertPresentation.ts`), using the
+alert engine's `forecastDaysToFull` metadata ("Full in ~N days"), the crossed
+usage limit, or the alert message, with a compact form for the phone layouts,
+and the State cell shows it in place of the plain online label. This reads
+existing alert truth only: it adds no storage polling, forecast computation,
+or alert lifecycle.
Storage physical-disk requirements copy now consumes the shared
`frontend-modern/src/utils/infrastructureSettingsPresentation.ts` Settings
Infrastructure target label. Disk-health guidance may refer to Proxmox node
diff --git a/frontend-modern/browser-verification/da49f520c2e28149.json b/frontend-modern/browser-verification/da49f520c2e28149.json
new file mode 100644
index 0000000000..107e1ee1fd
--- /dev/null
+++ b/frontend-modern/browser-verification/da49f520c2e28149.json
@@ -0,0 +1,55 @@
+{
+ "version": 1,
+ "base_sha": "4488a42bcc0d2589e3b77caf5266de38d4e4613a",
+ "verified_at": "2026-10-04T23:45:17Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Storage/StoragePoolRow.tsx",
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx",
+ "frontend-modern/src/components/Storage/useStorageAlertState.ts",
+ "frontend-modern/src/components/Storage/useStorageModel.ts",
+ "frontend-modern/src/components/Storage/useStoragePageData.ts",
+ "frontend-modern/src/features/storageBackups/cephRecordPresentation.ts",
+ "frontend-modern/src/features/storageBackups/models.ts",
+ "frontend-modern/src/features/storageBackups/storageAlertState.ts",
+ "frontend-modern/src/features/storageBackups/storageModelCore.ts",
+ "frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts",
+ "frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Storage/StoragePoolRow.tsx": "2613d99c4ca87d41483ffb3e2bdc36917178e07db1a8bdf4705497c214cfb630",
+ "frontend-modern/src/components/Storage/StoragePoolsTable.tsx": "6581184b6f644f1309deb693f0fff7759ea31948d5f0cf8b19ba7d979616ca94",
+ "frontend-modern/src/components/Storage/useStorageAlertState.ts": "431d224df0362889d7186511d3d2fc348f44cecb32fea9ea379905ea70a76dd7",
+ "frontend-modern/src/components/Storage/useStorageModel.ts": "7a246994ca8a17c4bf099f7e21713bf3c4ddf6b11b1f56d0a6408d4ef6038f59",
+ "frontend-modern/src/components/Storage/useStoragePageData.ts": "8f057b905b182e0758397819a46ad5fc4743768ad9f4d36c11176f4f6afb6437",
+ "frontend-modern/src/features/storageBackups/cephRecordPresentation.ts": "0ce7fd55346e2eb780d0f3cab205dc56be95415b741d9796656a4a54b9f4142d",
+ "frontend-modern/src/features/storageBackups/models.ts": "711795fd932e867f2d86d9a8e4fb536534b24418faff5a39db045002c2431911",
+ "frontend-modern/src/features/storageBackups/storageAlertState.ts": "83d7af491b001189d2cf3ebe70f9150aaae90f3ba157e7f5f1ee2eb4e16519dc",
+ "frontend-modern/src/features/storageBackups/storageModelCore.ts": "e6f9b0829360d6e2e6b8b277b4f913460aacb9ef7cdfe35ce62b85acd2da22ec",
+ "frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts": "9db7bbcfe6fe87de689163e73d714dabd48c822c391df1186b7995ab13c54740",
+ "frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts": "fc11c7badc62ef3b6038bfd4bbe4cd667c721480dcc3c823fdc02205b9b1de42"
+ },
+ "routes": [
+ "/proxmox/storage",
+ "/truenas/storage"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Mock estate, 19 Proxmox storage rows, three with open alerts (usage over 85%, two fill forecasts). Before: default priority order was reverse alphabetical (89%-full pool second, 85% twelfth), alerted rows tinted with no reason, State read Online.",
+ "After: the three alerted rows lead (Over 85% usage limit, Full in ~3 days, Full in ~6 days), then storage from fullest down, ties A to Z; the State cell carries the reason in the severity colour, hover shows reason plus state.",
+ "Phone 390x844: State column uses the compact reason (Over 85%, Full in ~3d, Full in ~6d) without truncation; Online/Stale rows unchanged.",
+ "TrueNAS storage tree (separate component) renders unchanged."
+ ],
+ "interactions": [
+ "Loaded the storage route signed in at desktop and phone widths and inspected full-page screenshots before and after; hovered the reason to confirm the full title; reloaded after the Ceph consolidation fix and confirmed identical ordering."
+ ]
+}
diff --git a/frontend-modern/src/components/Storage/StoragePoolRow.tsx b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
index 1d29643412..c65a4ae88e 100644
--- a/frontend-modern/src/components/Storage/StoragePoolRow.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolRow.tsx
@@ -52,6 +52,9 @@ interface StoragePoolRowProps {
onToggleExpand: () => void;
onHoverChange?: (recordId: string | null) => void;
rowClass: string;
+ alertHeadline?: string | null;
+ alertHeadlineCompact?: string | null;
+ alertHeadlineClass?: string;
physicalDisks: Resource[];
alertDataAttrs: {
'data-row-id': string;
@@ -123,15 +126,32 @@ export const StoragePoolRow: Component<StoragePoolRowProps> = (props) => {
data-storage-column="state"
>
<Show
- when={row().stateLabel !== '—'}
- fallback={<span class={STORAGE_POOL_ROW_PLACEHOLDER_CLASS}>—</span>}
+ when={props.alertHeadline}
+ fallback={
+ <Show
+ when={row().stateLabel !== '—'}
+ fallback={<span class={STORAGE_POOL_ROW_PLACEHOLDER_CLASS}>—</span>}
+ >
+ <span
+ class={`${STORAGE_POOL_ROW_ISSUE_TEXT_CLASS} ${row().stateToneClass}`}
+ title={row().stateTitle || row().stateLabel}
+ >
+ {row().stateLabel}
+ </span>
+ </Show>
+ }
>
- <span
- class={`${STORAGE_POOL_ROW_ISSUE_TEXT_CLASS} ${row().stateToneClass}`}
- title={row().stateTitle || row().stateLabel}
- >
- {row().stateLabel}
- </span>
+ {(headline) => (
+ <span
+ class={`${STORAGE_POOL_ROW_ISSUE_TEXT_CLASS} ${props.alertHeadlineClass ?? ''}`}
+ title={`${headline()} · ${row().stateTitle || row().stateLabel}`}
+ data-storage-alert-headline
+ >
+ {props.layoutMode === 'narrow' || props.layoutMode === 'compact'
+ ? (props.alertHeadlineCompact ?? headline())
+ : headline()}
+ </span>
+ )}
</Show>
</td>
diff --git a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
index 2b81545e57..3b1feb13a0 100644
--- a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
@@ -191,6 +191,9 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
onToggleExpand={() => model.togglePool(record.id)}
onHoverChange={props.onHoverChange}
rowClass={rowModel().rowClass}
+ alertHeadline={rowModel().alertHeadline}
+ alertHeadlineCompact={rowModel().alertHeadlineCompact}
+ alertHeadlineClass={rowModel().alertHeadlineClass}
physicalDisks={props.physicalDisks}
alertDataAttrs={rowModel().alertDataAttrs}
/>
diff --git a/frontend-modern/src/components/Storage/useStorageAlertState.ts b/frontend-modern/src/components/Storage/useStorageAlertState.ts
index 13886381fe..ac77a2cb8b 100644
--- a/frontend-modern/src/components/Storage/useStorageAlertState.ts
+++ b/frontend-modern/src/components/Storage/useStorageAlertState.ts
@@ -7,7 +7,11 @@ import {
mergeStorageAlertRowState,
type StorageAlertRowState,
} from '@/features/storageBackups/storageAlertState';
-import { getAlertStyles } from '@/utils/alerts';
+import { getAlertStyles, getAlertsForResource } from '@/utils/alerts';
+import {
+ describeStorageAlertHeadline,
+ pickStorageHeadlineAlert,
+} from '@/features/storageBackups/storageRowAlertPresentation';
type UseStorageAlertStateOptions = {
records: Accessor<StorageRecord[]>;
@@ -41,7 +45,16 @@ export const useStorageAlertState = (options: UseStorageAlertStateOptions) => {
hasAcknowledgedOnlyAlert: styles.hasAcknowledgedOnlyAlert,
});
}
- byRecordId[record.id] = merged;
+ const headlineAlert = pickStorageHeadlineAlert(
+ getAlertsForResource(candidateIds, activeAlerts, enabled),
+ );
+ byRecordId[record.id] = {
+ ...merged,
+ headline: headlineAlert ? describeStorageAlertHeadline(headlineAlert) : null,
+ headlineCompact: headlineAlert
+ ? describeStorageAlertHeadline(headlineAlert, { compact: true })
+ : null,
+ };
}
return byRecordId;
diff --git a/frontend-modern/src/components/Storage/useStorageModel.ts b/frontend-modern/src/components/Storage/useStorageModel.ts
index 88ec7dfeb9..d352b91c7a 100644
--- a/frontend-modern/src/components/Storage/useStorageModel.ts
+++ b/frontend-modern/src/components/Storage/useStorageModel.ts
@@ -34,6 +34,7 @@ type UseStorageModelOptions = {
sortKey: Accessor<StorageSortKey>;
sortDirection: Accessor<'asc' | 'desc'>;
storageGrowthBySeriesId?: Accessor<ReadonlyMap<string, StorageCapacityDeltaPresentation>>;
+ alertWeightByRecordId?: (recordId: string) => number;
groupBy: Accessor<StorageGroupKey>;
};
@@ -61,6 +62,7 @@ export const useStorageModel = (options: UseStorageModelOptions) => {
sortStorageRecords(filteredRecords(), options.sortKey(), options.sortDirection(), {
growthBySeriesId:
options.sortKey() === 'growth' ? options.storageGrowthBySeriesId?.() : undefined,
+ alertWeightByRecordId: options.alertWeightByRecordId,
}),
);
diff --git a/frontend-modern/src/components/Storage/useStoragePageData.ts b/frontend-modern/src/components/Storage/useStoragePageData.ts
index 85725c564b..4d65accc01 100644
--- a/frontend-modern/src/components/Storage/useStoragePageData.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageData.ts
@@ -10,6 +10,8 @@ import {
import type { State } from '@/types/api';
import type { Resource } from '@/types/resource';
import { useStorageAlertState } from './useStorageAlertState';
+import { consolidateCephClusterPoolRecords } from '@/features/storageBackups/cephRecordPresentation';
+import { storageAlertSeverityWeight } from '@/features/storageBackups/storageAlertState';
import { useStorageCephModel } from './useStorageCephModel';
import {
buildStorageNodeOnlineByLabel,
@@ -42,8 +44,11 @@ export const useStoragePageData = (options: UseStoragePageDataOptions) => {
buildStorageRecords({ state: options.state(), resources: options.resources() }),
);
+ // Alert state follows the rows the table shows, so a Ceph pool folded into
+ // its mounting storage still explains and ranks that row.
+ const alertRecords = createMemo(() => consolidateCephClusterPoolRecords(records()));
const { getRecordAlertState } = useStorageAlertState({
- records,
+ records: alertRecords,
activeAlerts: options.activeAlerts,
alertsEnabled: options.alertsEnabled,
});
@@ -72,6 +77,12 @@ export const useStoragePageData = (options: UseStoragePageDataOptions) => {
sortKey: options.sortKey,
sortDirection: options.sortDirection,
storageGrowthBySeriesId: options.storageGrowthBySeriesId,
+ alertWeightByRecordId: (recordId) => {
+ const alertState = getRecordAlertState(recordId);
+ return alertState.hasUnacknowledgedAlert
+ ? storageAlertSeverityWeight(alertState.severity)
+ : 0;
+ },
groupBy: options.groupBy,
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
index d39708adc7..96ce3f6715 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov0712b.test.ts
@@ -11,6 +11,7 @@ import {
getCephSummaryText,
isCephClusterPoolStorageRecord,
} from '@/features/storageBackups/cephRecordPresentation';
+import { getStorageRecordAlertResourceIds } from '@/features/storageBackups/storageAlertState';
// ---------------------------------------------------------------------------
// Fixture builders — mirror cephRecordPresentation.test.ts so casts and
@@ -234,8 +235,8 @@ describe('consolidateCephClusterPoolRecords branch coverage', () => {
expect(survivor.issueSummary).toBe('first pool wins');
});
- // ---- Branch L84: pool not sicker than mount → record unchanged by ref ----
- it('leaves a mount untouched (by reference) when the pool is not sicker than it', () => {
+ // ---- Branch L84: pool not sicker than mount → health and status unchanged ----
+ it('leaves a mount health untouched when the pool is not sicker than it', () => {
const healthyPool = makePoolRecord({
id: 'pool-1',
name: 'cephfs-data',
@@ -248,10 +249,12 @@ describe('consolidateCephClusterPoolRecords branch coverage', () => {
health: 'critical',
statusLabel: 'unavailable',
});
- // storageHealthRank('healthy')=0 <= storageHealthRank('critical')=4 → return record.
+ // storageHealthRank('healthy')=0 <= storageHealthRank('critical')=4 → keep the
+ // mount's health and status; only the folded pool's alert identity is added.
const consolidated = consolidateCephClusterPoolRecords([healthyPool, sickMount]);
- expect(consolidated).toEqual([sickMount]);
- expect(consolidated[0]).toBe(sickMount);
+ expect(consolidated).toEqual([
+ { ...sickMount, absorbedAlertResourceIds: getStorageRecordAlertResourceIds(healthyPool) },
+ ]);
});
// ---- storageHealthRank `?? 0` arm: unrecognized record health → rank 0 --
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
index e4c531f50e..4737301dcd 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.branchcov2.test.ts
@@ -7,6 +7,7 @@ import {
getCephSummaryText,
isCephClusterPoolStorageRecord,
} from '@/features/storageBackups/cephRecordPresentation';
+import { getStorageRecordAlertResourceIds } from '@/features/storageBackups/storageAlertState';
// ---------------------------------------------------------------------------
// Fixture builders — mirror cephRecordPresentation.test.ts so casts and
@@ -230,8 +231,8 @@ describe('consolidateCephClusterPoolRecords branch coverage', () => {
expect(survivor.issueSummary).toBe('first pool wins');
});
- // ---- Branch L84: pool not sicker than mount → record unchanged by ref ----
- it('leaves a mount untouched (by reference) when the pool is not sicker than it', () => {
+ // ---- Branch L84: pool not sicker than mount → health and status unchanged ----
+ it('leaves a mount health untouched when the pool is not sicker than it', () => {
const healthyPool = makePoolRecord({
id: 'pool-1',
name: 'cephfs-data',
@@ -244,10 +245,12 @@ describe('consolidateCephClusterPoolRecords branch coverage', () => {
health: 'critical',
statusLabel: 'unavailable',
});
- // storageHealthRank('healthy')=0 <= storageHealthRank('critical')=4 → return record.
+ // storageHealthRank('healthy')=0 <= storageHealthRank('critical')=4 → keep the
+ // mount's health and status; only the folded pool's alert identity is added.
const consolidated = consolidateCephClusterPoolRecords([healthyPool, sickMount]);
- expect(consolidated).toEqual([sickMount]);
- expect(consolidated[0]).toBe(sickMount);
+ expect(consolidated).toEqual([
+ { ...sickMount, absorbedAlertResourceIds: getStorageRecordAlertResourceIds(healthyPool) },
+ ]);
});
// ---- storageHealthRank `?? 0` arm: unrecognized record health → rank 0 --
diff --git a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
index 079b679c69..31c3c746d7 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/cephRecordPresentation.test.ts
@@ -1,5 +1,11 @@
import { describe, expect, it } from 'vitest';
-import type { CephCluster } from '@/types/api';
+import type { Alert, CephCluster } from '@/types/api';
+import { getAlertsForResource } from '@/utils/alerts';
+import { getStorageRecordAlertResourceIds } from '@/features/storageBackups/storageAlertState';
+import {
+ describeStorageAlertHeadline,
+ pickStorageHeadlineAlert,
+} from '@/features/storageBackups/storageRowAlertPresentation';
import type { StorageRecord } from '@/features/storageBackups/models';
import {
collectCephClusterNodes,
@@ -143,6 +149,47 @@ describe('cephRecordPresentation', () => {
expect(survivor.issueSummary).toBe('Ceph reports pool cephfs-data degraded');
});
+ it('keeps a folded pool alert attached to the storage row that mounts it', () => {
+ const poolRecord = makeRecord({
+ id: 'pool-1',
+ name: 'vm-pool',
+ health: 'healthy',
+ refs: { platformEntityId: 'cluster-a', resourceId: 'ceph-pool-resource' },
+ details: { type: 'ceph', node: 'cluster', status: 'online' },
+ });
+ const mountRecord = makeRecord({
+ id: 'mount-1',
+ name: 'fast-rbd',
+ health: 'healthy',
+ details: { type: 'rbd', node: 'shared', pool: 'vm-pool', status: 'online' },
+ });
+
+ const [survivor] = consolidateCephClusterPoolRecords([poolRecord, mountRecord]);
+
+ // The pool row disappears even when it is healthy, so its alert identity
+ // must travel with the surviving row or a fill forecast on the pool is lost.
+ expect(survivor.id).toBe('mount-1');
+ expect(survivor.health).toBe('healthy');
+ expect(survivor.absorbedAlertResourceIds).toEqual(
+ expect.arrayContaining(['pool-1', 'ceph-pool-resource']),
+ );
+ const alert = {
+ id: 'forecast',
+ type: 'usage',
+ level: 'critical',
+ resourceId: 'ceph-pool-resource',
+ threshold: 100,
+ message: 'Storage projected to fill in about 3 days',
+ metadata: { forecastDaysToFull: 3 },
+ startTime: '2026-10-04T12:00:00Z',
+ acknowledged: false,
+ } as unknown as Alert;
+ const headlineAlert = pickStorageHeadlineAlert(
+ getAlertsForResource(getStorageRecordAlertResourceIds(survivor), { forecast: alert }, true),
+ );
+ expect(headlineAlert && describeStorageAlertHeadline(headlineAlert)).toBe('Full in ~3 days');
+ });
+
it('matches pool rows to mounts via the backing pool detail', () => {
const poolRecord = makeRecord({
id: 'pool-1',
@@ -187,6 +234,8 @@ describe('cephRecordPresentation', () => {
details: { type: 'cephfs', node: 'shared', status: 'unavailable' },
});
const consolidated = consolidateCephClusterPoolRecords([healthyPool, sickMount]);
- expect(consolidated).toEqual([sickMount]);
+ expect(consolidated).toEqual([
+ { ...sickMount, absorbedAlertResourceIds: getStorageRecordAlertResourceIds(healthyPool) },
+ ]);
});
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts
index c48d0b61e0..b65f4bbe24 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageAlertState.test.ts
@@ -49,6 +49,8 @@ describe('storageAlertState', () => {
severity: 'warning',
acknowledgedCount: 1,
hasAcknowledgedOnlyAlert: true,
+ headline: 'Over 85% usage limit',
+ headlineCompact: 'Over 85%',
},
{
...EMPTY_STORAGE_ALERT_STATE,
@@ -57,6 +59,8 @@ describe('storageAlertState', () => {
severity: 'critical',
hasUnacknowledgedAlert: true,
unacknowledgedCount: 2,
+ headline: 'Full within a day',
+ headlineCompact: 'Full <1d',
},
),
).toEqual({
@@ -67,6 +71,9 @@ describe('storageAlertState', () => {
unacknowledgedCount: 2,
acknowledgedCount: 1,
hasAcknowledgedOnlyAlert: false,
+ // The more severe side explains the row.
+ headline: 'Full within a day',
+ headlineCompact: 'Full <1d',
});
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
index f5a5f649ca..5b2bf9ef0c 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.branchcov2.test.ts
@@ -268,9 +268,10 @@ describe('sortStorageRecords branch coverage', () => {
'Alpha',
'Bravo',
]);
+ // Ties read A to Z whichever way the sorted column runs.
expect(sortStorageRecords([a, b], 'usage', 'desc').map((r) => r.name)).toEqual([
- 'Bravo',
'Alpha',
+ 'Bravo',
]);
});
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts
index 7603127cf2..1e7af4ce30 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageModelCore.test.ts
@@ -86,6 +86,29 @@ describe('storageModelCore', () => {
expect(matchesStorageRecordSearch(makeRecord(), 'missing')).toBe(false);
});
+ it('orders the default priority view as a risk list: alerts, incidents, fullest, then A to Z', () => {
+ const usage = (usagePercent: number) => ({
+ totalBytes: 100,
+ usedBytes: usagePercent,
+ freeBytes: 100 - usagePercent,
+ usagePercent,
+ });
+ const records = [
+ makeRecord({ id: 'quiet-b', name: 'bravo', capacity: usage(40) }),
+ makeRecord({ id: 'quiet-a', name: 'alpha', capacity: usage(40) }),
+ makeRecord({ id: 'full', name: 'zulu', capacity: usage(80) }),
+ makeRecord({ id: 'warning', name: 'yankee', capacity: usage(20) }),
+ makeRecord({ id: 'critical', name: 'xray', capacity: usage(10) }),
+ makeRecord({ id: 'incident', name: 'whiskey', capacity: usage(5), incidentPriority: 4 }),
+ ];
+ const alertWeights: Record<string, number> = { critical: 3, warning: 2 };
+ expect(
+ sortStorageRecords(records, 'priority', 'desc', {
+ alertWeightByRecordId: (id) => alertWeights[id] ?? 0,
+ }).map((record) => record.id),
+ ).toEqual(['critical', 'warning', 'incident', 'full', 'quiet-a', 'quiet-b']);
+ });
+
it('filters, sorts, groups, and summarizes storage records canonically', () => {
const node = makeNode();
const warning = makeRecord({
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
index f9a1e6246e..907922065d 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storageRowAlertPresentation.test.ts
@@ -1,5 +1,27 @@
import { describe, expect, it } from 'vitest';
-import { getStorageRowAlertPresentation } from '@/features/storageBackups/storageRowAlertPresentation';
+import type { Alert } from '@/types/api';
+import {
+ describeStorageAlertHeadline,
+ getStorageRowAlertPresentation,
+ pickStorageHeadlineAlert,
+} from '@/features/storageBackups/storageRowAlertPresentation';
+
+const makeAlert = (overrides: Partial<Alert> = {}): Alert =>
+ ({
+ id: 'alert-1',
+ type: 'usage',
+ level: 'warning',
+ resourceId: 'storage-1',
+ resourceName: 'tank',
+ node: 'pve1',
+ instance: 'pve1',
+ message: 'Storage at 88.9%',
+ value: 88.9,
+ threshold: 85,
+ startTime: '2026-10-04T12:00:00Z',
+ acknowledged: false,
+ ...overrides,
+ }) as Alert;
describe('storageRowAlertPresentation', () => {
it('returns unacknowledged critical row styling canonically', () => {
@@ -43,4 +65,32 @@ describe('storageRowAlertPresentation', () => {
expect(result.rowClass).toContain('shadow-[inset_4px_0_0_0_rgba(156,163,175,0.8)]');
expect(result.dataAlertState).toBe('acknowledged');
});
+
+ it('explains a highlighted row with a fill forecast, a crossed limit or the alert text', () => {
+ const forecast = (days: number) =>
+ makeAlert({ threshold: 100, metadata: { forecastDaysToFull: days } });
+ expect(describeStorageAlertHeadline(forecast(3.4))).toBe('Full in ~3 days');
+ expect(describeStorageAlertHeadline(forecast(3.4), { compact: true })).toBe('Full in ~3d');
+ expect(describeStorageAlertHeadline(forecast(1.2))).toBe('Full in ~1 day');
+ expect(describeStorageAlertHeadline(forecast(0.4))).toBe('Full within a day');
+ expect(describeStorageAlertHeadline(forecast(0.4), { compact: true })).toBe('Full <1d');
+ expect(describeStorageAlertHeadline(makeAlert())).toBe('Over 85% usage limit');
+ expect(describeStorageAlertHeadline(makeAlert(), { compact: true })).toBe('Over 85%');
+ expect(
+ describeStorageAlertHeadline(
+ makeAlert({ type: 'zfs-pool-state', threshold: 0, message: 'Pool archive is DEGRADED' }),
+ ),
+ ).toBe('Pool archive is DEGRADED');
+ });
+
+ it('explains the row with its most severe, most recent open alert', () => {
+ const olderWarning = makeAlert({ id: 'w1', startTime: '2026-10-04T10:00:00Z' });
+ const newerWarning = makeAlert({ id: 'w2', startTime: '2026-10-04T11:00:00Z' });
+ const ackedCritical = makeAlert({ id: 'c1', level: 'critical', acknowledged: true });
+ expect(pickStorageHeadlineAlert([olderWarning, ackedCritical, newerWarning])?.id).toBe('w2');
+ expect(
+ pickStorageHeadlineAlert([olderWarning, makeAlert({ id: 'c2', level: 'critical' })])?.id,
+ ).toBe('c2');
+ expect(pickStorageHeadlineAlert([ackedCritical])).toBeNull();
+ });
});
diff --git a/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts b/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
index dbd72ab2a9..286734b7cb 100644
--- a/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/cephRecordPresentation.ts
@@ -7,6 +7,7 @@ import {
getStorageRecordType,
getStorageRecordUsagePercent,
} from './recordPresentation';
+import { getStorageRecordAlertResourceIds } from './storageAlertState';
export const isCephStorageRecord = (record: StorageRecord): boolean => {
if (isCephType(getStorageRecordType(record))) return true;
@@ -57,6 +58,7 @@ export const consolidateCephClusterPoolRecords = (records: StorageRecord[]): Sto
const consumedPoolIds = new Set<string>();
const liftBySiblingId = new Map<string, StorageRecord>();
+ const absorbedAlertIdsBySiblingId = new Map<string, string[]>();
for (const pool of poolRecords) {
const sibling = records.find(
@@ -68,6 +70,10 @@ export const consolidateCephClusterPoolRecords = (records: StorageRecord[]): Sto
);
if (!sibling) continue;
consumedPoolIds.add(pool.id);
+ absorbedAlertIdsBySiblingId.set(sibling.id, [
+ ...(absorbedAlertIdsBySiblingId.get(sibling.id) ?? []),
+ ...getStorageRecordAlertResourceIds(pool),
+ ]);
const existing = liftBySiblingId.get(sibling.id);
if (!existing || storageHealthRank(pool.health) > storageHealthRank(existing.health)) {
liftBySiblingId.set(sibling.id, pool);
@@ -81,10 +87,19 @@ export const consolidateCephClusterPoolRecords = (records: StorageRecord[]): Sto
.map((record) => {
const pool = liftBySiblingId.get(record.id);
if (!pool) return record;
- if (storageHealthRank(pool.health) <= storageHealthRank(record.health)) return record;
+ const absorbed = {
+ ...record,
+ absorbedAlertResourceIds: Array.from(
+ new Set([
+ ...(record.absorbedAlertResourceIds ?? []),
+ ...(absorbedAlertIdsBySiblingId.get(record.id) ?? []),
+ ]),
+ ),
+ };
+ if (storageHealthRank(pool.health) <= storageHealthRank(record.health)) return absorbed;
const poolStatus = getRecordStatusDetail(pool) || pool.statusLabel || pool.health;
return {
- ...record,
+ ...absorbed,
health: pool.health,
statusLabel: poolStatus,
issueSummary: pool.issueSummary?.trim() || `Ceph reports pool ${pool.name} ${poolStatus}`,
diff --git a/frontend-modern/src/features/storageBackups/models.ts b/frontend-modern/src/features/storageBackups/models.ts
index b0e10982ea..ae8f5c6751 100644
--- a/frontend-modern/src/features/storageBackups/models.ts
+++ b/frontend-modern/src/features/storageBackups/models.ts
@@ -93,6 +93,10 @@ export interface StorageRecord {
observedAt: number;
freshness?: 'fresh' | 'stale' | 'unknown';
freshnessError?: string;
+ // Alert resource ids of rows folded into this one (a Ceph pool collapsed
+ // into the PVE storage that mounts it), so their alerts still explain and
+ // rank the surviving row.
+ absorbedAlertResourceIds?: string[];
metricsTarget?: StorageMetricsTarget;
refs?: {
resourceId?: string;
diff --git a/frontend-modern/src/features/storageBackups/storageAlertState.ts b/frontend-modern/src/features/storageBackups/storageAlertState.ts
index b196daf4ec..67bcacf192 100644
--- a/frontend-modern/src/features/storageBackups/storageAlertState.ts
+++ b/frontend-modern/src/features/storageBackups/storageAlertState.ts
@@ -9,6 +9,10 @@ export type StorageAlertRowState = {
unacknowledgedCount: number;
acknowledgedCount: number;
hasAcknowledgedOnlyAlert: boolean;
+ // Why the row is highlighted, from its most severe open alert, so the
+ // colour on the row always comes with a reason.
+ headline?: string | null;
+ headlineCompact?: string | null;
};
export const EMPTY_STORAGE_ALERT_STATE: StorageAlertRowState = {
@@ -19,6 +23,8 @@ export const EMPTY_STORAGE_ALERT_STATE: StorageAlertRowState = {
unacknowledgedCount: 0,
acknowledgedCount: 0,
hasAcknowledgedOnlyAlert: false,
+ headline: null,
+ headlineCompact: null,
};
export const asStorageAlertRecord = (value: unknown): Record<string, Alert> => {
@@ -37,6 +43,9 @@ export const asStorageAlertRecord = (value: unknown): Record<string, Alert> => {
return value as Record<string, Alert>;
};
+export const storageAlertSeverityWeight = (value: 'critical' | 'warning' | 'info' | null): number =>
+ severityWeight(value);
+
const severityWeight = (value: 'critical' | 'warning' | 'info' | null): number => {
if (value === 'critical') return 3;
if (value === 'warning') return 2;
@@ -60,6 +69,14 @@ export const mergeStorageAlertRowState = (
severityWeight(incoming.severity) > severityWeight(current.severity)
? incoming.severity
: current.severity,
+ headline:
+ severityWeight(incoming.severity) > severityWeight(current.severity)
+ ? (incoming.headline ?? current.headline ?? null)
+ : (current.headline ?? incoming.headline ?? null),
+ headlineCompact:
+ severityWeight(incoming.severity) > severityWeight(current.severity)
+ ? (incoming.headlineCompact ?? current.headlineCompact ?? null)
+ : (current.headlineCompact ?? incoming.headlineCompact ?? null),
hasUnacknowledgedAlert: mergedHasUnacknowledged,
unacknowledgedCount: current.unacknowledgedCount + incoming.unacknowledgedCount,
acknowledgedCount: current.acknowledgedCount + incoming.acknowledgedCount,
@@ -80,7 +97,7 @@ export const getStorageRecordAlertResourceIds = (record: StorageRecord): string[
return Array.from(
new Set(
- [record.id, refs.resourceId, derivedLegacyId]
+ [record.id, refs.resourceId, derivedLegacyId, ...(record.absorbedAlertResourceIds ?? [])]
.filter((value): value is string => typeof value === 'string')
.map((value) => value.trim())
.filter((value) => value.length > 0),
diff --git a/frontend-modern/src/features/storageBackups/storageModelCore.ts b/frontend-modern/src/features/storageBackups/storageModelCore.ts
index e5baeec6cd..f4beca802e 100644
--- a/frontend-modern/src/features/storageBackups/storageModelCore.ts
+++ b/frontend-modern/src/features/storageBackups/storageModelCore.ts
@@ -32,6 +32,9 @@ export type StorageGroupKey = 'node' | 'type' | 'status' | 'none';
export type StorageSortContext = {
growthBySeriesId?: ReadonlyMap<string, StorageCapacityDeltaPresentation>;
+ // Weight of the record's most severe open alert (0 when none), so the
+ // default priority order puts storage that needs attention first.
+ alertWeightByRecordId?: (recordId: string) => number;
};
export type StorageNodeOption = {
@@ -186,7 +189,14 @@ export const sortStorageRecords = (
if (left !== null && right === null) return -1;
comparison = left === null || right === null ? 0 : numericCompare(left, right);
} else if (sortKey === 'priority') {
- comparison = numericCompare(a.incidentPriority || 0, b.incidentPriority || 0);
+ // Open alerts first, then the record's own incident priority, then the
+ // fullest storage, so the default view reads as a risk list rather than
+ // reverse alphabetical order when nothing is in an incident.
+ const alertWeight = context.alertWeightByRecordId;
+ comparison =
+ numericCompare(alertWeight?.(a.id) ?? 0, alertWeight?.(b.id) ?? 0) ||
+ numericCompare(a.incidentPriority || 0, b.incidentPriority || 0) ||
+ numericCompare(getStorageRecordUsagePercent(a), getStorageRecordUsagePercent(b));
} else if (sortKey === 'state') {
comparison = textCompare(getStoragePoolStateLabel(a), getStoragePoolStateLabel(b));
} else if (sortKey === 'source') {
@@ -204,11 +214,11 @@ export const sortStorageRecords = (
comparison = textCompare(a.name, b.name);
}
- if (comparison === 0) {
- comparison = textCompare(a.name, b.name);
+ if (comparison !== 0) {
+ return sortDirection === 'asc' ? comparison : -comparison;
}
-
- return sortDirection === 'asc' ? comparison : -comparison;
+ // Ties always read A to Z, whichever way the sorted column runs.
+ return textCompare(a.name, b.name);
});
};
diff --git a/frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts b/frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts
index 00e386485b..bdb47282d4 100644
--- a/frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePoolsTablePresentation.ts
@@ -13,6 +13,11 @@ export type StoragePoolsTableRowModel = {
expanded: boolean;
parentNodeOnline: boolean;
rowClass: string;
+ // Reason the row is highlighted; shown in the State cell so the colour is
+ // never unexplained. Null when the row carries no open alert.
+ alertHeadline: string | null;
+ alertHeadlineCompact: string | null;
+ alertHeadlineClass: string;
alertDataAttrs: {
'data-row-id': string;
'data-alert-state': string;
@@ -45,8 +50,9 @@ export const buildStoragePoolsTableRowModel = (
const nodeLabel = getStorageRecordNodeLabel(record).trim().toLowerCase();
const nodeStatus = nodeLabel ? options.nodeOnlineByLabel.get(nodeLabel) : undefined;
const parentNodeOnline = nodeStatus === undefined ? true : nodeStatus;
+ const alertState = options.getRecordAlertState(record.id);
const rowAlertPresentation = getStorageRowAlertPresentation({
- alertState: options.getRecordAlertState(record.id),
+ alertState,
parentNodeOnline,
isExpanded: expanded,
isResourceHighlighted: options.highlightedRecordId === record.id,
@@ -56,6 +62,18 @@ export const buildStoragePoolsTableRowModel = (
expanded,
parentNodeOnline,
rowClass: rowAlertPresentation.rowClass,
+ alertHeadline:
+ rowAlertPresentation.dataAlertState === 'unacknowledged'
+ ? (alertState.headline ?? null)
+ : null,
+ alertHeadlineCompact:
+ rowAlertPresentation.dataAlertState === 'unacknowledged'
+ ? (alertState.headlineCompact ?? alertState.headline ?? null)
+ : null,
+ alertHeadlineClass:
+ alertState.severity === 'critical'
+ ? 'text-red-700 dark:text-red-300 font-medium'
+ : 'text-amber-700 dark:text-amber-300 font-medium',
alertDataAttrs: {
'data-row-id': record.id,
'data-alert-state': rowAlertPresentation.dataAlertState,
diff --git a/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts b/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
index 0fbbf91e97..57c6e34cff 100644
--- a/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storageRowAlertPresentation.ts
@@ -1,3 +1,4 @@
+import type { Alert } from '@/types/api';
import type { StorageAlertRowState } from './storageAlertState';
export interface StorageRowAlertPresentation {
@@ -56,3 +57,44 @@ export const getStorageRowAlertPresentation = (options: {
dataResourceHighlighted: options.isResourceHighlighted ? 'true' : 'false',
};
};
+
+const forecastDaysToFull = (alert: Alert): number | null => {
+ const value = alert.metadata?.forecastDaysToFull;
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
+};
+
+// One short reason for a highlighted storage row. A fill forecast says when
+// the pool runs out; a usage threshold says which limit was crossed (the bar
+// already shows the percentage); anything else falls back to the alert text.
+// The compact form fits the phone layout's narrow State column.
+export const describeStorageAlertHeadline = (
+ alert: Alert,
+ options: { compact?: boolean } = {},
+): string => {
+ const days = forecastDaysToFull(alert);
+ if (days !== null) {
+ if (days < 1) return options.compact ? 'Full <1d' : 'Full within a day';
+ const rounded = Math.max(1, Math.round(days));
+ if (options.compact) return `Full in ~${rounded}d`;
+ return `Full in ~${rounded} ${rounded === 1 ? 'day' : 'days'}`;
+ }
+ if (alert.type === 'usage' && alert.threshold > 0 && alert.threshold < 100) {
+ return options.compact ? `Over ${alert.threshold}%` : `Over ${alert.threshold}% usage limit`;
+ }
+ return alert.message?.trim() || 'Active alert';
+};
+
+const alertSeverityRank = (level: string | undefined): number =>
+ level === 'critical' ? 3 : level === 'warning' ? 2 : level === 'info' ? 1 : 0;
+
+// The open alert that explains the row: most severe first, then the one
+// that started most recently so a fresh forecast outranks an old notice.
+export const pickStorageHeadlineAlert = (alerts: Alert[]): Alert | null => {
+ const open = alerts.filter((alert) => !alert.acknowledged);
+ if (open.length === 0) return null;
+ return [...open].sort((a, b) => {
+ const severity = alertSeverityRank(b.level) - alertSeverityRank(a.level);
+ if (severity !== 0) return severity;
+ return Date.parse(b.startTime) - Date.parse(a.startTime);
+ })[0];
+};