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 AI intelligence state on org switch to prevent data bleed

rcourtmaneebe0b5f748b
diff --git a/frontend-modern/src/stores/aiIntelligence.ts b/frontend-modern/src/stores/aiIntelligence.ts
index 6650fb3fb5..df483182af 100644
--- a/frontend-modern/src/stores/aiIntelligence.ts
+++ b/frontend-modern/src/stores/aiIntelligence.ts
@@ -40,6 +40,7 @@ import { logger } from '@/utils/logger';
import type { CorrelationsResponse, IntelligenceSummary } from '@/types/aiIntelligence';
import { normalizeIntelligenceSummary } from './aiIntelligenceSummaryModel';
import { presentationPolicyIsDemoMode } from './sessionPresentationPolicy';
+import { eventBus } from './events';
// ============================================
// Enum validation helpers
@@ -425,6 +426,28 @@ const [intelligenceSummary, setIntelligenceSummary] = createSignal<IntelligenceS
const [correlations, setCorrelations] = createSignal<CorrelationsResponse | null>(null);
+// ============================================
+// Org Switch Reset
+// ============================================
+
+eventBus.on('org_switched', () => {
+ setUnifiedFindings([]);
+ setFindingsLoading(false);
+ setFindingsError(null);
+ setPatrolFindings([]);
+ setPatrolFindingsLoading(false);
+ setPatrolFindingsError(null);
+ patrolFindingsIncludeResolvedPreference = false;
+ setRemediationPlans([]);
+ setPlansLoading(false);
+ setPlansError(null);
+ setPendingApprovalsWithExpiryTracking([]);
+ setApprovalsError(null);
+ setCircuitBreakerStatus(null);
+ setIntelligenceSummary(null);
+ setCorrelations(null);
+});
+
// ============================================
// Store API
// ============================================