prometheus/web/blob/templates/alerts.html
Julius Volz d868264bb8 Improve UI of /alerts page.
Changes to the UI:
- "Active Since" timestamps are now human-readable.
- Alerting rules are now pretty-printed better.
- Labels are no longer just strings, but alert bubbles (like we do on
  the status page for base labels).
- Alert states and target health states are now capitalized in the
  presentation layer rather than at the source.
2015-06-23 18:48:45 +02:00

54 lines
1.8 KiB
HTML

{{define "head"}}
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/alerts.css">
<script src="{{ pathPrefix }}/static/js/alerts.js"></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>
<a href="#" class="silence_children_link">Silence all instances of this alert&hellip;</a>
</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>
<th>Silence</th>
</tr>
{{range $activeAlerts}}
<tr>
<td>
{{range $label, $value := .Labels}}
<span class="label label-primary">{{$label}}="{{$value}}"</span>
{{end}}
</td>
<td><span class="alert alert-{{ .State | alertStateToClass }} state_indicator">{{.State}}</span></td>
<td>{{.ActiveSince.Time}}</td>
<td>{{.Value}}</td>
<td><a href="#" class="silence_alert_link">Silence&hellip;</a></td>
</tr>
{{end}}
</table>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{end}}