prometheus/web/ui/templates/alerts.html
James Turnbull d127a21071 Removed alert_header (#3836)
This is a very minor UX change. The current "No Alert rules" present
table row has the `alert_header` class attached. This changes the cursor
and some other stuff and makes sense with the populated table but less
sense with the unpopulated table. So removing it the latter case.
2018-02-14 13:15:39 +07:00

57 lines
1.8 KiB
HTML

{{define "head"}}
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/alerts.css?v={{ buildVersion }}">
<script src="{{ pathPrefix }}/static/js/alerts.js?v={{ buildVersion }}"></script>
{{end}}
{{define "content"}}
<div class="container-fluid">
<h2>Alerts</h2>
<table class="table table-bordered table-collapsed">
<tbody>
{{$alertStateToRowClass := .AlertStateToRowClass}}
{{range .AlertingRules}}
{{$activeAlerts := .ActiveAlerts}}
<tr class="{{index $alertStateToRowClass .State}} alert_header">
<td><i class="icon-chevron-down"></i> <b>{{.Name}}</b> ({{len $activeAlerts}} active)</td>
</tr>
<tr class="alert_details">
<td>
<div>
<pre><code>{{.HTMLSnippet pathPrefix}}</code></pre>
</div>
{{if $activeAlerts}}
<table class="table table-bordered table-hover table-condensed alert_elements_table">
<tr class="">
<th>Labels</th>
<th>State</th>
<th>Active Since</th>
<th>Value</th>
</tr>
{{range $activeAlerts}}
<tr>
<td>
{{range $label, $value := .Labels.Map}}
<span class="label label-primary">{{$label}}="{{$value}}"</span>
{{end}}
</td>
<td><span class="alert alert-{{ .State | alertStateToClass }} state_indicator text-uppercase">{{.State}}</span></td>
<td>{{.ActiveAt.UTC}}</td>
<td>{{.Value}}</td>
</tr>
{{end}}
</table>
{{end}}
</td>
</tr>
{{else}}
<tr>
<td>
No alerting rules defined
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{end}}