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 --- layouts/_default/list.html | 28 ++++++++++++++++++++++++++++ layouts/index.svg | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'layouts') 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