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.

Cover disk temperature preference and observation state

pulse-triage[bot]3e3fbae0892e
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 7bb514c6e8..1e6de38952 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -6926,7 +6926,8 @@ describe('shared primitive guardrails', () => {
expect(sharedPlatformPageSource).toContain('export function PlatformTablePercentValue');
expect(sharedPlatformPageSource).toContain('export const formatPlatformTablePercentValue');
expect(sharedPlatformPageSource).toContain('export function PlatformTableTemperatureValue');
- expect(sharedPlatformPageSource).toContain('formatOneDecimalCelsius');
+ expect(sharedPlatformPageSource).toContain('formatOneDecimalTemperature');
+ expect(sharedPlatformPageSource).toContain('formatTemperature(value, { decimals: 1 })');
for (const [path, source] of percentConsumers) {
expect(source).toMatch(/PlatformTablePercentValue|formatPlatformTablePercentValue/);
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASStorageTopologyTable.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASStorageTopologyTable.test.tsx
index 1f29e4ddc9..084be4feb6 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASStorageTopologyTable.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASStorageTopologyTable.test.tsx
@@ -5,6 +5,7 @@ import { AlertsAPI } from '@/api/alerts';
import { useAlertsActivation } from '@/stores/alertsActivation';
import { eventBus } from '@/stores/events';
import type { AlertConfig } from '@/types/alerts';
+import { temperatureStore } from '@/utils/temperature';
import {
TrueNASStorageTopologyTable,
@@ -27,9 +28,53 @@ const makeStorageResource = (overrides: Partial<Resource> & Pick<Resource, 'id'>
afterEach(() => {
cleanup();
+ temperatureStore.setUnit('celsius');
});
describe('TrueNASStorageTopologyTable', () => {
+ it('converts both current and last-known disk readings without losing their observation state', async () => {
+ const disk = (id: string, state: 'available' | 'unavailable') =>
+ makeStorageResource({
+ id,
+ type: 'physical_disk',
+ storage: undefined,
+ physicalDisk: {
+ devPath: `/dev/${id}`,
+ diskType: 'sata',
+ temperature: 40,
+ collection: {
+ temperature: { state, source: 'agent', reason: 'host agent stopped reporting' },
+ },
+ },
+ });
+ const resources = [disk('current', 'available'), disk('retained', 'unavailable')];
+ temperatureStore.setUnit('fahrenheit');
+ const { container } = render(() => (
+ <TrueNASStorageTopologyTable
+ resources={resources}
+ scope={resources}
+ emptyIcon={<span />}
+ emptyTitle="No storage"
+ emptyDescription="No storage"
+ showToolbar={false}
+ kindFilter="disks"
+ />
+ ));
+
+ expect(screen.getAllByText('104.0°F')).toHaveLength(2);
+ const retained = container.querySelector('[data-temperature-reading="last-known"]');
+ expect(retained).toHaveTextContent('104.0°F, last known');
+ expect(retained).toHaveAttribute(
+ 'title',
+ 'Last known reading, not current: host agent stopped reporting',
+ );
+ expect(retained).toHaveClass('text-muted');
+ expect(resources.map((resource) => resource.physicalDisk?.temperature)).toEqual([40, 40]);
+ temperatureStore.setUnit('celsius');
+ expect(await screen.findAllByText('40.0°C')).toHaveLength(2);
+ expect(retained).toHaveTextContent('40.0°C, last known');
+ });
+
it('renders nested dataset depth with distinct row indentation', () => {
const pool = makeStorageResource({
id: 'pool-tank',