{{/* host_chrome — header (status dot + name + tags + meta), vitals strip, and the six sub-tab nav for any /hosts/{id}/... page. Expects .Page to expose: .Host — store.Host .SubTab — "snapshots" | "sources" | "schedules" | "repo" | "jobs" | "settings" .SourceGroupCount — int .ScheduleCount — int .ScheduleVersion — int64 (host_schedule_version) .Crumb — string ("snapshots" / "sources" / etc — appended after host name) */}} {{define "host_chrome"}} {{$page := .Page}} {{$host := $page.Host}}
Dashboard/ {{if eq $page.SubTab "snapshots"}} {{$host.Name}} {{else}} {{$host.Name}}/ {{$page.Crumb}} {{end}}
{{/* ---------- header ---------- */}}
{{if eq $host.Status "online"}} {{else if eq $host.Status "degraded"}} {{else if eq $host.Status "offline"}} {{if $host.AlwaysOn}} {{else}} {{end}} {{else}} {{end}}

{{$host.Name}}

{{/* tags group pill — click the "tags" label to edit; the tag values still filter the dashboard by that tag. */}} tags {{range $host.Tags}}{{.}}{{end}} {{if not $host.Tags}}{{end}} {{/* presence group pill — click anywhere to edit. */}} presence {{if $host.AlwaysOn}}24x7{{else}}Free{{end}}
{{if gt $page.ScheduleVersion 0}} version {{$page.ScheduleVersion}} {{if eq $page.ScheduleVersion $host.AppliedScheduleVersion}} · agent in sync {{else}} · agent at v{{$host.AppliedScheduleVersion}} {{end}} {{end}}
{{/* Inline tags editor — hidden by default; toggled by the "edit/add tags" button above. Comma-separated input with autocomplete sourced from the fleet's distinct tags via a . The help line under the input is always visible because the placeholder hint disappears once the field has a value, and operators editing existing tags are exactly the people most likely to forget the comma rule. */}} {{/* Presence-mode editor — hidden by default; toggled by the "presence" button. Checkbox present => always-on (24×7); unchecked => intermittent (laptop): no offline alerts, shows "asleep", auto-catches-up a missed backup on reconnect. */}}
{{$host.OS}}/{{$host.Arch}} · agent {{if $host.AgentVersion}}{{$host.AgentVersion}}{{else}}—{{end}}{{if $page.UpdateAvailable}} {{template "host_update_chip" $page}}{{end}} · restic {{if $host.ResticVersion}}{{$host.ResticVersion}}{{else}}—{{end}} · {{if eq $host.Status "offline"}} {{if $host.AlwaysOn}} last seen {{relTime $host.LastSeenAt}} {{else}} asleep · last seen {{relTime $host.LastSeenAt}} · will catch up on return {{end}} {{else}} online · last heartbeat {{relTime $host.LastSeenAt}} {{end}}
{{/* ---------- vitals strip ---------- */}}
Last backup
{{if eq (deref $host.LastBackupStatus) "succeeded"}} succeeded {{else if eq (deref $host.LastBackupStatus) "failed"}} failed {{else if eq (deref $host.LastBackupStatus) "cancelled"}} cancelled {{else}} never run {{end}} {{if $host.LastBackupAt}} · {{relTime $host.LastBackupAt}}{{end}}
Repo size
{{bytes $host.RepoSizeBytes}}
Snapshots
{{comma $host.SnapshotCount}}
Open alerts
{{if eq $host.OpenAlertCount 0}}0 · all clear{{else}}{{$host.OpenAlertCount}} · review →{{end}}
{{/* ---------- repo init line (P2R-09) ---------- */}} {{if $page.InitStatus}}
{{if eq $page.InitStatus "succeeded"}} repo ready · initialised {{relTime $page.InitAt}} {{else if eq $page.InitStatus "failed"}} init failed · job {{$page.InitJobID}} · retry from the Repo tab's danger zone {{else if eq $page.InitStatus "running"}} init running… · live log → {{else if eq $page.InitStatus "queued"}} init queued · job {{$page.InitJobID}} {{end}}
{{end}} {{/* ---------- latest restore line (P3-X3) ---------- */}} {{if $page.RestoreStatus}}
{{if eq $page.RestoreStatus "succeeded"}} last restore · succeeded {{relTime $page.RestoreAt}} · job log → {{else if eq $page.RestoreStatus "failed"}} last restore · failed {{relTime $page.RestoreAt}} · job log → {{else if eq $page.RestoreStatus "running"}} restore running… · live log → {{else if eq $page.RestoreStatus "cancelled"}} last restore · cancelled {{relTime $page.RestoreAt}} · job log → {{else if eq $page.RestoreStatus "queued"}} restore queued · job {{$page.RestoreJobID}} {{end}}
{{end}} {{/* ---------- secondary tabs ---------- */}}
Snapshots {{comma $host.SnapshotCount}} Sources {{$page.SourceGroupCount}} Schedules {{$page.ScheduleCount}} Repo Jobs
{{end}}