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.

Show retained disk temperatures as last known, not live

rcourtmanbbd44455c85b
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 0257eb60aa..f169522281 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -7758,6 +7758,15 @@ candidates. Domain ownership stays with Patrol intelligence, storage recovery,
alerts, and unified resources; the primitive layer owns consistent rendering,
accessibility, and handoff behavior only.
+The same storage presenters own the last-known disk temperature treatment. A
+temperature whose collection state is not `available` renders through
+`PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS` (muted, dotted underline, help
+cursor) with its reason as the title and screen-reader "last known" text,
+never through the threshold colour classes, so a retained reading cannot look
+hot or healthy. Table, drawer and pool surfaces share that one decision in
+`frontend-modern/src/features/storageBackups/diskPresentation.ts` rather than
+each re-reading `collection.temperature`.
+
The focused browser proofs are
`frontend-modern/src/features/patrol/__tests__/patrolRunAcceptance.test.ts`,
`frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx`,
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 626b08f763..5862022a37 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -3784,6 +3784,23 @@ remain explicit. In particular, members behind a shared controller must not
inherit aggregate I/O counters, and a disk drawer must hide live-I/O charts
when per-member collection is unavailable or unsupported.
+A retained disk temperature reads as last known, never as a live reading. The
+Physical Disks table, the disk drawer and the pool drawer's linked-disk list
+decide through `isPhysicalDiskTemperatureCurrent` and
+`getPhysicalDiskTemperaturePresentation` in
+`frontend-modern/src/features/storageBackups/diskPresentation.ts`: only an
+`available` temperature state, or a source that predates collection state, is
+current and takes the per-disk-type threshold colour. Any other state, such as
+a disk in standby or a host agent past its reporting lease, renders the value
+muted with no hot or warm colour, a dotted underline, a title carrying the
+collection reason and screen-reader "last known" text; the drawer card is
+labelled "Last known temperature" beneath the existing collection message.
+This is presentation only. It does not change the stored value, history writes
+or alert evaluation. Verification: `diskPresentation.test.ts`,
+`diskDetailPresentation.test.ts`, `storagePoolDetailPresentation.test.ts`,
+`DiskList.test.tsx` (a row moving between current, retained and legacy states)
+and `DiskDetail.test.tsx`.
+
Direct SATA, SAS, and NVMe device fallback identities remain compatible.
Controller-member fallback identities add controller/target scope only where
needed to keep multiple members distinct; serial and WWN continue to take
diff --git a/frontend-modern/browser-verification/d0dfa366febe8d30.json b/frontend-modern/browser-verification/d0dfa366febe8d30.json
new file mode 100644
index 0000000000..f7f5062854
--- /dev/null
+++ b/frontend-modern/browser-verification/d0dfa366febe8d30.json
@@ -0,0 +1,50 @@
+{
+ "version": 1,
+ "base_sha": "f4191494584f05c731f5c7a9aaa15c3b777a3f13",
+ "verified_at": "2026-10-06T16:39:54Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Storage/DiskDetail.tsx",
+ "frontend-modern/src/components/Storage/DiskList.tsx",
+ "frontend-modern/src/components/Storage/StoragePoolDetail.tsx",
+ "frontend-modern/src/features/storageBackups/diskDetailPresentation.ts",
+ "frontend-modern/src/features/storageBackups/diskPresentation.ts",
+ "frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Storage/DiskDetail.tsx": "85a1bb30e4914c98b65b820e649322de9bf5412f913d85a7638d3f8400e987e2",
+ "frontend-modern/src/components/Storage/DiskList.tsx": "6e4d7ce022fe2b1262581cf8482e1ad11bb287de7a3c255d639a6eeac5c5cc31",
+ "frontend-modern/src/components/Storage/StoragePoolDetail.tsx": "020f64a6044f17619f30e3dd79e49fb863dcc9775de6a65a47f97b8fcca02819",
+ "frontend-modern/src/features/storageBackups/diskDetailPresentation.ts": "7d01c07370a710227a39423670a5f1611bbfa64ba5488aa9a845fbdf2fe5176d",
+ "frontend-modern/src/features/storageBackups/diskPresentation.ts": "9ae039f89878e5274cbe6fdff436d3175a8656d717ffb51e72e5bb96d8f62d7c",
+ "frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts": "f52b9a2ada8e10bc84fb29ac9bc389a0d255fa794d99ff4c237e604e4cd30130"
+ },
+ "routes": [
+ "/proxmox/storage?tab=disks&q=West%20Production",
+ "/proxmox/storage?q=analytics-c-service-pool"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "Private mock stack (50 nodes) whose generator was overlaid locally, never committed, to stamp real collector states on disk temperatures: a SATA disk on pve1 retaining 36C with unavailable 'disk is in standby', an NVMe disk on pve2 retaining 72C with unavailable 'host agent stopped reporting', a SATA disk on pve3 reading 72C live (available, host_agent), an NVMe disk on pve3 retaining 41C as missing with no reason, every other Proxmox disk available, TrueNAS disks with no collection state",
+ "Same-session control with origin/main's files swapped in under Vite: the pve2 silent-agent disk showed a red 72C identical to the live hot pve3 disk, the standby disk a green 36C, and its drawer printed 'Temperature is temporarily unavailable: host agent stopped reporting' directly above a red Temperature 72C card; the pool list showed the retained 71C in red",
+ "Physical Disks table after the change, light 1440 and dark 390: the three retained readings render muted (rgb(71,85,105) light, rgb(148,163,184) dark) with a dotted underline, titles 'Last known reading, not current: host agent stopped reporting', '... disk is in standby' and 'Last known reading, not current', and screen-reader text ', last known'; the live 72C stays red, 51C amber, the rest green; no clipping in the 41px phone Temp column",
+ "Disk drawer: silent-agent and standby disks show the existing collection message above a 'Last known temperature' card with a muted value; the live hot disk keeps 'Temperature 72C' in red with no message",
+ "Pool drawer for analytics-c-service-pool (pve33, ZFS devices sda2 and sdb2 linked to overlay disks): the retained 71C reads muted, dotted, with the reason title; the live 73C beside it stays red",
+ "Re-run on the rebased tree (origin/main f419149458, none of the changed files differ from the verified copies): identical results, no page errors at either width"
+ ],
+ "interactions": [
+ "Loaded the Physical Disks tab filtered to West Production and read every Temp cell's text, computed colour, decoration, title and overflow",
+ "Opened and closed the inline disk drawer for the silent-agent, standby and live hot disks at both viewports and read the collection message and temperature card",
+ "Opened the analytics-c-service-pool row on the Pools tab and read the linked-disk temperatures in its Physical Disks card",
+ "Swapped origin/main's versions of the six runtime files in under the running Vite and repeated the same reads, then restored the change and confirmed the diff byte-identical"
+ ]
+}
diff --git a/frontend-modern/src/components/Storage/DiskDetail.tsx b/frontend-modern/src/components/Storage/DiskDetail.tsx
index 3588836cc0..b90f772797 100644
--- a/frontend-modern/src/components/Storage/DiskDetail.tsx
+++ b/frontend-modern/src/components/Storage/DiskDetail.tsx
@@ -17,7 +17,7 @@ import {
DISK_DETAIL_HEALTH_SUMMARY_CLASS,
DISK_DETAIL_HISTORY_RANGE_OPTIONS,
DISK_DETAIL_LIVE_CHARTS,
- getDiskAttributeValueTextClass,
+ getDiskAttributeCardValueTextClass,
getDiskDetailHistoryFallbackMessage,
getDiskDetailLiveBadgeLabel,
} from '@/features/storageBackups/diskDetailPresentation';
@@ -166,7 +166,7 @@ export const DiskDetail: Component<DiskDetailProps> = (props) => {
<StorageDetailMetricCard
label={card.label}
value={card.value}
- valueClass={getDiskAttributeValueTextClass(card.ok)}
+ valueClass={getDiskAttributeCardValueTextClass(card)}
/>
)}
</For>
diff --git a/frontend-modern/src/components/Storage/DiskList.tsx b/frontend-modern/src/components/Storage/DiskList.tsx
index fdff3b3d36..4d463bb5c2 100644
--- a/frontend-modern/src/components/Storage/DiskList.tsx
+++ b/frontend-modern/src/components/Storage/DiskList.tsx
@@ -15,7 +15,7 @@ import {
} from '@/components/shared/Table';
import { useAlertsActivation } from '@/stores/alertsActivation';
import { formatBytes } from '@/utils/format';
-import { formatTemperature, getTemperatureTextClass } from '@/utils/temperature';
+import { getTemperatureTextClass } from '@/utils/temperature';
import {
PHYSICAL_DISK_CELL_DEVICE_CLASS,
PHYSICAL_DISK_CELL_DISK_CLASS,
@@ -63,6 +63,7 @@ import {
PHYSICAL_DISK_NAME_WRAP_CLASS,
PHYSICAL_DISK_SIZE_VALUE_CLASS,
PHYSICAL_DISK_TEMPERATURE_CLASS,
+ PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS,
PHYSICAL_DISK_VALUE_TEXT_CLASS,
PHYSICAL_DISK_TABLE_BODY_CLASS,
PHYSICAL_DISK_TABLE_CLASS,
@@ -83,6 +84,7 @@ import {
getPhysicalDiskParentLabel,
getPhysicalDiskRoleLabel,
getPhysicalDiskTableLayoutModeForContainer,
+ getPhysicalDiskTemperaturePresentation,
isPhysicalDiskColumnVisible,
type PhysicalDiskTableColumnId,
} from '@/features/storageBackups/diskPresentation';
@@ -335,6 +337,9 @@ export const DiskList: Component<DiskListProps> = (props) => {
const status = createMemo(() => getPhysicalDiskHealthStatus(data()));
const hostLabel = createMemo(() => getPhysicalDiskHostLabel(data(), disk));
const healthSummary = createMemo(() => getPhysicalDiskHealthSummary(status()));
+ const temperature = createMemo(() =>
+ getPhysicalDiskTemperaturePresentation(data()),
+ );
const healthCompactLabel = createMemo(() =>
getPhysicalDiskHealthCompactLabel(status().label),
);
@@ -509,18 +514,31 @@ export const DiskList: Component<DiskListProps> = (props) => {
data-storage-column="temp"
>
<Show
- when={data().temperature > 0}
+ when={temperature()}
fallback={<span class={PHYSICAL_DISK_MUTED_PLACEHOLDER_CLASS}>—</span>}
>
- <span
- class={`${PHYSICAL_DISK_TEMPERATURE_CLASS} ${getTemperatureTextClass(
- data().temperature,
- getDiskTemperatureThresholds(data().type),
- 'diskTemperature',
- )}`}
- >
- {formatTemperature(data().temperature)}
- </span>
+ {(reading) => (
+ <span
+ class={`${PHYSICAL_DISK_TEMPERATURE_CLASS} ${
+ reading().current
+ ? getTemperatureTextClass(
+ data().temperature,
+ getDiskTemperatureThresholds(data().type),
+ 'diskTemperature',
+ )
+ : PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS
+ }`}
+ title={reading().title}
+ data-temperature-reading={
+ reading().current ? 'current' : 'last-known'
+ }
+ >
+ {reading().label}
+ <Show when={!reading().current}>
+ <span class="sr-only">, last known</span>
+ </Show>
+ </span>
+ )}
</Show>
</TableCell>
diff --git a/frontend-modern/src/components/Storage/StoragePoolDetail.tsx b/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
index c2e7383750..c1b9521523 100644
--- a/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolDetail.tsx
@@ -14,6 +14,7 @@ import {
getLinkedDiskHealthDotVariant,
getLinkedDiskTemperatureTextClass,
} from '@/features/storageBackups/diskDetailPresentation';
+import { PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS } from '@/features/storageBackups/diskPresentation';
import { useAlertsActivation } from '@/stores/alertsActivation';
import {
STORAGE_POOL_DETAIL_HISTORY_RANGE_OPTIONS,
@@ -39,6 +40,7 @@ import {
} from '@/features/storageBackups/detailPresentation';
import type { StorageRecord } from '@/features/storageBackups/models';
import type { Resource } from '@/types/resource';
+import { formatTemperature } from '@/utils/temperature';
import { StorageDetailKeyValueRow } from './StorageDetailKeyValueRow';
import { useStoragePoolDetailModel } from './useStoragePoolDetailModel';
@@ -279,12 +281,20 @@ export const StoragePoolDetail: Component<StoragePoolDetailProps> = (props) => {
</Show>
<Show when={disk.temperature > 0}>
<span
- class={`font-medium ${getLinkedDiskTemperatureTextClass(
- disk.temperature,
- getDiskTemperatureThresholds(disk.diskType),
- )}`}
+ class={`font-medium ${
+ disk.temperatureLastKnownTitle
+ ? PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS
+ : getLinkedDiskTemperatureTextClass(
+ disk.temperature,
+ getDiskTemperatureThresholds(disk.diskType),
+ )
+ }`}
+ title={disk.temperatureLastKnownTitle}
>
- {disk.temperature}°C
+ {formatTemperature(disk.temperature)}
+ <Show when={disk.temperatureLastKnownTitle}>
+ <span class="sr-only">, last known</span>
+ </Show>
</span>
</Show>
</div>
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
index e1630ffa95..6d921d6624 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskDetail.test.tsx
@@ -99,6 +99,10 @@ describe('DiskDetail', () => {
expect(
screen.getByText('Temperature is temporarily unavailable: collection deadline exceeded'),
).toBeInTheDocument();
+ // The retained value sits under its own label with no health tone.
+ expect(screen.queryByText('Temperature')).not.toBeInTheDocument();
+ expect(screen.getByText('Last known temperature')).toBeInTheDocument();
+ expect(screen.getByText('42°C')).toHaveClass('text-muted');
expect(
screen.getByText('Disk I/O is unsupported: per-member counters unavailable'),
).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
index ae75eb0693..73b9cd330d 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
@@ -84,6 +84,59 @@ describe('DiskList', () => {
cleanup();
});
+ it('shows a retained temperature as last known, not as a live threshold reading', async () => {
+ const withTemperature = (collection: NonNullable<Resource['physicalDisk']>['collection']) =>
+ buildDisk('sda', 'tower', { diskType: 'sata', temperature: 72, collection });
+ const [disks, setDisks] = createSignal([
+ withTemperature({ temperature: { state: 'available', source: 'host_agent' } }),
+ ]);
+ const view = render(() => (
+ <DiskList
+ disks={disks()}
+ nodes={[]}
+ selectedNode={null}
+ searchTerm=""
+ selectedDiskId={null}
+ onSelectedDiskChange={() => {}}
+ />
+ ));
+ const reading = () =>
+ view.container.querySelector<HTMLElement>(
+ '[data-row-id="sda"] td[data-storage-column="temp"] [data-temperature-reading]',
+ )!;
+
+ expect(reading()).toHaveAttribute('data-temperature-reading', 'current');
+ expect(reading()).toHaveClass('text-red-600');
+ expect(reading()).not.toHaveAttribute('title');
+ expect(reading()).toHaveTextContent(/^72°C$/);
+
+ // The same row, retained after its host agent stopped reporting.
+ setDisks([
+ withTemperature({
+ temperature: {
+ state: 'unavailable',
+ source: 'host_agent',
+ reason: 'host agent stopped reporting',
+ },
+ }),
+ ]);
+ await waitFor(() =>
+ expect(reading()).toHaveAttribute('data-temperature-reading', 'last-known'),
+ );
+ expect(reading()).toHaveClass('text-muted');
+ expect(reading().className).not.toMatch(/text-(red|amber|green)-/);
+ expect(reading()).toHaveAttribute(
+ 'title',
+ 'Last known reading, not current: host agent stopped reporting',
+ );
+ expect(reading()).toHaveTextContent('72°C, last known');
+
+ // A source that predates collection state still reads as current.
+ setDisks([withTemperature(undefined)]);
+ await waitFor(() => expect(reading()).toHaveAttribute('data-temperature-reading', 'current'));
+ expect(reading()).toHaveClass('text-red-600');
+ });
+
it('refreshes keyed disk rows without losing the expanded detail or keyboard focus', async () => {
const initial = buildDisk('sda', 'tower', { diskType: 'ssd', wearout: 96 });
const [disks, setDisks] = createSignal([initial]);
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
index 89a8caacb3..392e467d21 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskDetailPresentation.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import {
DISK_DETAIL_HISTORY_RANGE_OPTIONS,
DISK_DETAIL_LIVE_CHARTS,
+ getDiskAttributeCardValueTextClass,
getDiskAttributeValueTextClass,
getDiskDetailAttributeCards,
getDiskDetailHealthPresentation,
@@ -18,6 +19,49 @@ describe('diskDetailPresentation', () => {
expect(getDiskAttributeValueTextClass(false)).toBe('text-red-600 dark:text-red-400');
});
+ it('labels a retained temperature as last known without a health tone', () => {
+ const disk = {
+ node: 'tower',
+ instance: 'cluster-main',
+ devPath: '/dev/sda',
+ model: 'Archive HDD',
+ serial: 'SERIAL-1',
+ wwn: '',
+ size: 1,
+ health: 'PASSED',
+ wearout: -1,
+ type: 'sata',
+ temperature: 72,
+ rpm: 7200,
+ used: '',
+ riskReasons: [] as string[],
+ };
+ const live = getDiskDetailAttributeCards(
+ { ...disk, collection: { temperature: { state: 'available', source: 'host_agent' } } },
+ { warning: 50, critical: 55 },
+ );
+ expect(live).toEqual([{ label: 'Temperature', value: '72°C', ok: false }]);
+ expect(getDiskAttributeCardValueTextClass(live[0])).toBe('text-red-600 dark:text-red-400');
+
+ const retained = getDiskDetailAttributeCards(
+ {
+ ...disk,
+ collection: {
+ temperature: {
+ state: 'unavailable',
+ source: 'smartctl',
+ reason: 'disk is in standby',
+ },
+ },
+ },
+ { warning: 50, critical: 55 },
+ );
+ expect(retained).toEqual([
+ { label: 'Last known temperature', value: '72°C', ok: true, lastKnown: true },
+ ]);
+ expect(getDiskAttributeCardValueTextClass(retained[0])).toBe('text-muted');
+ });
+
it('returns canonical linked-disk state presentation', () => {
expect(getLinkedDiskHealthDotVariant(true)).toBe('warning');
expect(getLinkedDiskHealthDotVariant(false)).toBe('success');
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
index 935bcce339..a18d7ccdfe 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
@@ -37,10 +37,12 @@ import {
getPhysicalDiskSourceKey,
getPhysicalDiskSourceBadgePresentation,
getPhysicalDiskTableLayoutModeForContainer,
+ getPhysicalDiskTemperaturePresentation,
hasUnraidPhysicalDiskFaultSignal,
hasPhysicalDiskSmartWarning,
isPhysicalDiskWearoutReported,
isPhysicalDiskColumnVisible,
+ isPhysicalDiskTemperatureCurrent,
isUnraidPhysicalDisk,
matchesPhysicalDiskSearch,
normalizePhysicalDiskFacetFilter,
@@ -70,6 +72,65 @@ function makeDiskData(
}
describe('diskPresentation', () => {
+ it('reads a disk temperature as current only when its collection state says so', () => {
+ // Sources that predate collection state, and empty states, stay current.
+ expect(isPhysicalDiskTemperatureCurrent(undefined)).toBe(true);
+ expect(isPhysicalDiskTemperatureCurrent({})).toBe(true);
+ expect(isPhysicalDiskTemperatureCurrent({ temperature: { state: '' as never } })).toBe(true);
+ expect(
+ isPhysicalDiskTemperatureCurrent({ temperature: { state: 'available', source: 'smartctl' } }),
+ ).toBe(true);
+ for (const state of ['unavailable', 'unsupported', 'missing'] as const) {
+ expect(isPhysicalDiskTemperatureCurrent({ temperature: { state } })).toBe(false);
+ }
+
+ expect(
+ getPhysicalDiskTemperaturePresentation(
+ makeDiskData({
+ temperature: 72,
+ collection: { temperature: { state: 'available', source: 'host_agent' } },
+ }),
+ ),
+ ).toEqual({ label: '72°C', current: true, title: undefined });
+ expect(
+ getPhysicalDiskTemperaturePresentation(
+ makeDiskData({
+ temperature: 72,
+ collection: {
+ temperature: {
+ state: 'unavailable',
+ source: 'host_agent',
+ reason: 'host agent stopped reporting',
+ },
+ },
+ }),
+ ),
+ ).toEqual({
+ label: '72°C',
+ current: false,
+ title: 'Last known reading, not current: host agent stopped reporting',
+ });
+ expect(
+ getPhysicalDiskTemperaturePresentation(
+ makeDiskData({
+ temperature: 41,
+ collection: { temperature: { state: 'missing', source: 'smartctl', reason: ' ' } },
+ }),
+ ),
+ ).toEqual({ label: '41°C', current: false, title: 'Last known reading, not current' });
+ // No reading at all is not a last-known reading either.
+ for (const temperature of [0, -1, NaN]) {
+ expect(
+ getPhysicalDiskTemperaturePresentation(
+ makeDiskData({
+ temperature,
+ collection: { temperature: { state: 'unavailable', reason: 'disk is in standby' } },
+ }),
+ ),
+ ).toBeNull();
+ }
+ });
+
it('distinguishes unsupported, unavailable, and unexpectedly missing disk evidence', () => {
expect(
getPhysicalDiskFieldStatusMessage('Disk I/O', {
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.test.ts
index dc34f25a70..42a4b15b04 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePoolDetailPresentation.test.ts
@@ -299,6 +299,13 @@ describe('storagePoolDetailPresentation', () => {
sizeBytes: 6_000,
temperature: 32,
spunDown: true,
+ collection: {
+ temperature: {
+ state: 'unavailable',
+ source: 'unraid',
+ reason: 'disk is reported spun down',
+ },
+ },
readCount: 10,
writeCount: 20,
errorCount: 16,
@@ -309,10 +316,13 @@ describe('storagePoolDetailPresentation', () => {
const linkedDisks = getStoragePoolLinkedDisks(record, disks);
expect(linkedDisks.map((disk) => disk.role)).toEqual(['parity', 'data']);
+ expect(linkedDisks[0].temperatureLastKnownTitle).toBeUndefined();
expect(linkedDisks[1]).toEqual(
expect.objectContaining({
devPath: '/dev/sdc',
sizeLabel: '5.86 KB',
+ temperature: 32,
+ temperatureLastKnownTitle: 'Last known reading, not current: disk is reported spun down',
spunDown: true,
errorCount: 16,
ioLabel: 'R 10 / W 20',
diff --git a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
index 810daab8d7..75f66c2cce 100644
--- a/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskDetailPresentation.ts
@@ -1,18 +1,22 @@
import {
getPhysicalDiskHealthStatus,
getPhysicalDiskHealthSummary,
+ getPhysicalDiskTemperaturePresentation,
type PhysicalDiskPresentationData,
} from '@/features/storageBackups/diskPresentation';
import type { HistoryTimeRange } from '@/api/charts';
import { formatPowerOnHours } from '@/utils/format';
import { getMetricSeverity, type MetricDisplayThresholds } from '@/utils/metricThresholds';
-import { formatTemperature } from '@/utils/temperature';
import type { StatusIndicatorVariant } from '@/utils/status';
export function getDiskAttributeValueTextClass(ok: boolean): string {
return ok ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400';
}
+export function getDiskAttributeCardValueTextClass(card: DiskDetailAttributeCard): string {
+ return card.lastKnown ? 'text-muted' : getDiskAttributeValueTextClass(card.ok);
+}
+
export function getLinkedDiskHealthDotVariant(hasIssue: boolean): StatusIndicatorVariant {
return hasIssue ? 'warning' : 'success';
}
@@ -38,6 +42,8 @@ export type DiskDetailAttributeCard = {
label: string;
value: string;
ok: boolean;
+ /** A retained value that is not a current reading. */
+ lastKnown?: boolean;
};
export type DiskDetailChartOption = {
@@ -126,12 +132,22 @@ export function getDiskDetailAttributeCards(
});
}
- if (Number.isFinite(disk.temperature) && disk.temperature > 0) {
+ const temperature = getPhysicalDiskTemperaturePresentation(disk);
+ if (temperature?.current) {
cards.push({
label: 'Temperature',
- value: formatTemperature(disk.temperature),
+ value: temperature.label,
ok: getMetricSeverity(disk.temperature, 'diskTemperature', diskTempThresholds) !== 'critical',
});
+ } else if (temperature) {
+ // A retained reading is neither healthy nor hot now. The collection
+ // message above the cards says why it is not current.
+ cards.push({
+ label: 'Last known temperature',
+ value: temperature.label,
+ ok: true,
+ lastKnown: true,
+ });
}
if (attrs.powerCycles != null) {
diff --git a/frontend-modern/src/features/storageBackups/diskPresentation.ts b/frontend-modern/src/features/storageBackups/diskPresentation.ts
index a7e24152c2..2499be5969 100644
--- a/frontend-modern/src/features/storageBackups/diskPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskPresentation.ts
@@ -14,6 +14,7 @@ import { getAllFilterOptionLabel } from '@/components/shared/filterOptionPresent
import { getPhysicalDiskNodeIdentity } from '@/components/Storage/diskResourceUtils';
import { getInfrastructureSettingsLocationLabel } from '@/utils/infrastructureSettingsPresentation';
import { normalizeStorageSourceKey, storageSourceMatchesFilter } from '@/utils/storageSources';
+import { formatTemperature } from '@/utils/temperature';
import type { NormalizedHealth, StorageHealthFilter } from './models';
import { matchesStorageNodeTerms, parseStorageSearchQuery } from './storageSearchQuery';
@@ -253,6 +254,11 @@ export const PHYSICAL_DISK_HEALTH_WRAP_CLASS =
// that would compete with it for the track.
export const PHYSICAL_DISK_HEALTH_LABEL_CLASS = 'shrink-0 text-[11px] font-semibold';
export const PHYSICAL_DISK_TEMPERATURE_CLASS = 'text-[11px] font-medium';
+// A retained reading takes no threshold colour, so it cannot read as a disk
+// running hot or cool right now. The dotted underline marks the value as one
+// its title explains.
+export const PHYSICAL_DISK_TEMPERATURE_LAST_KNOWN_CLASS =
+ 'text-muted underline decoration-dotted underline-offset-2 cursor-help';
export const PHYSICAL_DISK_SIZE_VALUE_CLASS = 'text-[11px] text-base-content';
const titleize = (value: string | undefined | null): string =>
@@ -467,6 +473,45 @@ export function getPhysicalDiskFieldStatusMessage(
}
}
+// Normalization may keep the last known temperature when the current
+// observation is not available, such as a disk in standby or a host agent that
+// stopped reporting. The value is a current reading only when its collection
+// state is available, or when the source predates collection state.
+export function isPhysicalDiskTemperatureCurrent(
+ collection: PhysicalDiskCollectionStatus | null | undefined,
+): boolean {
+ const state = collection?.temperature?.state;
+ return !state || state === 'available';
+}
+
+export function getPhysicalDiskLastKnownTemperatureTitle(
+ status: PhysicalDiskFieldStatus | null | undefined,
+): string {
+ const reason = status?.reason?.trim();
+ return reason ? `Last known reading, not current: ${reason}` : 'Last known reading, not current';
+}
+
+export interface PhysicalDiskTemperaturePresentation {
+ label: string;
+ current: boolean;
+ /** Set only for a last-known reading: why the value is not current. */
+ title?: string;
+}
+
+export function getPhysicalDiskTemperaturePresentation(
+ disk: Pick<PhysicalDiskPresentationData, 'temperature' | 'collection'>,
+): PhysicalDiskTemperaturePresentation | null {
+ if (!Number.isFinite(disk.temperature) || disk.temperature <= 0) return null;
+ const current = isPhysicalDiskTemperatureCurrent(disk.collection);
+ return {
+ label: formatTemperature(disk.temperature),
+ current,
+ title: current
+ ? undefined
+ : getPhysicalDiskLastKnownTemperatureTitle(disk.collection?.temperature),
+ };
+}
+
export function getPhysicalDiskCollectionMessages(disk: PhysicalDiskPresentationData): string[] {
const collection = disk.collection;
if (!collection) return [];
diff --git a/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts b/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
index 166571e68f..cca8d9a7f4 100644
--- a/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePoolDetailPresentation.ts
@@ -1,4 +1,5 @@
import type { HistoryTimeRange, ResourceType as HistoryChartResourceType } from '@/api/charts';
+import { getPhysicalDiskTemperaturePresentation } from '@/features/storageBackups/diskPresentation';
import type { StorageRecord } from '@/features/storageBackups/models';
import {
getStorageRecordContent,
@@ -27,6 +28,8 @@ export type StoragePoolDetailLinkedDisk = {
sizeLabel: string;
diskType: string;
temperature: number;
+ /** Set only when the temperature is a retained, not current, reading. */
+ temperatureLastKnownTitle?: string;
hasIssue: boolean;
spunDown: boolean;
errorCount: number;
@@ -305,6 +308,12 @@ const readDiskTemperature = (disk: Resource): number => {
return typeof physicalDisk.temperature === 'number' ? physicalDisk.temperature : 0;
};
+const readDiskTemperatureLastKnownTitle = (disk: Resource): string | undefined =>
+ getPhysicalDiskTemperaturePresentation({
+ temperature: readDiskTemperature(disk),
+ collection: readPhysicalDisk(disk).collection,
+ })?.title;
+
const readDiskType = (disk: Resource): string => {
const physicalDisk = readPhysicalDisk(disk);
return typeof physicalDisk.diskType === 'string' ? physicalDisk.diskType.trim() : '';
@@ -424,6 +433,7 @@ export function getStoragePoolLinkedDisks(
sizeLabel: readDiskSizeLabel(disk),
diskType: readDiskType(disk),
temperature: readDiskTemperature(disk),
+ temperatureLastKnownTitle: readDiskTemperatureLastKnownTitle(disk),
hasIssue: readDiskHasIssue(disk),
spunDown: readDiskSpunDown(disk),
errorCount: readDiskErrorCount(disk),