2021-09-07 19:39:22 +00:00
|
|
|
// Code generated by qtc from "web.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
2022-05-04 17:26:38 +00:00
|
|
|
//line app/vmalert/web.qtpl:1
|
2021-09-07 19:39:22 +00:00
|
|
|
package main
|
|
|
|
|
2022-05-04 17:26:38 +00:00
|
|
|
//line app/vmalert/web.qtpl:3
|
2021-09-07 19:39:22 +00:00
|
|
|
import (
|
2022-07-06 08:46:01 +00:00
|
|
|
"net/http"
|
2021-09-07 19:39:22 +00:00
|
|
|
"sort"
|
|
|
|
"time"
|
|
|
|
|
2022-02-02 12:11:41 +00:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/notifier"
|
2021-09-07 19:39:22 +00:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/tpl"
|
2022-07-08 08:26:13 +00:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
2021-09-07 19:39:22 +00:00
|
|
|
)
|
|
|
|
|
2022-07-06 08:46:01 +00:00
|
|
|
//line app/vmalert/web.qtpl:14
|
2021-09-07 19:39:22 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-07-06 08:46:01 +00:00
|
|
|
//line app/vmalert/web.qtpl:14
|
2021-09-07 19:39:22 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-05-04 17:26:38 +00:00
|
|
|
//line app/vmalert/web.qtpl:14
|
2022-07-06 08:46:01 +00:00
|
|
|
func StreamWelcome(qw422016 *qt422016.Writer, r *http.Request) {
|
2022-05-04 17:26:38 +00:00
|
|
|
//line app/vmalert/web.qtpl:14
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-07-06 08:46:01 +00:00
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:15
|
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "vmalert")
|
|
|
|
//line app/vmalert/web.qtpl:15
|
|
|
|
qw422016.N().S(`
|
2021-09-07 19:39:22 +00:00
|
|
|
<p>
|
|
|
|
API:<br>
|
|
|
|
`)
|
2022-07-06 08:46:01 +00:00
|
|
|
//line app/vmalert/web.qtpl:18
|
2021-09-21 11:41:01 +00:00
|
|
|
for _, p := range apiLinks {
|
2022-07-06 08:46:01 +00:00
|
|
|
//line app/vmalert/web.qtpl:18
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 19:39:22 +00:00
|
|
|
p, doc := p[0], p[1]
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:19
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-12-09 19:43:54 +00:00
|
|
|
<a href="`)
|
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(p)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(p)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</a> - `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(doc)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:20
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`<br/>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:21
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:21
|
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:22
|
|
|
|
if r.Header.Get("X-Forwarded-For") == "" {
|
|
|
|
//line app/vmalert/web.qtpl:22
|
|
|
|
qw422016.N().S(`
|
|
|
|
System:<br>
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:24
|
|
|
|
for _, p := range systemLinks {
|
|
|
|
//line app/vmalert/web.qtpl:24
|
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:25
|
|
|
|
p, doc := p[0], p[1]
|
|
|
|
|
|
|
|
//line app/vmalert/web.qtpl:25
|
|
|
|
qw422016.N().S(`
|
|
|
|
<a href="`)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.E().S(p)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.N().S(`">`)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.E().S(p)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.N().S(`</a> - `)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.E().S(doc)
|
|
|
|
//line app/vmalert/web.qtpl:26
|
|
|
|
qw422016.N().S(`<br/>
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:27
|
|
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:27
|
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:28
|
|
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:28
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</p>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:30
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:30
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2022-07-06 08:46:01 +00:00
|
|
|
func WriteWelcome(qq422016 qtio422016.Writer, r *http.Request) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2022-07-06 08:46:01 +00:00
|
|
|
StreamWelcome(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2022-07-06 08:46:01 +00:00
|
|
|
func Welcome(r *http.Request) string {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2022-07-06 08:46:01 +00:00
|
|
|
WriteWelcome(qb422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
return qs422016
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:31
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:33
|
2022-07-06 08:46:01 +00:00
|
|
|
func StreamListGroups(qw422016 *qt422016.Writer, r *http.Request, groups []APIGroup) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:33
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:34
|
2022-09-14 12:04:24 +00:00
|
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:34
|
2022-07-06 08:46:01 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:35
|
2022-09-14 12:04:24 +00:00
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "Groups")
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:35
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:36
|
2022-09-14 12:04:24 +00:00
|
|
|
if len(groups) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:36
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:38
|
2021-09-07 19:39:22 +00:00
|
|
|
rOk := make(map[string]int)
|
|
|
|
rNotOk := make(map[string]int)
|
|
|
|
for _, g := range groups {
|
2022-03-15 11:54:53 +00:00
|
|
|
for _, r := range g.Rules {
|
2021-09-07 19:39:22 +00:00
|
|
|
if r.LastError != "" {
|
2023-02-08 13:34:03 +00:00
|
|
|
rNotOk[g.ID]++
|
2021-09-07 19:39:22 +00:00
|
|
|
} else {
|
2023-02-08 13:34:03 +00:00
|
|
|
rOk[g.ID]++
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:49
|
2021-09-07 19:39:22 +00: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>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:52
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, g := range groups {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:52
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="group-heading`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2023-02-08 13:34:03 +00:00
|
|
|
if rNotOk[g.ID] > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` alert-danger`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`" data-bs-target="rules-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:53
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<span class="anchor" id="group-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:54
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`"></span>
|
|
|
|
<a href="#group-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
if g.Type != "prometheus" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` (`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.Type)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`)`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` (every `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.N().FPrec(g.Interval, 0)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:55
|
2023-03-27 22:11:40 +00:00
|
|
|
qw422016.N().S(`s) #</a>
|
2021-09-07 19:39:22 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2023-02-08 13:34:03 +00:00
|
|
|
if rNotOk[g.ID] > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`<span class="badge bg-danger" title="Number of rules with status Error">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2023-02-08 13:34:03 +00:00
|
|
|
qw422016.N().D(rNotOk[g.ID])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span> `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:56
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="badge bg-success" title="Number of rules withs status Ok">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:57
|
2023-02-08 13:34:03 +00:00
|
|
|
qw422016.N().D(rOk[g.ID])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:57
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
<p class="fs-6 fw-lighter">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:58
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.File)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:58
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</p>
|
2021-09-13 11:11:38 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:59
|
2021-12-02 12:45:08 +00:00
|
|
|
if len(g.Params) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:59
|
2021-09-13 11:11:38 +00:00
|
|
|
qw422016.N().S(`
|
2021-12-02 12:45:08 +00:00
|
|
|
<div class="fs-6 fw-lighter">Extra params
|
2021-09-13 11:11:38 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:61
|
2021-12-02 12:45:08 +00:00
|
|
|
for _, param := range g.Params {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:61
|
2021-09-13 11:11:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="float-left badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:62
|
2021-12-02 12:45:08 +00:00
|
|
|
qw422016.E().S(param)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:62
|
2021-09-13 11:11:38 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:63
|
2021-09-13 11:11:38 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:63
|
2021-09-13 11:11:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:65
|
2021-09-13 11:11:38 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:65
|
2021-09-13 11:11:38 +00:00
|
|
|
qw422016.N().S(`
|
2022-07-21 13:59:55 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:66
|
2022-07-21 13:59:55 +00:00
|
|
|
if len(g.Headers) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:66
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="fs-6 fw-lighter">Extra headers
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:68
|
2022-07-21 13:59:55 +00:00
|
|
|
for _, header := range g.Headers {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:68
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="float-left badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:69
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.E().S(header)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:69
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:70
|
2022-07-21 13:59:55 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:70
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:72
|
2022-07-21 13:59:55 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:72
|
2022-07-21 13:59:55 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-07 19:39:22 +00:00
|
|
|
</div>
|
|
|
|
<div class="collapse" id="rules-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:74
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:74
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<table class="table table-striped table-hover table-sm">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-05-04 16:02:18 +00:00
|
|
|
<th scope="col" style="width: 60%">Rule</th>
|
|
|
|
<th scope="col" style="width: 20%" class="text-center" title="How many samples were produced by the rule">Samples</th>
|
|
|
|
<th scope="col" style="width: 20%" class="text-center" title="How many seconds ago rule was executed">Updated</th>
|
2021-09-07 19:39:22 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:84
|
2022-03-15 11:54:53 +00:00
|
|
|
for _, r := range g.Rules {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:84
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:85
|
2022-03-15 11:54:53 +00:00
|
|
|
if r.LastError != "" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:85
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` class="alert-danger"`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:85
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:85
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`>
|
|
|
|
<td>
|
2022-05-04 16:02:18 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12 mb-2">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:89
|
2022-03-15 11:54:53 +00:00
|
|
|
if r.Type == "alerting" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:89
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
<b>alert:</b> `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.E().S(r.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(` (for: `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.E().V(r.Duration)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:90
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(` seconds)
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:91
|
2022-03-15 11:54:53 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:91
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
<b>record:</b> `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:92
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.E().S(r.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:92
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:93
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:93
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
| <span><a target="_blank" href="`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:94
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(prefix + r.WebLink())
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:94
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`">Details</a></span>
|
2022-05-04 16:02:18 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-12">
|
|
|
|
<code><pre>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:97
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.E().S(r.Query)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:97
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(`</pre></code>
|
|
|
|
</div>
|
|
|
|
<div class="col-12 mb-2">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:100
|
2022-03-15 11:54:53 +00:00
|
|
|
if len(r.Labels) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:100
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` <b>Labels:</b>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:100
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:100
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:101
|
2022-03-15 11:54:53 +00:00
|
|
|
for k, v := range r.Labels {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:101
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(v)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:102
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span>
|
2022-05-04 16:02:18 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:103
|
2022-05-04 16:02:18 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:103
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:105
|
2022-05-04 16:02:18 +00:00
|
|
|
if r.LastError != "" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:105
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="col-12">
|
|
|
|
<b>Error:</b>
|
|
|
|
<div class="error-cell">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:109
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.E().S(r.LastError)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:109
|
2022-05-04 16:02:18 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:112
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:112
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-05-04 16:02:18 +00:00
|
|
|
</div>
|
2021-09-07 19:39:22 +00:00
|
|
|
</td>
|
2022-05-04 16:02:18 +00:00
|
|
|
<td class="text-center">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:115
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.N().D(r.LastSamples)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:115
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</td>
|
2022-05-04 16:02:18 +00:00
|
|
|
<td class="text-center">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:116
|
2022-03-15 11:54:53 +00:00
|
|
|
qw422016.N().FPrec(time.Since(r.LastEvaluation).Seconds(), 3)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:116
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`s ago</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:118
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:118
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:122
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:122
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:124
|
2021-09-07 19:39:22 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:124
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div>
|
2022-09-14 12:04:24 +00:00
|
|
|
<p>No groups...</p>
|
2021-09-07 19:39:22 +00:00
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:128
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:128
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:130
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:130
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2022-07-06 08:46:01 +00:00
|
|
|
func WriteListGroups(qq422016 qtio422016.Writer, r *http.Request, groups []APIGroup) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2022-07-06 08:46:01 +00:00
|
|
|
StreamListGroups(qw422016, r, groups)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2022-07-06 08:46:01 +00:00
|
|
|
func ListGroups(r *http.Request, groups []APIGroup) string {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2022-07-06 08:46:01 +00:00
|
|
|
WriteListGroups(qb422016, r, groups)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
return qs422016
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:132
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:135
|
2022-07-06 08:46:01 +00:00
|
|
|
func StreamListAlerts(qw422016 *qt422016.Writer, r *http.Request, groupAlerts []GroupAlerts) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:135
|
2022-02-08 19:03:42 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:136
|
2022-07-08 08:26:13 +00:00
|
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:136
|
2022-07-06 08:46:01 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:137
|
2022-07-08 08:26:13 +00:00
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "Alerts")
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:137
|
2022-07-08 08:26:13 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:138
|
2022-07-08 08:26:13 +00:00
|
|
|
if len(groupAlerts) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:138
|
2021-09-07 19:39:22 +00: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>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:141
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, ga := range groupAlerts {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:141
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:142
|
2021-09-07 19:39:22 +00:00
|
|
|
g := ga.Group
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:142
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="group-heading alert-danger" data-bs-target="rules-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:143
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:143
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<span class="anchor" id="group-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:144
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:144
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`"></span>
|
|
|
|
<a href="#group-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
if g.Type != "prometheus" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` (`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.Type)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`)`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:145
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
<span class="badge bg-danger" title="Number of active alerts">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:146
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().D(len(ga.Alerts))
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:146
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
<br>
|
|
|
|
<p class="fs-6 fw-lighter">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:148
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.File)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:148
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:151
|
2021-09-07 19:39:22 +00: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)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:160
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="collapse" id="rules-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:161
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(g.ID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:161
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:162
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, ruleID := range keys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:162
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:164
|
2021-09-07 19:39:22 +00:00
|
|
|
defaultAR := alertsByRule[ruleID][0]
|
|
|
|
var labelKeys []string
|
|
|
|
for k := range defaultAR.Labels {
|
|
|
|
labelKeys = append(labelKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(labelKeys)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:170
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<br>
|
|
|
|
<b>alert:</b> `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:172
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(defaultAR.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:172
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` (`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:172
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().D(len(alertsByRule[ruleID]))
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:172
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.N().S(`)
|
|
|
|
| <span><a target="_blank" href="`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:173
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.E().S(defaultAR.SourceLink)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:173
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.N().S(`">Source</a></span>
|
|
|
|
<br>
|
|
|
|
<b>expr:</b><code><pre>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.E().S(defaultAR.Expression)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:175
|
2021-09-07 19:39:22 +00: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>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:187
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, ar := range alertsByRule[ruleID] {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:187
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:190
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, k := range labelKeys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:190
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(ar.Labels[k])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:191
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:192
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:192
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
2021-10-22 09:30:38 +00:00
|
|
|
<td>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:194
|
2021-10-22 09:30:38 +00:00
|
|
|
streambadgeState(qw422016, ar.State)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:194
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</td>
|
2021-10-22 09:30:38 +00:00
|
|
|
<td>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:196
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:196
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-10-22 09:30:38 +00:00
|
|
|
if ar.Restored {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-10-22 09:30:38 +00:00
|
|
|
streambadgeRestored(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:197
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
|
|
|
<td>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:199
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.E().S(ar.Value)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:199
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td>
|
2022-02-08 19:03:42 +00:00
|
|
|
<a href="`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2022-07-08 08:26:13 +00:00
|
|
|
qw422016.E().S(prefix + ar.WebLink())
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:201
|
2022-02-08 19:03:42 +00:00
|
|
|
qw422016.N().S(`">Details</a>
|
2021-09-07 19:39:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:204
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:204
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:207
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:207
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:210
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:210
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:212
|
2021-09-07 19:39:22 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:212
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div>
|
2022-09-14 12:04:24 +00:00
|
|
|
<p>No active alerts...</p>
|
2021-09-07 19:39:22 +00:00
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:216
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:216
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:218
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2022-07-06 08:46:01 +00:00
|
|
|
func WriteListAlerts(qq422016 qtio422016.Writer, r *http.Request, groupAlerts []GroupAlerts) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2022-07-06 08:46:01 +00:00
|
|
|
StreamListAlerts(qw422016, r, groupAlerts)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2022-07-06 08:46:01 +00:00
|
|
|
func ListAlerts(r *http.Request, groupAlerts []GroupAlerts) string {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2022-07-06 08:46:01 +00:00
|
|
|
WriteListAlerts(qb422016, r, groupAlerts)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
return qs422016
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:220
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:222
|
2022-07-06 08:46:01 +00:00
|
|
|
func StreamListTargets(qw422016 *qt422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:222
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:223
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "Notifiers")
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:223
|
2022-07-06 08:46:01 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:224
|
2022-07-06 08:46:01 +00:00
|
|
|
if len(targets) > 0 {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:224
|
2022-02-02 12:11:41 +00: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>
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:229
|
2022-02-02 12:11:41 +00:00
|
|
|
var keys []string
|
|
|
|
for key := range targets {
|
|
|
|
keys = append(keys, string(key))
|
|
|
|
}
|
|
|
|
sort.Strings(keys)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:234
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:236
|
2022-02-02 12:11:41 +00:00
|
|
|
for i := range keys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:236
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:237
|
2022-02-02 12:11:41 +00:00
|
|
|
typeK, ns := keys[i], targets[notifier.TargetType(keys[i])]
|
|
|
|
count := len(ns)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:239
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="group-heading data-bs-target="rules-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:240
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(typeK)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:240
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<span class="anchor" id="notifiers-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:241
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(typeK)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:241
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`"></span>
|
|
|
|
<a href="#notifiers-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(typeK)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(typeK)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(` (`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().D(count)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:242
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`)</a>
|
|
|
|
</div>
|
|
|
|
<div class="collapse show" id="notifiers-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:244
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(typeK)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:244
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`">
|
|
|
|
<table class="table table-striped table-hover table-sm">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">Labels</th>
|
|
|
|
<th scope="col">Address</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:253
|
2022-02-02 12:11:41 +00:00
|
|
|
for _, n := range ns {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:253
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:256
|
2022-11-30 05:22:12 +00:00
|
|
|
for _, l := range n.Labels.GetLabels() {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:256
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="ms-1 badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(l.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(l.Value)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:257
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:258
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:258
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</td>
|
|
|
|
<td>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:260
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.E().S(n.Notifier.Addr())
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:260
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:262
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:262
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:266
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:266
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:268
|
2022-02-02 12:11:41 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:268
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div>
|
2022-09-14 12:04:24 +00:00
|
|
|
<p>No targets...</p>
|
2022-02-02 12:11:41 +00:00
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:272
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:272
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:274
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:274
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-07-06 08:46:01 +00:00
|
|
|
func WriteListTargets(qq422016 qtio422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-07-06 08:46:01 +00:00
|
|
|
StreamListTargets(qw422016, r, targets)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-07-06 08:46:01 +00:00
|
|
|
func ListTargets(r *http.Request, targets map[notifier.TargetType][]notifier.Target) string {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-07-06 08:46:01 +00:00
|
|
|
WriteListTargets(qb422016, r, targets)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
return qs422016
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:276
|
2022-02-02 12:11:41 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:278
|
2022-07-06 08:46:01 +00:00
|
|
|
func StreamAlert(qw422016 *qt422016.Writer, r *http.Request, alert *APIAlert) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:278
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:279
|
2022-07-08 08:26:13 +00:00
|
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:279
|
2022-07-06 08:46:01 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:280
|
2022-07-08 08:26:13 +00:00
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "")
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:280
|
2022-07-08 08:26:13 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:282
|
2021-09-07 19:39:22 +00: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)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:293
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<div class="display-6 pb-3 mb-3">Alert: `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
if alert.State == "firing" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`bg-danger`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(` bg-warning text-dark`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.State)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:294
|
2021-09-07 19:39:22 +00: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">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:301
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:301
|
2021-09-07 19:39:22 +00: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>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:311
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.Expression)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:311
|
2021-09-07 19:39:22 +00: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">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:321
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, k := range labelKeys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:321
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="m-1 badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:322
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:322
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:322
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.Labels[k])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:322
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:323
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:323
|
2021-09-07 19:39:22 +00: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">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:333
|
2021-09-07 19:39:22 +00:00
|
|
|
for _, k := range annotationKeys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:333
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<b>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:334
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:334
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`:</b><br>
|
|
|
|
<p>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:335
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.Annotations[k])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:335
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:336
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:336
|
2021-09-07 19:39:22 +00: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">
|
2022-07-08 08:26:13 +00:00
|
|
|
<a target="_blank" href="`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2022-07-08 08:26:13 +00:00
|
|
|
qw422016.E().S(prefix)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2022-07-08 08:26:13 +00:00
|
|
|
qw422016.N().S(`groups#group-`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.GroupID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.E().S(alert.GroupID)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:346
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-10-13 12:25:11 +00:00
|
|
|
</div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Source link
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<a target="_blank" href="`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:356
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.E().S(alert.SourceLink)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:356
|
2021-10-13 12:25:11 +00:00
|
|
|
qw422016.N().S(`">Link</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-09-07 19:39:22 +00:00
|
|
|
</div>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:360
|
2022-07-06 08:46:01 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:360
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2022-07-06 08:46:01 +00:00
|
|
|
func WriteAlert(qq422016 qtio422016.Writer, r *http.Request, alert *APIAlert) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-09-07 19:39:22 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2022-07-06 08:46:01 +00:00
|
|
|
StreamAlert(qw422016, r, alert)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2022-07-06 08:46:01 +00:00
|
|
|
func Alert(r *http.Request, alert *APIAlert) string {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-09-07 19:39:22 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2022-07-06 08:46:01 +00:00
|
|
|
WriteAlert(qb422016, r, alert)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-10-22 09:30:38 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-10-22 09:30:38 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-10-22 09:30:38 +00:00
|
|
|
return qs422016
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:362
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:365
|
2022-09-14 12:04:24 +00:00
|
|
|
func StreamRuleDetails(qw422016 *qt422016.Writer, r *http.Request, rule APIRule) {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:365
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:366
|
2022-09-14 12:04:24 +00:00
|
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:366
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:367
|
2022-09-14 12:04:24 +00:00
|
|
|
tpl.StreamHeader(qw422016, r, navItems, "")
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:367
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:369
|
2022-09-14 12:04:24 +00:00
|
|
|
var labelKeys []string
|
|
|
|
for k := range rule.Labels {
|
|
|
|
labelKeys = append(labelKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(labelKeys)
|
|
|
|
|
|
|
|
var annotationKeys []string
|
|
|
|
for k := range rule.Annotations {
|
|
|
|
annotationKeys = append(annotationKeys, k)
|
|
|
|
}
|
|
|
|
sort.Strings(annotationKeys)
|
|
|
|
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:380
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<div class="display-6 pb-3 mb-3">Rule: `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.Name)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
if rule.Health != "ok" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`bg-danger`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
} else {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(` bg-warning text-dark`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.Health)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:381
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</span></div>
|
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Expr
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<code><pre>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:388
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.Query)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:388
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</pre></code>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-15 14:15:39 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:392
|
2022-09-15 14:15:39 +00:00
|
|
|
if rule.Type == "alerting" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:392
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
For
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:399
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.E().V(rule.Duration)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:399
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(` seconds
|
2022-09-14 12:04:24 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-15 14:15:39 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:403
|
2022-09-15 14:15:39 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:403
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Labels
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:410
|
2022-09-14 12:04:24 +00:00
|
|
|
for _, k := range labelKeys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:410
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="m-1 badge bg-primary">`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:411
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:411
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:411
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.Labels[k])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:411
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:412
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:412
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-15 14:15:39 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:416
|
2022-09-15 14:15:39 +00:00
|
|
|
if rule.Type == "alerting" {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:416
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Annotations
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:423
|
2022-09-15 14:15:39 +00:00
|
|
|
for _, k := range annotationKeys {
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:423
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<b>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:424
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.E().S(k)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:424
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`:</b><br>
|
2022-09-14 12:04:24 +00:00
|
|
|
<p>`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:425
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.E().S(rule.Annotations[k])
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:425
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`</p>
|
2022-09-14 12:04:24 +00:00
|
|
|
`)
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:426
|
2022-09-15 14:15:39 +00:00
|
|
|
}
|
2022-12-09 19:43:54 +00:00
|
|
|
//line app/vmalert/web.qtpl:426
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-08 13:34:03 +00:00
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Debug
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
`)
|
|
|
|
//line app/vmalert/web.qtpl:436
|
|
|
|
qw422016.E().V(rule.Debug)
|
|
|
|
//line app/vmalert/web.qtpl:436
|
|
|
|
qw422016.N().S(`
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-15 14:15:39 +00:00
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:440
|
2022-09-15 14:15:39 +00:00
|
|
|
}
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:440
|
2022-09-15 14:15:39 +00:00
|
|
|
qw422016.N().S(`
|
2022-09-14 12:04:24 +00:00
|
|
|
<div class="container border-bottom p-2">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
|
|
Group
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<a target="_blank" href="`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(prefix)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`groups#group-`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.GroupID)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(rule.GroupID)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:447
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<div class="display-6 pb-3">Last `)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:453
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().D(len(rule.Updates))
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:453
|
2022-12-29 11:36:44 +00:00
|
|
|
qw422016.N().S(`/`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:453
|
2022-12-29 11:36:44 +00:00
|
|
|
qw422016.N().D(rule.MaxUpdates)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:453
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(` updates</span>:</div>
|
|
|
|
<table class="table table-striped table-hover table-sm">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-09-15 10:40:22 +00:00
|
|
|
<th scope="col" title="The time when event was created">Updated at</th>
|
|
|
|
<th scope="col" style="width: 10%" class="text-center" title="How many samples were returned">Samples</th>
|
|
|
|
<th scope="col" style="width: 10%" class="text-center" title="How many seconds request took">Duration</th>
|
|
|
|
<th scope="col" class="text-center" title="Time used for rule execution">Executed at</th>
|
|
|
|
<th scope="col" class="text-center" title="cURL command with request example">cURL</th>
|
2022-09-14 12:04:24 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:466
|
2022-09-14 12:04:24 +00:00
|
|
|
for _, u := range rule.Updates {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:466
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:467
|
2022-09-14 12:04:24 +00:00
|
|
|
if u.err != nil {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:467
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(` class="alert-danger"`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:467
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:467
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`>
|
|
|
|
<td>
|
|
|
|
<span class="badge bg-primary rounded-pill me-3" title="Updated at">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:469
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(u.time.Format(time.RFC3339))
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:469
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
</td>
|
2022-09-15 10:40:22 +00:00
|
|
|
<td class="text-center" wi>`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:471
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().D(u.samples)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:471
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</td>
|
|
|
|
<td class="text-center">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:472
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().FPrec(u.duration.Seconds(), 3)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:472
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`s</td>
|
|
|
|
<td class="text-center">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:473
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().S(u.at.Format(time.RFC3339))
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:473
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</td>
|
2022-09-15 10:40:22 +00:00
|
|
|
<td>
|
|
|
|
<textarea class="curl-area" rows="1" onclick="this.focus();this.select()">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:475
|
2022-12-09 15:13:29 +00:00
|
|
|
qw422016.E().S(u.curl)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:475
|
2022-09-15 10:40:22 +00:00
|
|
|
qw422016.N().S(`</textarea>
|
|
|
|
</td>
|
2022-09-14 12:04:24 +00:00
|
|
|
</tr>
|
|
|
|
</li>
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:479
|
2022-09-14 12:04:24 +00:00
|
|
|
if u.err != nil {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:479
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<tr`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:480
|
2022-09-14 12:04:24 +00:00
|
|
|
if u.err != nil {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:480
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(` class="alert-danger"`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:480
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:480
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`>
|
2022-09-15 14:15:39 +00:00
|
|
|
<td colspan="5">
|
2022-09-14 12:04:24 +00:00
|
|
|
<span class="alert-danger">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:482
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.E().V(u.err)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:482
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:485
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:485
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:486
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:486
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:488
|
2022-09-14 12:04:24 +00:00
|
|
|
tpl.StreamFooter(qw422016, r)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:488
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
func WriteRuleDetails(qq422016 qtio422016.Writer, r *http.Request, rule APIRule) {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
StreamRuleDetails(qw422016, r, rule)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
func RuleDetails(r *http.Request, rule APIRule) string {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
WriteRuleDetails(qb422016, r, rule)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
return qs422016
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:489
|
2022-09-14 12:04:24 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:493
|
2021-10-22 09:30:38 +00:00
|
|
|
func streambadgeState(qw422016 *qt422016.Writer, state string) {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:493
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:495
|
2021-10-22 09:30:38 +00:00
|
|
|
badgeClass := "bg-warning text-dark"
|
|
|
|
if state == "firing" {
|
|
|
|
badgeClass = "bg-danger"
|
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:499
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<span class="badge `)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:500
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.E().S(badgeClass)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:500
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`">`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:500
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.E().S(state)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:500
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`</span>
|
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
func writebadgeState(qq422016 qtio422016.Writer, state string) {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
streambadgeState(qw422016, state)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
func badgeState(state string) string {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
writebadgeState(qb422016, state)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
return qs422016
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:501
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:503
|
2021-10-22 09:30:38 +00:00
|
|
|
func streambadgeRestored(qw422016 *qt422016.Writer) {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:503
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016.N().S(`
|
2021-10-27 16:59:13 +00:00
|
|
|
<span class="badge bg-warning text-dark" title="Alert state was restored after the service restart from remote storage">restored</span>
|
2021-10-22 09:30:38 +00:00
|
|
|
`)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
func writebadgeRestored(qq422016 qtio422016.Writer) {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
streambadgeRestored(qw422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
func badgeRestored() string {
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-10-22 09:30:38 +00:00
|
|
|
writebadgeRestored(qb422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-09-07 19:39:22 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-09-07 19:39:22 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-09-07 19:39:22 +00:00
|
|
|
return qs422016
|
2023-02-08 13:34:03 +00:00
|
|
|
//line app/vmalert/web.qtpl:505
|
2021-09-07 19:39:22 +00:00
|
|
|
}
|