-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.go
38 lines (37 loc) · 1.46 KB
/
template.go
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
package healthz
const tpl = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="10">
<title>Overall Health: {{.OverallHealth}}</title>
<link rel="stylesheet" href="min.css">
</head>
<body>
<div class="container">
<div class="overall hl{{.OverallHealthCode}}">
<h1>Overall: {{.OverallHealth}}</h1>
<p style="text-align: right"><a href="json">JSON</a>, <a href="liveness">Liveness</a>, <a href="readiness">Readiness</a></p>
</div>
<h3>Service: <span class="service">{{ .ServiceSignature }}</span></h3>
{{if .Root}}
<h3>Hostname: <span class="hostname">{{ .Hostname }}</span></h3>
<h3>Uptime: <span class="uptime">{{ .Uptime }}</span></h3>
{{ range .Root.Subcomponents }}<div class="row hl{{.OverallHealth}}">
<div class="col c4"><strong>{{ .Name }}</strong></div>
<div class="col c4">{{.OverallHealth|HealthTitle}}</div>
<div class="col c4">{{ .Severity|SeverityTitle }}</div>
{{ if .Subcomponents}}<div class="subcomponents">
{{ range .Subcomponents }}<div class="row hl{{.OverallHealth}}">
<div class="col c4"><strong>{{ .Name }}</strong></div>
<div class="col c4">{{.OverallHealth|HealthTitle}}</div>
<div class="col c4">{{ .Severity|SeverityTitle }}</div>
</div>{{ end }}
</div>{{ end }}
</div>{{ else }}
<div><strong>No components is registered, or showing details is disabled.</strong></div>
{{ end }}
{{ end }}
</body>
</html>`