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 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'layouts/_default') 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" }}
-- cgit v1.2.3-70-g09d2