| 1 |
{{define "head"}} |
| 2 |
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/css/alerts.css?v={{ buildVersion }}"> |
| 3 |
<script src="{{ pathPrefix }}/classic/static/js/alerts.js?v={{ buildVersion }}"></script> |
| 4 |
{{end}} |
| 5 |
|
| 6 |
{{define "content"}} |
| 7 |
<div class="container-fluid"> |
| 8 |
<h1>Alerts</h1> |
| 9 |
<div id="alertFilters" class="btn-group btn-group-toggle" data-toggle="buttons"> |
| 10 |
<label class="btn btn-primary active"> |
| 11 |
<input type="checkbox" name="alertFilters" id="inactiveAlerts" autocomplete="off"> <i class="glyphicon glyphicon-check"></i> Inactive ({{ .Counts.Inactive }}) |
| 12 |
</label> |
| 13 |
<label class="btn btn-primary active"> |
| 14 |
<input type="checkbox" name="alertFilters" id="pendingAlerts" autocomplete="off"> <i class="glyphicon glyphicon-check"></i> Pending ({{ .Counts.Pending }}) |
| 15 |
</label> |
| 16 |
<label class="btn btn-primary active"> |
| 17 |
<input type="checkbox" name="alertFilters" id="firingAlerts" autocomplete="off"> <i class="glyphicon glyphicon-check"></i> Firing ({{ .Counts.Firing }}) |
| 18 |
</label> |
| 19 |
</br> |
| 20 |
</div> |
| 21 |
<div class="show-annotations"> |
| 22 |
<i class="glyphicon glyphicon-unchecked"></i> |
| 23 |
<button type="button" class="show-annotations" title="show annotations">Show annotations</button> |
| 24 |
</div> |
| 25 |
<table id="alertsTable" class="table table-bordered table-collapsed"> |
| 26 |
<tbody> |
| 27 |
{{$alertStateToRowClass := .AlertStateToRowClass}} |
| 28 |
{{range .Groups}} |
| 29 |
<tr> |
| 30 |
<td style="padding: 2px"> |
| 31 |
{{.File}} > {{.Name}} |
| 32 |
</td> |
| 33 |
</tr> |
| 34 |
{{range .AlertingRules}} |
| 35 |
{{$activeAlerts := .ActiveAlerts}} |
| 36 |
<tr class="alert alert-{{index $alertStateToRowClass .State}} alert_header"> |
| 37 |
<td><i class="icon-chevron-down"></i> <b>{{.Name}}</b> ({{len $activeAlerts}} active)</td> |
| 38 |
</tr> |
| 39 |
<tr class="alert_details"> |
| 40 |
<td> |
| 41 |
<div> |
| 42 |
<pre style="display:block; padding:9.5px; font-size:13px; color:#333; word-break:break-all; background-color:#f5f5f5; border:1px solid #ccc; border-radius:4px;" ><code>{{.HTMLSnippet (print pathPrefix "/classic")}}</code></pre> |
| 43 |
</div> |
| 44 |
{{if $activeAlerts}} |
| 45 |
<table class="table table-bordered table-hover table-sm alert_elements_table"> |
| 46 |
<tr class=""> |
| 47 |
<th>Labels</th> |
| 48 |
<th>State</th> |
| 49 |
<th>Active Since</th> |
| 50 |
<th>Value</th> |
| 51 |
</tr> |
| 52 |
{{range $activeAlerts}} |
| 53 |
<tr> |
| 54 |
<td> |
| 55 |
{{range $label, $value := .Labels.Map}} |
| 56 |
<span class="badge badge-primary">{{$label}}="{{$value}}"</span> |
| 57 |
{{end}} |
| 58 |
</td> |
| 59 |
<td><span class="alert alert-{{ .State | alertStateToClass }} state_indicator text-uppercase">{{.State}}</span></td> |
| 60 |
<td>{{.ActiveAt.UTC}}</td> |
| 61 |
<td>{{.Value}}</td> |
| 62 |
</tr> |
| 63 |
{{ if .Annotations.Map}} |
| 64 |
<tr style="display:none" class="alert_annotations"> |
| 65 |
<th colspan="4">Annotations</th> |
| 66 |
</tr> |
| 67 |
<tr style="display:none" class="alert_annotations"> |
| 68 |
<td colspan="4"> |
| 69 |
<dl> |
| 70 |
{{range $label, $value := .Annotations.Map}} |
| 71 |
<dt>{{$label}}</dt> |
| 72 |
<dd>{{$value}}</dd> |
| 73 |
{{end}} |
| 74 |
</dl> |
| 75 |
</td> |
| 76 |
</tr> |
| 77 |
{{end}} |
| 78 |
{{end}} |
| 79 |
</table> |
| 80 |
{{end}} |
| 81 |
</td> |
| 82 |
</tr> |
| 83 |
{{end}} |
| 84 |
{{else}} |
| 85 |
<tr> |
| 86 |
<td> |
| 87 |
No alerting rules defined |
| 88 |
</td> |
| 89 |
</tr> |
| 90 |
{{end}} |
| 91 |
</tbody> |
| 92 |
</table> |
| 93 |
</div> |
| 94 |
{{end}} |