{{define "host_row"}} {{$h := .Host}}
{{$h.Name}}
{{- if eq $h.Status "online" -}} {{- else if eq $h.Status "degraded" -}} {{- else if eq $h.Status "offline" -}} {{- if $h.AlwaysOn -}} {{- else -}} {{- end -}} {{- else -}} {{- end -}}
{{$h.Name}}
{{$h.OS}}/{{$h.Arch}}{{if .UpdateAvailable}} {{template "host_update_chip" .}}{{end}}
{{- if $h.CurrentJobID -}} backup running…
started {{relTime $h.LastBackupAt}} {{- else if eq (deref $h.LastBackupStatus) "succeeded" -}} succeeded · {{relTime $h.LastBackupAt}} {{- else if eq (deref $h.LastBackupStatus) "failed" -}} failed · {{relTime $h.LastBackupAt}} {{- else if eq (deref $h.LastBackupStatus) "cancelled" -}} cancelled · {{relTime $h.LastBackupAt}} {{- else if eq $h.Status "offline" -}} {{- if $h.AlwaysOn -}} last seen {{relTime $h.LastSeenAt}} {{- else -}} asleep · {{relTime $h.LastSeenAt}} · will catch up on return {{- end -}} {{- else -}} never run {{- end -}} {{- if .NextRun -}}
next {{relTime .NextRun}} {{- end -}}
{{bytes $h.RepoSizeBytes}}
{{.RepoSparklineSVG}}
{{- if eq $h.SnapshotCount 0 -}} {{- else -}} {{comma $h.SnapshotCount}} {{- end -}}
{{- if eq $h.OpenAlertCount 0 -}}—{{- else -}}{{$h.OpenAlertCount}}{{- end -}}
{{- range $h.Tags -}} {{.}} {{- end -}}
{{- if eq $h.Status "offline" -}} {{if $h.AlwaysOn}}offline{{else}}asleep{{end}} {{- else if $h.CurrentJobID -}} View job → {{- else if .RunAllScheduleID -}} {{- else -}} Open → {{- end -}}
{{end}}