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.

Clear alerts activation config on org switch

rcourtmanbd0220ca5898
diff --git a/frontend-modern/src/stores/alertsActivation.ts b/frontend-modern/src/stores/alertsActivation.ts
index 0f8b3fcd67..74888fcbf4 100644
--- a/frontend-modern/src/stores/alertsActivation.ts
+++ b/frontend-modern/src/stores/alertsActivation.ts
@@ -10,6 +10,7 @@ import {
type DisplayMetricType,
resolveMetricDisplayThresholds,
} from '@/utils/metricThresholds';
+import { eventBus } from './events';
// Create signals for activation state
const [config, setConfig] = createSignal<AlertConfig | null>(null);
@@ -146,6 +147,14 @@ const getMetricThresholds = (
return resolveMetricDisplayThresholds(config(), scope, metric, resourceIds);
};
+eventBus.on('org_switched', () => {
+ setConfig(null);
+ applyActivationState(null);
+ setActiveAlerts([]);
+ setLastError(null);
+ setIsLoading(false);
+});
+
// Export the store
export const useAlertsActivation = () => ({
// Signals