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.

fix: Temperature text color now respects configured thresholds. Related to #984

rcourtman3a7e26f42f80
diff --git a/frontend-modern/src/components/shared/NodeSummaryTable.tsx b/frontend-modern/src/components/shared/NodeSummaryTable.tsx
index 120e714c78..32d2530095 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<NodeSummaryTableProps> = (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<NodeSummaryTableProps> = (props) => {
value={value}
min={min}
max={max}
+ critical={temperatureThreshold()}
+ warning={Math.max(0, temperatureThreshold() - 5)}
/>
</div>
);
}
return (
- <TemperatureGauge value={value} />
+ <TemperatureGauge
+ value={value}
+ critical={temperatureThreshold()}
+ warning={Math.max(0, temperatureThreshold() - 5)}
+ />
);
})()}
</Show>
diff --git a/frontend-modern/src/stores/alertsActivation.ts b/frontend-modern/src/stores/alertsActivation.ts
index 889e156ee4..21de3e53ec 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,