mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 01:24:04 -08:00
816d755956
When you have no alerting rules defined you get a screen sharing this information in the WebUI. If no rules are defined then you instead see an empty white screen. This adds a "No rules" defined `else` clause and a `Rules` header to the page.
38 lines
989 B
HTML
38 lines
989 B
HTML
{{define "head"}}
|
|
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/rules.css?v={{ buildVersion }}">
|
|
{{end}}
|
|
|
|
{{define "content"}}
|
|
<div class="container-fluid">
|
|
<h2>Rules</h2>
|
|
<table class="table table-bordered">
|
|
{{range .RuleGroups}}
|
|
<thead>
|
|
<tr>
|
|
<td><h2>{{.Name}}</h2></td>
|
|
<td><h2>{{humanizeDuration .GetEvaluationTime.Seconds}}</h2></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="font-weight:bold">Rule</td>
|
|
<td style="font-weight:bold">Evaluation Time</td>
|
|
</tr>
|
|
{{range .Rules}}
|
|
<tr>
|
|
<td class="rule_cell">{{.HTMLSnippet pathPrefix}}</td>
|
|
<td>{{humanizeDuration .GetEvaluationTime.Seconds}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr>
|
|
<td>
|
|
No rules defined
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|