{{ define "main" }}
{{ $length := len .Targets }} {{ if eq $length 0 }}

There are no targets yet.

Create a target to target your services and get notified when they are down.

{{ else }} {{ if or (eq .Outcome "UNKNOWN") (eq .Outcome "HEALTHY") }}

All services are online

Last updated on {{ Now.UTC.Format "Jan 02 at 15:04 MST" }}

{{ else if eq .Outcome "DOWN" }}

Some services are down

Last updated on {{ Now.UTC.Format "Jan 02 at 15:04 MST" }}

{{ else if eq .Outcome "DEGRADED" }}

Degraded services

Last updated on {{ Now.UTC.Format "Jan 02 at 15:04 MST" }}

{{ end }}
{{ range $group, $targetsAndStatus := .Targets }}
{{ .Outcome }}

{{ $group }}

{{ range $targetsAndStatus.Targets }}
{{ .Outcome }}

{{ .Name }} {{ if eq .Visibility "PUBLIC" }} Public {{ else if eq .Visibility "PRIVATE" }} Private {{ else }} Unknown {{ end }}

{{ printf "%.2f" .Uptime }}% uptime
{{ range .History }}
{{ end }}
{{ if eq $.TimeRange "90days" }} 90 days ago {{ else if eq $.TimeRange "48hours" }} 48 hours ago {{ else if eq $.TimeRange "90minutes" }} 90 minutes ago {{ end }}
Now
{{ end }}
{{ end }}
{{ end }}
{{ end }}