| 1 |
{{define "head"}} |
| 2 |
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/css/rules.css?v={{ buildVersion }}"> |
| 3 |
{{end}} |
| 4 |
|
| 5 |
{{define "content"}} |
| 6 |
<div class="container-fluid"> |
| 7 |
<h2>Rules</h2> |
| 8 |
<table class="table table-bordered"> |
| 9 |
{{range .RuleGroups}} |
| 10 |
<thead> |
| 11 |
<tr> |
| 12 |
<td colspan="3"><h2><a href="#{{reReplaceAll "([^a-zA-Z0-9])" "$1" .Name}}" id="{{reReplaceAll "([^a-zA-Z0-9])" "$1" .Name}}">{{.Name}}</a></h2></td> |
| 13 |
<td><h2>{{if .GetLastEvaluation.IsZero}}Never{{else}}{{since .GetLastEvaluation}} ago{{end}}</h2></td> |
| 14 |
<td><h2>{{humanizeDuration .GetEvaluationTime.Seconds}}</h2></td> |
| 15 |
</tr> |
| 16 |
</thead> |
| 17 |
<tbody> |
| 18 |
<tr> |
| 19 |
<td style="font-weight:bold">Rule</td> |
| 20 |
<td style="font-weight:bold">State</td> |
| 21 |
<td style="font-weight:bold">Error</td> |
| 22 |
<td style="font-weight:bold">Last Evaluation</td> |
| 23 |
<td style="font-weight:bold">Evaluation Time</td> |
| 24 |
</tr> |
| 25 |
{{range .Rules}} |
| 26 |
<tr> |
| 27 |
<td class="rule_cell">{{.HTMLSnippet (print pathPrefix "/classic")}}</td> |
| 28 |
<td class="state"> |
| 29 |
<span class="alert alert-{{ .Health | ruleHealthToClass }} state_indicator text-uppercase"> |
| 30 |
{{.Health}} |
| 31 |
</span> |
| 32 |
</td> |
| 33 |
<td class="errors"> |
| 34 |
{{if .LastError}} |
| 35 |
<span class="alert alert-danger state_indicator">{{.LastError}}</span> |
| 36 |
{{end}} |
| 37 |
</td> |
| 38 |
<td> |
| 39 |
{{if .GetEvaluationTimestamp.IsZero}}Never{{else}}{{since .GetEvaluationTimestamp}} ago{{end}} |
| 40 |
</td> |
| 41 |
<td>{{humanizeDuration .GetEvaluationDuration.Seconds}}</td> |
| 42 |
</tr> |
| 43 |
{{end}} |
| 44 |
{{else}} |
| 45 |
<tr> |
| 46 |
<td> |
| 47 |
No rules defined |
| 48 |
</td> |
| 49 |
</tr> |
| 50 |
{{end}} |
| 51 |
</tbody> |
| 52 |
</table> |
| 53 |
</div> |
| 54 |
{{end}} |