diff --git a/frontend-modern/src/components/shared/NodeSummaryTable.tsx b/frontend-modern/src/components/shared/NodeSummaryTable.tsx index 120e714c7..32d253009 100644 --- a/frontend-modern/src/components/shared/NodeSummaryTable.tsx +++ b/frontend-modern/src/components/shared/NodeSummaryTable.tsx @@ -38,6 +38,9 @@ export const NodeSummaryTable: Component = (props) => { const { isMobile } = useBreakpoint(); const { viewMode } = useMetricsViewMode(); + // Get user-configured temperature threshold for display coloring + const temperatureThreshold = createMemo(() => alertsActivation.getTemperatureThreshold()); + const isTemperatureMonitoringEnabled = (node: Node): boolean => { const globalEnabled = props.globalTemperatureMonitoringEnabled ?? true; if (node.temperatureMonitoringEnabled !== undefined && node.temperatureMonitoringEnabled !== null) { @@ -701,13 +704,19 @@ export const NodeSummaryTable: Component = (props) => { value={value} min={min} max={max} + critical={temperatureThreshold()} + warning={Math.max(0, temperatureThreshold() - 5)} /> ); } return ( - + ); })()} diff --git a/frontend-modern/src/stores/alertsActivation.ts b/frontend-modern/src/stores/alertsActivation.ts index 889e156ee..21de3e53e 100644 --- a/frontend-modern/src/stores/alertsActivation.ts +++ b/frontend-modern/src/stores/alertsActivation.ts @@ -127,6 +127,18 @@ const getBackupThresholds = (): { freshHours: number; staleHours: number } => { }; }; +// Get temperature threshold from config (for display coloring) +const getTemperatureThreshold = (): number => { + const cfg = config(); + // nodeDefaults.temperature is a HysteresisThreshold with trigger/clear + const tempConfig = cfg?.nodeDefaults?.temperature; + if (typeof tempConfig === 'object' && tempConfig !== null && 'trigger' in tempConfig) { + return (tempConfig as { trigger: number }).trigger; + } + // Fallback to default 80°C + return 80; +}; + // Export the store export const useAlertsActivation = () => ({ // Signals @@ -139,6 +151,7 @@ export const useAlertsActivation = () => ({ // Computed isPastObservationWindow, getBackupThresholds, + getTemperatureThreshold, // Actions refreshConfig,