This commit is contained in:
Marius Pana 2018-07-16 12:08:29 +03:00
parent 95d0b2d04e
commit 4755e269a4
3 changed files with 34 additions and 6 deletions

View File

@ -0,0 +1,10 @@
+++
title = "Portal is under development."
date = 2018-07-16T08:56:40.000Z
severity = "under-maintenance"
affectedsystems = [
"Portal"
]
resolved = false
+++
The customer Portal does not yet exist as it is under development.

View File

@ -11,3 +11,17 @@
degraded-performance = "warning"
partial-outage = "warning"
major-outage = "danger"
[levels]
0 = "ok"
1 = "under-maintenance"
2 = "degraded-performance"
3 = "partial-outage"
4 = "major-outage"
[levels_reverse]
ok = 0
under-maintenance = 1
degraded-performance = 2
partial-outage = 3
major-outage = 4

View File

@ -9,18 +9,22 @@
<div class="card">
{{- $name -}}
{{ if $.incidents }}
{{ $.content.Scratch.Set "max" 0 }}
{{ range $.incidents }}
{{ if in .Params.affectedsystems $name }}
{{ $alert := index .Site.Data.severity.alerts .Params.severity }}
{{ $desc := index .Site.Data.severity.descriptions .Params.severity }}
{{ $level := index .Site.Data.severity.levels_reverse .Params.severity }}
{{ if gt $level ($.content.Scratch.Get "max") }}
{{ $.content.Scratch.Set "max" $level }}
{{ end }}
{{ end }}
{{ end }}
{{ $severity := index $.content.Site.Data.severity.levels (string ($.content.Scratch.Get "max")) }}
{{ $alert := index $.content.Site.Data.severity.alerts $severity }}
{{ $desc := index $.content.Site.Data.severity.descriptions $severity }}
{{ partial "status-badge" (dict "alert" $alert "description" $desc) }}
{{ else }}
{{ partial "status-badge" (dict "alert" $okAlert "description" $okDesc) }}
{{ end }}
{{ end }}
{{ else }}
{{ partial "status-badge" (dict "alert" $okAlert "description" $okDesc) }}
{{ end }}
</div>
</div>
{{ end }}