{{/* section label: Status about: Whether each service is working, the overall picture, and recent incidents. fields: - { name: heading, type: text } - { name: from, type: data, default: status, label: Status from, help: The file in data/ with your components. } - { name: collection, type: collection, default: incidents, label: Incidents from } - { name: count, type: number, default: 5, label: Recent incidents to show } */}} {{ $d := data (default "status" .Data.from) }}{{ $c := default "incidents" .Data.collection }} {{ $down := false }}{{ $part := false }}{{ $maint := false }} {{ range $d.components }}{{ $s := print .status }}{{ if eq $s "outage" }}{{ $down = true }}{{ else if eq $s "degraded" }}{{ $part = true }}{{ else if eq $s "maintenance" }}{{ $maint = true }}{{ end }}{{ end }} {{ $open := list }}{{ $past := list }}{{ range collection $c }}{{ if eq (print .Params.status) "resolved" }}{{ $past = append $past . }}{{ else }}{{ $open = append $open . }}{{ end }}{{ end }}
{{ with .Data.heading }}

{{ . }}

{{ end }}

{{ if $down }}Something is down.{{ else if or $part $open }}Some things aren't working as they should.{{ else if $maint }}Maintenance is under way.{{ else }}Everything is working.{{ end }} As of {{ date "January 2, 2006, 3:04 PM" now }}.

{{ with $open }}

Now

{{ end }} {{ with $past }}

Past incidents

{{ end }}

Every incident ยท Follow in a feed reader