{{ define "main" }} {{ $outcomeText := "All services are online." }} {{ $outcomeIcon := "check" }} {{ $outcomeColor := "bg-green-300" }} {{ if eq .Outcome "DOWN" }} {{ $outcomeText = "Some services are down." }} {{ $outcomeIcon = "alert-circle" }} {{ $outcomeColor = "bg-red-300" }} {{ else if eq .Outcome "DEGRADED" }} {{ $outcomeText = "Some services are degraded." }} {{ $outcomeIcon = "alert-triangle" }} {{ $outcomeColor = "bg-orange-300" }} {{ else if eq .Outcome "UNKNOWN" }} {{ $outcomeText = "We are unable to determine current status." }} {{ $outcomeIcon = "help-circle" }} {{ $outcomeColor = "bg-gray-300" }} {{ end }}
{{ $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 }}

{{ $outcomeText }}

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

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

{{ $group }}

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

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

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