2021-09-07 21:39:22 +02:00
|
|
|
// Code generated by qtc from "web.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line app/vmalert/web.qtpl:1
|
|
|
|
package main
|
|
|
|
|
|
|
|
//line app/vmalert/web.qtpl:3
|
|
|
|
import (
|
|
|
|
"sort"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/tpl"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmalert/web.qtpl:11
|
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmalert/web.qtpl:11
|
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:11
|
|
|
|
func StreamWelcome(qw422016 *qt422016.Writer) {
|
|
|
|
//line app/vmalert/web.qtpl:11
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:12
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamHeader(qw422016, "vmalert", navItems)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:12
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<p>
|
|
|
|
API:<br>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:15
|
|
|
|
for _, p := range apiLinks {
|
|
|
|
//line app/vmalert/web.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:17
|
2021-09-07 21:39:22 +02:00
|
|
|
p, doc := p[0], p[1]
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:18
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<a href="`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(p)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(p)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</a> - `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(doc)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`<br/>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</p>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:22
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamFooter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:22
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
|
|
|
func WriteWelcome(qq422016 qtio422016.Writer) {
|
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
|
|
|
StreamWelcome(qw422016)
|
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
|
|
|
func Welcome() string {
|
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
|
|
|
WriteWelcome(qb422016)
|
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
return qs422016
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:23
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:25
|
2021-09-07 21:39:22 +02:00
|
|
|
func StreamListGroups(qw422016 *qt422016.Writer, groups []APIGroup) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:25
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:26
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamHeader(qw422016, "Groups", navItems)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:26
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:27
|
2021-09-07 21:39:22 +02:00
|
|
|
if len(groups) > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:27
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:29
|
2021-09-07 21:39:22 +02:00
|
|
|
rOk := make(map[string]int)
|
|
|
|
rNotOk := make(map[string]int)
|
|
|
|
for _, g := range groups {
|
|
|
|
for _, r := range g.AlertingRules {
|
|
|
|
if r.LastError != "" {
|
|
|
|
rNotOk[g.Name]++
|
|
|
|
} else {
|
|
|
|
rOk[g.Name]++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, r := range g.RecordingRules {
|
|
|
|
if r.LastError != "" {
|
|
|
|
rNotOk[g.Name]++
|
|
|
|
} else {
|
|
|
|
rOk[g.Name]++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:47
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a>
|
|
|
|
<a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:50
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, g := range groups {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:50
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="group-heading`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
if rNotOk[g.Name] > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` alert-danger`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`" data-bs-target="rules-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:51
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<span class="anchor" id="group-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:52
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:52
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`"></span>
|
|
|
|
<a href="#group-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
if g.Type != "prometheus" {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` (`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.Type)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`)`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` (every `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.Interval)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`)</a>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
if rNotOk[g.Name] > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`<span class="badge bg-danger" title="Number of rules withs status Error">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(rNotOk[g.Name])
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span> `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="badge bg-success" title="Number of rules withs status Ok">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(rOk[g.Name])
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
<p class="fs-6 fw-lighter">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.File)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</p>
|
2021-09-13 13:11:38 +02:00
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:57
|
2021-09-13 13:11:38 +02:00
|
|
|
if len(g.ExtraFilterLabels) > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:57
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="fs-6 fw-lighter">Extra filter labels
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:59
|
2021-09-13 13:11:38 +02:00
|
|
|
for k, v := range g.ExtraFilterLabels {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:59
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="float-left badge bg-primary">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:60
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:60
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`=`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:60
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.E().S(v)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:60
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:61
|
2021-09-13 13:11:38 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:61
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:63
|
2021-09-13 13:11:38 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:63
|
2021-09-13 13:11:38 +02:00
|
|
|
qw422016.N().S(`
|
2021-09-07 21:39:22 +02:00
|
|
|
</div>
|
|
|
|
<div class="collapse" id="rules-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:65
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:65
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<table class="table table-striped table-hover table-sm">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">Rule</th>
|
|
|
|
<th scope="col" title="Shows if rule's execution ended with error">Error</th>
|
|
|
|
<th scope="col" title="How many samples were produced by the rule">Samples</th>
|
|
|
|
<th scope="col" title="How many seconds ago rule was executed">Updated</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:76
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, ar := range g.AlertingRules {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:76
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:77
|
2021-09-07 21:39:22 +02:00
|
|
|
if ar.LastError != "" {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:77
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` class="alert-danger"`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:77
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:77
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`>
|
|
|
|
<td>
|
|
|
|
<b>alert:</b> `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:79
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:79
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` (for: `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:79
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().V(ar.For)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:79
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`)<br>
|
|
|
|
<code><pre>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:80
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.Expression)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:80
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</pre></code><br>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:81
|
2021-09-07 21:39:22 +02:00
|
|
|
if len(ar.Labels) > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:81
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` <b>Labels:</b>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:81
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:81
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:82
|
2021-09-07 21:39:22 +02:00
|
|
|
for k, v := range ar.Labels {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:82
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:83
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:83
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`=`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:83
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(v)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:83
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:84
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:84
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
|
|
|
<td><div class="error-cell">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:86
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.LastError)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:86
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</div></td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:87
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(ar.LastSamples)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:87
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:88
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().FPrec(time.Since(ar.LastExec).Seconds(), 3)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:88
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`s ago</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:91
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, rr := range g.RecordingRules {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:91
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<b>record:</b> `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:94
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(rr.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:94
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`<br>
|
|
|
|
<code><pre>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:95
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(rr.Expression)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:95
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</pre></code>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:96
|
2021-09-07 21:39:22 +02:00
|
|
|
if len(rr.Labels) > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:96
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` <b>Labels:</b>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:96
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:96
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:97
|
2021-09-07 21:39:22 +02:00
|
|
|
for k, v := range rr.Labels {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:97
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:98
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:98
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`=`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:98
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(v)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:98
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:99
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:99
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
|
|
|
<td><div class="error-cell">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:101
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(rr.LastError)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:101
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</div></td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(rr.LastSamples)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:103
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().FPrec(time.Since(rr.LastExec).Seconds(), 3)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:103
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`s ago</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:105
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:105
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:109
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:109
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
} else {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div>
|
|
|
|
<p>No items...</p>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:115
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:115
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:117
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamFooter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:117
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
func WriteListGroups(qq422016 qtio422016.Writer, groups []APIGroup) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
StreamListGroups(qw422016, groups)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
func ListGroups(groups []APIGroup) string {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
WriteListGroups(qb422016, groups)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
return qs422016
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:119
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:122
|
2021-09-07 21:39:22 +02:00
|
|
|
func StreamListAlerts(qw422016 *qt422016.Writer, groupAlerts []GroupAlerts) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:122
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:123
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamHeader(qw422016, "Alerts", navItems)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:123
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:124
|
2021-09-07 21:39:22 +02:00
|
|
|
if len(groupAlerts) > 0 {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:124
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a>
|
|
|
|
<a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:127
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, ga := range groupAlerts {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:127
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:128
|
2021-09-07 21:39:22 +02:00
|
|
|
g := ga.Group
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:128
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="group-heading alert-danger" data-bs-target="rules-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:129
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:129
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<span class="anchor" id="group-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:130
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:130
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`"></span>
|
|
|
|
<a href="#group-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
if g.Type != "prometheus" {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` (`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.Type)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`)`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:131
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
<span class="badge bg-danger" title="Number of active alerts">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(len(ga.Alerts))
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
<br>
|
|
|
|
<p class="fs-6 fw-lighter">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:134
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.File)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:134
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:137
|
2021-09-07 21:39:22 +02:00
|
|
|
var keys []string
|
|
|
|
alertsByRule := make(map[string][]*APIAlert)
|
|
|
|
for _, alert := range ga.Alerts {
|
|
|
|
if len(alertsByRule[alert.RuleID]) < 1 {
|
|
|
|
keys = append(keys, alert.RuleID)
|
|
|
|
}
|
|
|
|
alertsByRule[alert.RuleID] = append(alertsByRule[alert.RuleID], alert)
|
|
|
|
}
|
|
|
|
sort.Strings(keys)
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:146
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="collapse" id="rules-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:147
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:147
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:148
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, ruleID := range keys {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:148
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:150
|
2021-09-07 21:39:22 +02:00
|
|
|
defaultAR := alertsByRule[ruleID][0]
|
|
|
|
var labelKeys []string
|
|
|
|
for k := range defaultAR.Labels {
|
|
|
|
labelKeys = append(labelKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(labelKeys)
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:156
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<br>
|
|
|
|
<b>alert:</b> `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:158
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(defaultAR.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:158
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` (`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:158
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().D(len(alertsByRule[ruleID]))
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:158
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`)<br>
|
|
|
|
<b>expr:</b><code><pre>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:159
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(defaultAR.Expression)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:159
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</pre></code>
|
|
|
|
<table class="table table-striped table-hover table-sm">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">Labels</th>
|
|
|
|
<th scope="col">State</th>
|
|
|
|
<th scope="col">Active at</th>
|
|
|
|
<th scope="col">Value</th>
|
|
|
|
<th scope="col">Link</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:171
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, ar := range alertsByRule[ruleID] {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:171
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:174
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, k := range labelKeys {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:174
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`=`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.Labels[k])
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:176
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:176
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
|
|
|
<td><span class="badge `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
if ar.State == "firing" {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`bg-danger`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
} else {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` bg-warning text-dark`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.State)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:178
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span></td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:179
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:179
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:180
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.Value)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:180
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td>
|
|
|
|
<a href="/`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:182
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(g.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:182
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`/`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:182
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(ar.ID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:182
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`/status">Details</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:185
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:185
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:188
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:188
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:193
|
2021-09-07 21:39:22 +02:00
|
|
|
} else {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:193
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div>
|
|
|
|
<p>No items...</p>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:199
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamFooter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:199
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
func WriteListAlerts(qq422016 qtio422016.Writer, groupAlerts []GroupAlerts) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
StreamListAlerts(qw422016, groupAlerts)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
func ListAlerts(groupAlerts []GroupAlerts) string {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
WriteListAlerts(qb422016, groupAlerts)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
return qs422016
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:203
|
2021-09-07 21:39:22 +02:00
|
|
|
func StreamAlert(qw422016 *qt422016.Writer, alert *APIAlert) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:203
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:204
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamHeader(qw422016, "", navItems)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:204
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:206
|
2021-09-07 21:39:22 +02:00
|
|
|
var labelKeys []string
|
|
|
|
for k := range alert.Labels {
|
|
|
|
labelKeys = append(labelKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(labelKeys)
|
|
|
|
|
|
|
|
var annotationKeys []string
|
|
|
|
for k := range alert.Annotations {
|
|
|
|
annotationKeys = append(annotationKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(annotationKeys)
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:217
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="display-6 pb-3 mb-3">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.Name)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
if alert.State == "firing" {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`bg-danger`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
} else {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` bg-warning text-dark`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.State)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span></div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Active at
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:225
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:225
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Expr
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<code><pre>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:235
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.Expression)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:235
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</pre></code>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Labels
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:245
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, k := range labelKeys {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:245
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="m-1 badge bg-primary">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:246
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:246
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`=`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:246
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.Labels[k])
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:246
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:247
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:247
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Annotations
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2021-09-07 21:39:22 +02:00
|
|
|
for _, k := range annotationKeys {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<b>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:258
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(k)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:258
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`:</b><br>
|
|
|
|
<p>`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:259
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.Annotations[k])
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:259
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:260
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:260
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Group
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<a target="_blank" href="/groups#group-`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:270
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.GroupID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:270
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`">`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:270
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(alert.GroupID)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:270
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:274
|
2021-09-07 21:39:22 +02:00
|
|
|
tpl.StreamFooter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:274
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
func WriteAlert(qq422016 qtio422016.Writer, alert *APIAlert) {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
StreamAlert(qw422016, alert)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
func Alert(alert *APIAlert) string {
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
WriteAlert(qb422016, alert)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
return qs422016
|
2021-09-21 13:41:01 +02:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|