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" degraded-performance = "warning"
partial-outage = "warning" partial-outage = "warning"
major-outage = "danger" 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,15 +9,19 @@
<div class="card"> <div class="card">
{{- $name -}} {{- $name -}}
{{ if $.incidents }} {{ if $.incidents }}
{{ $.content.Scratch.Set "max" 0 }}
{{ range $.incidents }} {{ range $.incidents }}
{{ if in .Params.affectedsystems $name }} {{ if in .Params.affectedsystems $name }}
{{ $alert := index .Site.Data.severity.alerts .Params.severity }} {{ $level := index .Site.Data.severity.levels_reverse .Params.severity }}
{{ $desc := index .Site.Data.severity.descriptions .Params.severity }} {{ if gt $level ($.content.Scratch.Get "max") }}
{{ partial "status-badge" (dict "alert" $alert "description" $desc) }} {{ $.content.Scratch.Set "max" $level }}
{{ else }} {{ end }}
{{ partial "status-badge" (dict "alert" $okAlert "description" $okDesc) }}
{{ end }} {{ 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 }} {{ else }}
{{ partial "status-badge" (dict "alert" $okAlert "description" $okDesc) }} {{ partial "status-badge" (dict "alert" $okAlert "description" $okDesc) }}
{{ end }} {{ end }}
@ -25,4 +29,4 @@
</div> </div>
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}