aboutsummaryrefslogtreecommitdiff
path: root/layouts
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
parent4c130e97302744acd00a1dce0dac6a221b59fffc (diff)
Fix SVG, add metrics for affected, de i18n, mini fixups
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html28
-rw-r--r--layouts/index.svg2
2 files changed, 29 insertions, 1 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>
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 @@
</clipPath>
<g clip-path="url(#a)" fill="#fff" >
<rect x="0" y="0" width="100%" height="100%" fill="#555" />
- <rect x="{{ $right_box_padding }}ex" y="0" height="100%" width="100%" fill="#{{ $status_color }}"/>
+ <rect x="{{ $right_box_padding }}ex" y="0" height="100%" width="100%" fill="{{ $status_color }}"/>
<rect x="0" y="0" width="100%" height="100%" fill="url(#b)"/>
<text x="{{ $left_text_padding }}ex" y="15" fill="#010101" fill-opacity=".3">{{ $shield_prefix }}</text>