From 1316c50e547f99f8ae6629342be3d1fc9302f4b7 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 29 Feb 2020 19:09:14 +0200 Subject: Fix SVG, add metrics for affected, de i18n, mini fixups --- exampleSite/config.yml | 21 ++++++++++------ ...8-04-13-unavailable-guilds-connection-issues.md | 1 + i18n/de.yaml | 18 +++++++++++++- i18n/en.yaml | 12 +++++++++- i18n/lt.yaml | 14 +++++++++-- layouts/_default/list.html | 28 ++++++++++++++++++++++ layouts/index.svg | 2 +- 7 files changed, 84 insertions(+), 12 deletions(-) diff --git a/exampleSite/config.yml b/exampleSite/config.yml index b384501..afb644b 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -219,16 +219,17 @@ params: # name: Name # link: https://example.com - # Auto refresh the page - # every ~5 min + # Disable complex server-side + # calculations that may impact + # your build performance # - # This does nothing but - # refresh the page; it - # does not send alerts! + # Disables math calculations + # for average downtime on + # systems ("/affected/") pages # - # Default: true + # Default: false # BOOLEAN; `true`, `false` - autoRefresh: true + disableComplexCalculations: false # Incident posts shown # in one page @@ -316,3 +317,9 @@ outputs: - html - json - rss + - svg + +outputFormats: + svg: + isPlainText: true + mediaType: image/svg+xml \ No newline at end of file diff --git a/exampleSite/content/issues/2018-04-13-unavailable-guilds-connection-issues.md b/exampleSite/content/issues/2018-04-13-unavailable-guilds-connection-issues.md index a5213d1..170bd1f 100644 --- a/exampleSite/content/issues/2018-04-13-unavailable-guilds-connection-issues.md +++ b/exampleSite/content/issues/2018-04-13-unavailable-guilds-connection-issues.md @@ -7,6 +7,7 @@ resolvedWhen: 2018-04-13 17:30:00 severity: down affected: - API + - Media Proxy section: issue --- diff --git a/i18n/de.yaml b/i18n/de.yaml index 15a6153..7ff9a57 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -1,5 +1,5 @@ # German language file for cState -# Version 3.0 +# Version 4.1 - id: languageCode translation: de @@ -125,7 +125,23 @@ ## ## v3 ## + - id: entries translation: Einträge - id: newestToOldest translation: von alt nach neu + +## +## v4 +## +- id: notFoundAffected + translation: Es sieht so aus als würde dieses Dokument nicht existieren, oder es hatte noch nie einen aufgezeichneten Ausfall. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Zurzeit, basierend auf Durchschnittsdaten, sieht es so aus, als ob dieses System für ungefähr +- id: averageSystemsDowntimeSecondPart + translation: Minuten ausfällt. \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml index e417040..2826eca 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,5 +1,6 @@ # English language file for cState -# Version 3.0 +# Official +# Version 4.1 - id: languageCode translation: en @@ -137,3 +138,12 @@ ## - id: notFoundAffected translation: It looks like this system either does not exist or has never had any recorded downtime. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Recently, based on averages data, it looks like this system has gone down for about +- id: averageSystemsDowntimeSecondPart + translation: minutes at a time. diff --git a/i18n/lt.yaml b/i18n/lt.yaml index bee5e28..5c1368d 100644 --- a/i18n/lt.yaml +++ b/i18n/lt.yaml @@ -1,5 +1,6 @@ # Lithuanian language file for cState -# Version 3.0 +# Official +# Version 4.1 - id: languageCode translation: en @@ -136,4 +137,13 @@ ## v4 ## - id: notFoundAffected - translation: Ši sistema neturi nė vieno įrašo. Arba neegzistuoja, arba nė vieną kartą nebuvo sutrukdyta jos veikla. \ No newline at end of file + translation: Ši sistema neturi nė vieno įrašo. Arba neegzistuoja, arba nė vieną kartą nebuvo sutrukdyta jos veikla. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Pastaruoju metu, regis, šis komponentas sutrikimų metu neveikia apie +- id: averageSystemsDowntimeSecondPart + translation: min. diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b8c14c6..8d80798 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -18,6 +18,34 @@ {{ end }} {{ end }} + + + {{ if not .Params.disableComplexCalculations }} +

+ + {{ $resolved := first 5 (where .Pages "Params.resolved" "=" true) }} + + {{ if gt $resolved 0 }} + {{ $.Scratch.Set "counter" 0 }} + {{ range $resolved }} + + {{ $t := (time .Params.ResolvedWhen) }} + {{ $timeDiff := (sub $t.Unix .Date.Unix) }} + {{ $diffInMin := (div $timeDiff 60) }} + + {{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") $diffInMin) }} + {{ end }} + + {{ T "averageSystemsDowntime" }} + + {{ div ($.Scratch.Get "counter") (len $resolved) }} + {{ T "averageSystemsDowntimeSecondPart" }} + {{ end }} + +

+ {{ end }} + + {{ len .Pages }} {{ T "entries" }}, {{ T "newestToOldest" }}
diff --git a/layouts/index.svg b/layouts/index.svg index 4b235e0..dbd6483 100644 --- a/layouts/index.svg +++ b/layouts/index.svg @@ -33,7 +33,7 @@ - + {{ $shield_prefix }} -- cgit v1.2.3-70-g09d2