http: /alerts list + ack/resolve handlers + /api/alerts JSON

This commit is contained in:
2026-05-04 19:59:24 +01:00
parent c710743231
commit 5c6ac155eb
3 changed files with 213 additions and 0 deletions
+7
View File
@@ -199,6 +199,9 @@ func (s *Server) routes(r chi.Router) {
// Snapshot diff (P3-09). Dispatches a JobDiff against two
// snapshots; output streams to the standard live job page.
r.Post("/hosts/{id}/snapshots/diff", s.handleSnapshotDiff)
// Alert list (JSON variant). Same filter shape as the UI page.
r.Get("/alerts", s.handleAPIAlerts)
})
// HTMX form variant of diff (mounted outside /api so HTMX forms
@@ -302,6 +305,10 @@ func (s *Server) routes(r chi.Router) {
r.Get("/hosts/{id}/snapshots/{sid}/restore", s.handleUIRestoreGet)
r.Post("/hosts/{id}/restore", s.handleUIRestorePost)
r.Get("/hosts/{id}/restore/tree", s.handleUIRestoreTree)
// Alerts list + operator actions.
r.Get("/alerts", s.handleUIAlerts)
r.Post("/alerts/{id}/acknowledge", s.handleUIAlertAcknowledge)
r.Post("/alerts/{id}/resolve", s.handleUIAlertResolve)
}
// Browser job-log stream (separate from /ws/agent so the auth