aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default/list.html
diff options
context:
space:
mode:
authorMantas Vilčinskas <hi@mnts.lt>2020-02-29 19:09:14 +0200
committerMantas Vilčinskas <hi@mnts.lt>2020-02-29 19:09:14 +0200
commit1316c50e547f99f8ae6629342be3d1fc9302f4b7 (patch)
tree6cade4ae8f564783a6d9bf264c7da78fce0b7047 /layouts/_default/list.html
parent4c130e97302744acd00a1dce0dac6a221b59fffc (diff)
Fix SVG, add metrics for affected, de i18n, mini fixups
Diffstat (limited to 'layouts/_default/list.html')
-rw-r--r--layouts/_default/list.html28
1 files changed, 28 insertions, 0 deletions
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 }}
+
+ <!-- Average downtime -->
+ {{ if not .Params.disableComplexCalculations }}
+ <p class="bold">
+ <em>
+ {{ $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 }}
+ </em>
+ </p>
+ {{ end }}
+
+
<small class="faded">{{ len .Pages }} {{ T "entries" }}, {{ T "newestToOldest" }}</small>
<div class="padding"></div>