blob: 79db5241561b1b86cbf50643dba777f5b7fb8e89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
{{ $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" }}
<a href="{{ .Permalink }}" class="issue no-underline">
{{ if .Params.informational }}
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}">
{{ if .Site.Params.dateFormat }}
{{ .Date.Format .Site.Params.dateFormat }}
{{ else }}
{{ .Date.Format "January 2, 2006 at 3:04 PM" }}
{{ end }}
</small>
<h3>
{{ .Title }} ℹ
</h3>
<span class="faded">{{ .Summary | truncate 200 }}
</span>
{{ else if .Params.Resolved }}
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}">
{{ if .Site.Params.dateFormat }}
{{ .Date.Format .Site.Params.dateFormat }}
{{ else }}
{{ .Date.Format "January 2, 2006 at 3:04 PM" }}
{{ end }}
</small>
<h3>
{{ .Title }}
</h3>
{{ $t := (time .Params.ResolvedWhen) }}
{{ $timeDiff := (sub $t.Unix .Date.Unix) }}
{{ $diffInMin := (div $timeDiff 60) }}
<!-- Marker -->
{{ if lt $timeDiff 60 }}
<div class="faded">
{{ T "resolved" }} {{ T "inUnderAMinute" }}
</div>
{{ else }}
{{ if gt $timeDiff 3600 }}
<div class="warning">
{{ T "resolvedAfter" }}
{{ $minutesForCalc := (mod $diffInMin 60) }}
{{ div (sub $diffInMin $minutesForCalc) 60 }}h
{{ $minutesForCalc }}m {{ T "ofDowntime" }}
</div>
{{ else }}
<div class="ok">
{{ T "resolvedAfter" }}
{{ $secsForCalc := (mod $timeDiff 60) }}
{{ div (sub $timeDiff $secsForCalc) 60 }}m
<!-- {{ $secsForCalc }}s --> {{ T "ofDowntime" }}
</div>
{{ end }}
{{ end }}
{{ else }}
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}">
{{ if .Site.Params.dateFormat }}
{{ .Date.Format .Site.Params.dateFormat }}
{{ else }}
{{ .Date.Format "January 2, 2006 at 3:04 PM" }}
{{ end }}
</small>
<h3>
{{ .Title }}
</h3>
<!-- Marker -->
{{ if eq .Params.severity "notice" }}
<strong class="warning">
◆
{{ T "downtimeOngoing" }}
</strong>
{{ else }}
<strong class="error">
{{ if eq .Params.severity "down" }}
■
{{ else if eq .Params.severity "disrupted" }}
▲
{{ else }}
◆
{{ end }}
{{ T "downtimeOngoing" }}
</strong>
{{ end }}
{{ end }}
</a>
|