{{define "title"}}Alerts · restic-manager{{end}} {{define "content"}} {{$page := .Page}} {{$filter := $page.Filter}}
{{/* crumbs */}}
Dashboard/ alerts
{{/* page header */}}

Alerts {{$page.Counts.Open}} open {{if gt $page.Counts.Acknowledged 0}} · {{$page.Counts.Acknowledged}} acknowledged{{end}} · {{$page.Counts.Resolved24h}} resolved (24h)

{{/* triage legend — Acknowledge vs Resolve looks identical on screen (both leave the Open tab) so the difference needs spelling out. */}}
Acknowledge silences fan-out while the underlying problem is still happening — the alert moves to the Acknowledged tab. Resolve closes the alert; the next failure raises a fresh one with a new notification.
{{/* filter strip */}}
{{/* status pills */}}
{{range list "open" "acknowledged" "resolved" "all"}} {{$s := .}} {{$active := eq $s $filter.Status}} {{if and (eq $s "all") (eq $filter.Status "")}}{{$active = true}}{{end}} {{if eq $s "open"}}Open {{$page.Counts.Open}} {{else if eq $s "acknowledged"}}Acknowledged {{$page.Counts.Acknowledged}} {{else if eq $s "resolved"}}Resolved {{$page.Counts.Resolved24h}} {{else}}All{{end}} {{end}}
{{/* severity dropdown */}}
{{/* host dropdown */}}
{{/* search input */}}
{{if $filter.Severity}}{{end}} {{if $filter.HostID}}{{end}}
{{/* alerts table — polled every 15s while the tab is visible. hx-get re-fetches the same URL (so filter querystring is preserved) and hx-select pulls just this element out of the full response, replacing the live one. Pauses automatically when the tab is backgrounded so we're not burning CPU on inactive tabs. The polling lives here (not on the page root) so the filter strip and header don't flash on each tick. */}}
{{/* header row */}}
Kind
Host
Message
Raised
Last seen
live ●
{{if eq (len $page.Alerts) 0}} {{/* empty state */}}
All clear.
No alerts match the current filter.
{{else}} {{range $page.Alerts}} {{template "alert_row" (dict "Alert" . "HostNames" $page.HostNames "Filter" $page.Filter)}} {{end}} {{end}}
{{end}}