Run manual diagnostic attachments in the background

This commit is contained in:
ayurishchev committed 2026-11-22 20:50:39 +03:00
1 parent d845a5e4b6
commit 89ac4d5bcd
40 files changed
+1560 -58

No files matched your search

+8
View File
@@ -47,6 +47,9 @@ type overviewData struct {
// nil when the scan status is unavailable.
AutoCycle *autoCycleDTO
Scan *scanStatusDTO
// Diagnostics is the number of addresses held in diagnostic mode (0 when
// none or when the list could not be fetched — the line is then omitted).
Diagnostics int
}
func (s *Server) loadOverview(r *http.Request) (overviewData, error) {
@@ -106,6 +109,11 @@ func (s *Server) loadOverview(r *http.Request) (overviewData, error) {
} else if sc.Running {
data.Scan = &sc
}
if diag, dErr := s.CA.ListDiagnostics(ctx); dErr != nil {
s.Log.Warn("overview: diagnostics list unavailable", "err", dErr)
} else {
data.Diagnostics = len(diag)
}
return data, nil
}