aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authorMantas Vilčinskas <11616378+mistermantas@users.noreply.github.com>2020-02-29 19:13:41 +0200
committerGitHub <noreply@github.com>2020-02-29 19:13:41 +0200
commitbe7208f99ef75d1ca01c7c17481e6b7bb2955410 (patch)
tree6cade4ae8f564783a6d9bf264c7da78fce0b7047 /layouts/_default
parentf55cffc137c01ccf1543d0b956d64c428be78405 (diff)
parent1316c50e547f99f8ae6629342be3d1fc9302f4b7 (diff)
#93 - cState v4.1
Diffstat (limited to 'layouts/_default')
-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>