diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 28 | ||||
-rw-r--r-- | layouts/index.svg | 2 |
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> |