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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix: Allow dismissing AI findings without Pro license. Related to #885
rcourtman0feb03977512
diff --git a/frontend-modern/src/api/patrol.ts b/frontend-modern/src/api/patrol.tsindex 78facd21b9..3f08b2e5e7 100644--- a/frontend-modern/src/api/patrol.ts+++ b/frontend-modern/src/api/patrol.ts@@ -243,6 +243,18 @@ export async function suppressFinding(findingId: string): Promise<{ success: boo});}+/**+ * Clear all AI findings+ * Removes all accumulated findings from the store.+ * Useful for users who want to start fresh or who accumulated findings+ * before AI was properly configured.+ */+export async function clearAllFindings(): Promise<{ success: boolean; cleared: number; message: string }> {+ return apiFetchJSON('/api/ai/patrol/findings?confirm=true', {+ method: 'DELETE',+ });+}+/*** Severity color mapping for UI*/diff --git a/frontend-modern/src/pages/Alerts.tsx b/frontend-modern/src/pages/Alerts.tsxindex e4ffa2e030..a37a9bdb48 100644--- a/frontend-modern/src/pages/Alerts.tsx+++ b/frontend-modern/src/pages/Alerts.tsx@@ -32,7 +32,7 @@ import History from 'lucide-solid/icons/history';import Gauge from 'lucide-solid/icons/gauge';import Send from 'lucide-solid/icons/send';import Calendar from 'lucide-solid/icons/calendar';-import { getPatrolStatus, getFindings, getFindingsHistory, getPatrolRunHistory, forcePatrol, subscribeToPatrolStream, dismissFinding, suppressFinding, resolveFinding, getSuppressionRules, addSuppressionRule, deleteSuppressionRule, type Finding, type PatrolStatus, type PatrolRunRecord, type SuppressionRule, severityColors, formatTimestamp, categoryLabels } from '@/api/patrol';+import { getPatrolStatus, getFindings, getFindingsHistory, getPatrolRunHistory, forcePatrol, subscribeToPatrolStream, dismissFinding, suppressFinding, resolveFinding, clearAllFindings, getSuppressionRules, addSuppressionRule, deleteSuppressionRule, type Finding, type PatrolStatus, type PatrolRunRecord, type SuppressionRule, severityColors, formatTimestamp, categoryLabels } from '@/api/patrol';import { aiChatStore } from '@/stores/aiChat';type AlertTab = 'overview' | 'thresholds' | 'destinations' | 'schedule' | 'history';@@ -2703,22 +2703,49 @@ function OverviewTab(props: {size="md"class="mb-0"/>- <button- class="px-3 py-1.5 text-xs font-medium rounded-lg transition-all bg-purple-100 dark:bg-purple-900/40 text-purple-700 dark:text-purple-300 border border-purple-300 dark:border-purple-700 hover:bg-purple-200 dark:hover:bg-purple-900/60 disabled:opacity-50 disabled:cursor-not-allowed"- onClick={() => handleForcePatrol(true)}- disabled={forcePatrolLoading() || patrolStatus()?.running || patrolRequiresLicense()}- title={patrolRequiresLicense()- ? 'Pulse Pro required to run AI Patrol'- : (patrolStatus()?.running ? 'Patrol in progress - see table below' : 'Run a patrol check now')}- >- <span class="flex items-center gap-1.5">- <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />- </svg>- Run Patrol- </span>- </button>+ <div class="flex items-center gap-2">+ <Show when={aiFindings().length > 0}>+ <button+ class="px-3 py-1.5 text-xs font-medium rounded-lg transition-all bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-700"+ onClick={async () => {+ if (confirm(`Clear all ${aiFindings().length} AI findings?\n\nThis will remove all current insights. New issues will be detected on the next patrol run.`)) {+ try {+ const result = await clearAllFindings();+ notificationStore.success(result.message || `Cleared ${result.cleared} findings`);+ fetchAiData();+ } catch (err) {+ logger.error('Failed to clear findings:', err);+ notificationStore.error('Failed to clear findings');+ }+ }+ }}+ title="Clear all AI findings"+ >+ <span class="flex items-center gap-1.5">+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />+ </svg>+ Clear All+ </span>+ </button>+ </Show>+ <button+ class="px-3 py-1.5 text-xs font-medium rounded-lg transition-all bg-purple-100 dark:bg-purple-900/40 text-purple-700 dark:text-purple-300 border border-purple-300 dark:border-purple-700 hover:bg-purple-200 dark:hover:bg-purple-900/60 disabled:opacity-50 disabled:cursor-not-allowed"+ onClick={() => handleForcePatrol(true)}+ disabled={forcePatrolLoading() || patrolStatus()?.running || patrolRequiresLicense()}+ title={patrolRequiresLicense()+ ? 'Pulse Pro required to run AI Patrol'+ : (patrolStatus()?.running ? 'Patrol in progress - see table below' : 'Run a patrol check now')}+ >+ <span class="flex items-center gap-1.5">+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />+ </svg>+ Run Patrol+ </span>+ </button>+ </div></div><Show when={patrolRequiresLicense()}>diff --git a/internal/ai/findings.go b/internal/ai/findings.goindex 0fea4c4928..cb28133369 100644--- a/internal/ai/findings.go+++ b/internal/ai/findings.go@@ -584,6 +584,20 @@ func (s *FindingsStore) GetAll(startTime *time.Time) []*Finding {return result}+// ClearAll removes all findings from the store+// Returns the number of findings removed+func (s *FindingsStore) ClearAll() int {+ s.mu.Lock()+ defer s.mu.Unlock()++ count := len(s.findings)+ s.findings = make(map[string]*Finding)+ s.byResource = make(map[string][]string)+ s.activeCounts = make(map[FindingSeverity]int)+ s.scheduleSave()+ return count+}+// Cleanup removes old resolved findingsfunc (s *FindingsStore) Cleanup(maxAge time.Duration) int {s.mu.Lock()diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.goindex a39bf7720a..2b7a009496 100644--- a/internal/api/ai_handlers.go+++ b/internal/api/ai_handlers.go@@ -2718,6 +2718,48 @@ func (h *AISettingsHandler) HandleSuppressFinding(w http.ResponseWriter, r *http}}+// HandleClearAllFindings clears all AI findings (DELETE /api/ai/patrol/findings)+// This allows users to clear accumulated findings, especially useful for users who+// accumulated findings before the patrol-without-AI bug was fixed.+func (h *AISettingsHandler) HandleClearAllFindings(w http.ResponseWriter, r *http.Request) {+ if r.Method != http.MethodDelete {+ http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)+ return+ }++ // Require authentication (already wrapped by RequireAuth in router)+ if !CheckAuth(h.config, w, r) {+ return+ }++ // Check for confirm parameter+ if r.URL.Query().Get("confirm") != "true" {+ http.Error(w, "confirm=true query parameter required", http.StatusBadRequest)+ return+ }++ patrol := h.aiService.GetPatrolService()+ if patrol == nil {+ http.Error(w, "Patrol service not available", http.StatusServiceUnavailable)+ return+ }++ findings := patrol.GetFindings()+ count := findings.ClearAll()++ log.Info().Int("count", count).Msg("Cleared all AI findings")++ response := map[string]interface{}{+ "success": true,+ "cleared": count,+ "message": fmt.Sprintf("Cleared %d findings", count),+ }++ if err := utils.WriteJSONResponse(w, response); err != nil {+ log.Error().Err(err).Msg("Failed to write clear findings response")+ }+}+// HandleGetFindingsHistory returns all findings including resolved for history (GET /api/ai/patrol/history)func (h *AISettingsHandler) HandleGetFindingsHistory(w http.ResponseWriter, r *http.Request) {if r.Method != http.MethodGet {diff --git a/internal/api/router.go b/internal/api/router.goindex 6f36df9e9f..30b2a721f2 100644--- a/internal/api/router.go+++ b/internal/api/router.go@@ -1161,14 +1161,26 @@ func (r *Router) setupRoutes() {// Mutation endpoints (run, acknowledge, dismiss, etc.) return 402 to prevent unauthorized actionsr.mux.HandleFunc("/api/ai/patrol/status", RequireAuth(r.config, r.aiSettingsHandler.HandleGetPatrolStatus))r.mux.HandleFunc("/api/ai/patrol/stream", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandlePatrolStream)))- r.mux.HandleFunc("/api/ai/patrol/findings", RequireAuth(r.config, r.aiSettingsHandler.HandleGetPatrolFindings))+ r.mux.HandleFunc("/api/ai/patrol/findings", RequireAuth(r.config, func(w http.ResponseWriter, req *http.Request) {+ switch req.Method {+ case http.MethodGet:+ r.aiSettingsHandler.HandleGetPatrolFindings(w, req)+ case http.MethodDelete:+ // Clear all findings - doesn't require Pro license so users can clean up accumulated findings+ r.aiSettingsHandler.HandleClearAllFindings(w, req)+ default:+ http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)+ }+ }))r.mux.HandleFunc("/api/ai/patrol/history", RequireAuth(r.config, r.aiSettingsHandler.HandleGetFindingsHistory))r.mux.HandleFunc("/api/ai/patrol/run", RequireAdmin(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleForcePatrol)))r.mux.HandleFunc("/api/ai/patrol/acknowledge", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleAcknowledgeFinding)))- r.mux.HandleFunc("/api/ai/patrol/dismiss", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleDismissFinding)))+ // Dismiss and resolve don't require Pro license - users should be able to clear findings they can see+ // This is especially important for users who accumulated findings before fixing the patrol-without-AI bug+ r.mux.HandleFunc("/api/ai/patrol/dismiss", RequireAuth(r.config, r.aiSettingsHandler.HandleDismissFinding))r.mux.HandleFunc("/api/ai/patrol/suppress", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleSuppressFinding)))r.mux.HandleFunc("/api/ai/patrol/snooze", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleSnoozeFinding)))- r.mux.HandleFunc("/api/ai/patrol/resolve", RequireAuth(r.config, RequireLicenseFeature(r.licenseHandlers.Service(), license.FeatureAIPatrol, r.aiSettingsHandler.HandleResolveFinding)))+ r.mux.HandleFunc("/api/ai/patrol/resolve", RequireAuth(r.config, r.aiSettingsHandler.HandleResolveFinding))r.mux.HandleFunc("/api/ai/patrol/runs", RequireAuth(r.config, r.aiSettingsHandler.HandleGetPatrolRunHistory))// Suppression rules management (also Pro-only since they control LLM behavior)// GET returns empty array for unlicensed, POST returns 402