{{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 — option text tinted to match the colour already used in the row (dot, left border, kind chip). The severity word is otherwise invisible to operators because the table column shows kind only; the colour bridges the two. */}}
{{/* host dropdown */}}
{{/* search input */}}
{{if $filter.Severity}}{{end}} {{if $filter.HostID}}{{end}}
{{/* alerts table — polled every 5s when the tab is visible AND the live toggle is on. The localStorage check is part of the htmx trigger predicate, so flipping the toggle just sets the flag and the next tick (or the absence of one) honours it. No need to re-process the element when the toggle changes. The polling lives on this div (not the page root) so the filter strip and header don't flash on each tick. */}}
{{/* header row */}}
Kind
Host
Message
Raised
Last seen
{{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 "Usernames" $page.Usernames "Filter" $page.Filter)}} {{end}} {{end}}
{{end}}