forked from ccnmtl/hound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalert.html
91 lines (79 loc) · 3.48 KB
/
alert.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hound</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb"
crossorigin="anonymous">
<style type="text/css">
tr.OK th { background-color: #ccffcc; }
tr.Failed th { background-color: #ffcccc; }
tr.Error th { background-color: #ffddcc; }
th { vertical-align: top; white-space:nowrap;}
a.box {
display: block;
float: left;
width: 10px;
height: 10px;
margin: 1px;
border: 1px solid black;
}
a.OK { background-color: #0f0;}
a.Failed { background-color: #f00;}
a.Error { background-color: #f60;}
</style>
</head>
<body>
<div class="container">
{{ with $element := .Alert }}
<h1><a href="/">Hound</a>:
{{if eq $element.Icon "info"}}
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 8 8">
<path d="M3 0c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-1.5 2.5c-.83 0-1.5.67-1.5 1.5h1c0-.28.22-.5.5-.5s.5.22.5.5-1 1.64-1 2.5c0 .86.67 1.5 1.5 1.5s1.5-.67 1.5-1.5h-1c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-.36 1-1.84 1-2.5 0-.81-.67-1.5-1.5-1.5z" transform="translate(2)"
/>
</svg>
{{end}}
{{if eq $element.Icon "warning"}}
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 8 8">
<path d="M3.09 0c-.06 0-.1.04-.13.09l-2.94 6.81c-.02.05-.03.13-.03.19v.81c0 .05.04.09.09.09h6.81c.05 0 .09-.04.09-.09v-.81c0-.05-.01-.14-.03-.19l-2.94-6.81c-.02-.05-.07-.09-.13-.09h-.81zm-.09 3h1v2h-1v-2zm0 3h1v1h-1v-1z" />
</svg>
{{end}}
{{$element.Name}}
</h1>
<table class="table">
<tr class="{{$element.BootstrapStatus}}">
<th>
{{if eq $element.Icon "info"}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 8 8">
<path d="M3 0c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-1.5 2.5c-.83 0-1.5.67-1.5 1.5h1c0-.28.22-.5.5-.5s.5.22.5.5-1 1.64-1 2.5c0 .86.67 1.5 1.5 1.5s1.5-.67 1.5-1.5h-1c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-.36 1-1.84 1-2.5 0-.81-.67-1.5-1.5-1.5z" transform="translate(2)"
/>
</svg>
{{end}}
{{if eq $element.Icon "warning"}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 8 8">
<path d="M3.09 0c-.06 0-.1.04-.13.09l-2.94 6.81c-.02.05-.03.13-.03.19v.81c0 .05.04.09.09.09h6.81c.05 0 .09-.04.09-.09v-.81c0-.05-.01-.14-.03-.19l-2.94-6.81c-.02-.05-.07-.09-.13-.09h-.81zm-.09 3h1v2h-1v-2zm0 3h1v1h-1v-1z" />
</svg>
{{end}}
{{$element.Name}}
<br />
{{$element.Value}} {{$element.RenderDirection}} {{$element.Threshold}}
</th>
<td>
<h2>Daily Graph</h2>
<img src="{{$element.DailyGraphURL}}" width="800" height="150" />
<h2>Weekly Graph</h2>
<img src="{{$element.WeeklyGraphURL}}" width="800" height="75" />
</td></tr>
{{ if $element.RunBookLink }}
<tr>
<td><h2>Runbook link:</h2></td>
<td><a href="{{ $element.RunBookLink }}">{{ $element.RunBookLink }}</a></td>
</tr>
{{ end }}
</table>
{{ end }}
</div><!-- end .container -->
</body>
</html>