diff options
author | Mantas <11616378+mistermantas@users.noreply.github.com> | 2018-07-24 13:47:45 +0300 |
---|---|---|
committer | Mantas <11616378+mistermantas@users.noreply.github.com> | 2018-07-24 13:47:45 +0300 |
commit | 88a199b6c0576a35bae67a241c20370b629dd7cd (patch) | |
tree | cef7874e319d9084fff7316621148fb360f60212 /layouts/uptime/single.html | |
parent | 4c175215cf3ee423dd138ef57c06c3a550fa24ce (diff) |
v2-rc1
Diffstat (limited to 'layouts/uptime/single.html')
-rw-r--r-- | layouts/uptime/single.html | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/layouts/uptime/single.html b/layouts/uptime/single.html deleted file mode 100644 index cfad105..0000000 --- a/layouts/uptime/single.html +++ /dev/null @@ -1,86 +0,0 @@ -{{ partial "meta" . }} - -{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} -{{ $active := where $incidents "Params.resolved" "=" false }} - -{{ $isNotice := where $active "Params.severity" "=" "notice" }} -{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} -{{ $isDown := where $active "Params.severity" "=" "down" }} - - <body class="uptime status-{{ if $isDown }}down{{ else }}{{ if $isDisrupted}}disrupted{{ else }}{{ if $isNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }} {{ if not .Site.Params.alwaysKeepBrandColor }}change-header-color{{ end }}"> - {{ partial "header" . }} - - <div class="padding"></div> - - <div class="tabs"> - <div class="contain tabs--inner"> - <a href="/" class="tab tab--other"> - Incidents - </a> - <a href="/stats" class="tab tab--current"> - Uptime - </a> - </div> - </div> - - {{ if not $active }} - <div class="contain"> - <!-- still counting ALL the things --> - {{ $inactive := where $incidents "Params.resolved" "=" true }} - - {{ range $inactive }} - {{ $t := (time .Params.ResolvedWhen) }} - {{ $timeDiff := (sub $t.Unix .Date.Unix) }} - {{ $diffInMin := (div $timeDiff 60) }} - - {{ $.Scratch.Add "rackedUpDowntime" $timeDiff }} - {{ end }} - {{ $scratchValue := $.Scratch.Get "rackedUpDowntime" }} - <noscript> - <div class="stat"> - {{ if gt $scratchValue 3600 }} - {{ $minutesForCalc := (mod (div $scratchValue 60) 60) }} - - {{ div (sub (div $scratchValue 60) $minutesForCalc) 60 }}h - {{ $minutesForCalc }}m - {{ else }} - {{ $secsForCalc := (mod $scratchValue 60) }} - - {{ div (sub $scratchValue $secsForCalc) 60 }}m - {{ $secsForCalc }}s - {{ end }} of downtime so far - <hr> - </div> - </noscript> - <script> - function roundUp(rnum, rlength) { - var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength); - return newnumber; - } - - var x = ( ((2419200 - {{ $scratchValue }}) / 2419200) * 100 ); - - document.write( - '<div class="stat">' + roundUp(x, 2) + '% uptime' + '<hr></div>'; - ); - - /* - 7 week - 604800 - 30 days - 2419200 - 60 days - 4838400 - 90 days - 7257600 - */ - </script> - <p> - There have been {{ len $incidents }} incidents in total so far. - In total, this added up to {{ $scratchValue }}s (or {{ div $scratchValue 60 }} min) of downtime. Please note that the uptime statistics only counts resolved incidents, ongoing incidents are not included in these calculations. - </p> - </div> - {{ else }} - <div class="contain"> - <p>Uptime stats are not available during an outage. Sorry!</p> - </div> - {{ end }} - -{{ partial "js" . }} -{{ partial "footer" . }} |