{{/* 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"}} {{else}} {{end}}

{{$host.Name}}

{{range $host.Tags}}{{.}}{{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}}
{{$host.OS}}/{{$host.Arch}} · agent {{if $host.AgentVersion}}{{$host.AgentVersion}}{{else}}—{{end}} · restic {{if $host.ResticVersion}}{{$host.ResticVersion}}{{else}}—{{end}} · {{if eq $host.Status "offline"}} last seen {{relTime $host.LastSeenAt}} {{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}}
{{/* ---------- secondary tabs ---------- */}}
Snapshots {{comma $host.SnapshotCount}} Sources {{$page.SourceGroupCount}} Schedules {{$page.ScheduleCount}} Repo
Jobs
Settings
{{end}}