blob: 531b47b6386c7fe314ff69920d33822ac9136ae8 (
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
103
|
{{ $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 "Jan 2 15:04:05 2006 UTC" }}">
{{ 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 "Jan 2 15:04:05 2006" }}">
{{ 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 }}
<!-- If not resolved -->
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}">
{{ 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>
|