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.
2022-05-04 19:26:38 +02:00
//line app/vmalert/web.qtpl:1
2021-09-07 21:39:22 +02:00
package main
2022-05-04 19:26:38 +02:00
//line app/vmalert/web.qtpl:3
2021-09-07 21:39:22 +02:00
import (
2022-07-06 10:46:01 +02:00
"net/http"
2021-09-07 21:39:22 +02:00
"sort"
"time"
2022-02-02 13:11:41 +01:00
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/notifier"
2021-09-07 21:39:22 +02:00
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/tpl"
2022-07-08 10:26:13 +02:00
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
2021-09-07 21:39:22 +02:00
)
2022-07-06 10:46:01 +02:00
//line app/vmalert/web.qtpl:14
2021-09-07 21:39:22 +02:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
2022-07-06 10:46:01 +02:00
//line app/vmalert/web.qtpl:14
2021-09-07 21:39:22 +02:00
var (
_ = qtio422016 . Copy
_ = qt422016 . AcquireByteBuffer
)
2022-05-04 19:26:38 +02:00
//line app/vmalert/web.qtpl:14
2022-07-06 10:46:01 +02:00
func StreamWelcome ( qw422016 * qt422016 . Writer , r * http . Request ) {
2022-05-04 19:26:38 +02:00
//line app/vmalert/web.qtpl:14
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2022-07-06 10:46:01 +02:00
` )
//line app/vmalert/web.qtpl:15
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "vmalert" , getLastConfigError ( ) )
2022-07-06 10:46:01 +02:00
//line app/vmalert/web.qtpl:15
qw422016 . N ( ) . S ( `
2021-09-07 21:39:22 +02:00
< p >
API : < br >
` )
2022-07-06 10:46:01 +02:00
//line app/vmalert/web.qtpl:18
2021-09-21 13:41:01 +02:00
for _ , p := range apiLinks {
2022-07-06 10:46:01 +02:00
//line app/vmalert/web.qtpl:18
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:19
2021-09-07 21:39:22 +02:00
p , doc := p [ 0 ] , p [ 1 ]
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:19
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2022-12-09 20:43:54 +01:00
< a href = " ` )
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( p )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( p )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` </a> - ` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( doc )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:20
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < br / >
` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:21
2021-09-07 21:39:22 +02:00
}
2022-12-09 20:43:54 +01: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 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< / p >
` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:30
2022-07-06 10:46:01 +02:00
tpl . StreamFooter ( qw422016 , r )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:30
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
}
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2022-07-06 10:46:01 +02:00
func WriteWelcome ( qq422016 qtio422016 . Writer , r * http . Request ) {
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2022-07-06 10:46:01 +02:00
StreamWelcome ( qw422016 , r )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
}
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2022-07-06 10:46:01 +02:00
func Welcome ( r * http . Request ) string {
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2022-07-06 10:46:01 +02:00
WriteWelcome ( qb422016 , r )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
qs422016 := string ( qb422016 . B )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
return qs422016
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:31
2021-09-07 21:39:22 +02:00
}
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:33
2023-05-10 14:38:13 +02:00
func streambuttonActive ( qw422016 * qt422016 . Writer , filter , expValue string ) {
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:33
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2022-12-09 20:43:54 +01:00
//line app/vmalert/web.qtpl:34
2023-05-10 14:38:13 +02:00
if filter != expValue {
//line app/vmalert/web.qtpl:34
qw422016 . N ( ) . S ( `
btn - secondary
` )
//line app/vmalert/web.qtpl:36
} else {
//line app/vmalert/web.qtpl:36
qw422016 . N ( ) . S ( `
btn - primary
` )
//line app/vmalert/web.qtpl:38
}
//line app/vmalert/web.qtpl:38
qw422016 . N ( ) . S ( `
` )
//line app/vmalert/web.qtpl:39
}
//line app/vmalert/web.qtpl:39
func writebuttonActive ( qq422016 qtio422016 . Writer , filter , expValue string ) {
//line app/vmalert/web.qtpl:39
qw422016 := qt422016 . AcquireWriter ( qq422016 )
//line app/vmalert/web.qtpl:39
streambuttonActive ( qw422016 , filter , expValue )
//line app/vmalert/web.qtpl:39
qt422016 . ReleaseWriter ( qw422016 )
//line app/vmalert/web.qtpl:39
}
//line app/vmalert/web.qtpl:39
func buttonActive ( filter , expValue string ) string {
//line app/vmalert/web.qtpl:39
qb422016 := qt422016 . AcquireByteBuffer ( )
//line app/vmalert/web.qtpl:39
writebuttonActive ( qb422016 , filter , expValue )
//line app/vmalert/web.qtpl:39
qs422016 := string ( qb422016 . B )
//line app/vmalert/web.qtpl:39
qt422016 . ReleaseByteBuffer ( qb422016 )
//line app/vmalert/web.qtpl:39
return qs422016
//line app/vmalert/web.qtpl:39
}
//line app/vmalert/web.qtpl:41
2023-10-13 13:54:33 +02:00
func StreamListGroups ( qw422016 * qt422016 . Writer , r * http . Request , originGroups [ ] apiGroup ) {
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:41
qw422016 . N ( ) . S ( `
` )
//line app/vmalert/web.qtpl:42
2022-09-14 14:04:24 +02:00
prefix := utils . Prefix ( r . URL . Path )
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:42
2022-07-06 10:46:01 +02:00
qw422016 . N ( ) . S ( `
` )
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:43
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "Groups" , getLastConfigError ( ) )
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:43
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
2021-09-07 21:39:22 +02:00
` )
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:45
filter := r . URL . Query ( ) . Get ( "filter" )
rOk := make ( map [ string ] int )
rNotOk := make ( map [ string ] int )
rNoMatch := make ( map [ string ] int )
2023-10-13 13:54:33 +02:00
var groups [ ] apiGroup
2023-05-10 14:38:13 +02:00
for _ , g := range originGroups {
2023-10-13 13:54:33 +02:00
var rules [ ] apiRule
2023-05-10 14:38:13 +02:00
for _ , r := range g . Rules {
if r . LastError != "" {
rNotOk [ g . ID ] ++
} else {
rOk [ g . ID ] ++
}
if isNoMatch ( r ) {
rNoMatch [ g . ID ] ++
2021-09-07 21:39:22 +02:00
}
2023-05-10 14:38:13 +02:00
if ( filter == "unhealthy" && r . LastError == "" ) ||
( filter == "noMatch" && ! isNoMatch ( r ) ) {
continue
}
rules = append ( rules , r )
}
if len ( rules ) > 0 {
g . Rules = rules
groups = append ( groups , g )
2021-09-07 21:39:22 +02:00
}
2023-05-10 14:38:13 +02:00
}
2021-09-07 21:39:22 +02:00
2023-05-10 14:38:13 +02:00
//line app/vmalert/web.qtpl:72
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< div class = "btn-toolbar mb-3" role = "toolbar" >
< div >
< a class = " btn ` )
//line app/vmalert/web.qtpl:75
2023-05-10 14:38:13 +02:00
streambuttonActive ( qw422016 , filter , "" )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:75
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( ` " role=" button " onclick=" window . location = window . location . pathname " > All < / a >
2024-02-20 13:07:05 +01:00
< a class = "btn btn-primary" role = "button" onclick = "collapseAll()" > Collapse All < / a >
< a class = "btn btn-primary" role = "button" onclick = "expandAll()" > Expand All < / a >
< a class = " btn ` )
//line app/vmalert/web.qtpl:78
2023-05-10 14:38:13 +02:00
streambuttonActive ( qw422016 , filter , "unhealthy" )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:78
2023-05-11 16:38:08 +02:00
qw422016 . N ( ) . S ( ` " role=" button " onclick=" location . href = ' ? filter = unhealthy ' " title=" Show only rules with errors " > Unhealthy < / a >
2024-02-20 13:07:05 +01:00
< a class = " btn ` )
//line app/vmalert/web.qtpl:79
2023-05-10 14:38:13 +02:00
streambuttonActive ( qw422016 , filter , "noMatch" )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:79
2023-05-11 16:38:08 +02:00
qw422016 . N ( ) . S ( ` " role=" button " onclick=" location . href = ' ? filter = noMatch ' " title=" Show only rules matching no time series during last evaluation " > NoMatch < / a >
2024-02-20 13:07:05 +01:00
< / div >
< div class = "col-md-4 col-lg-5" >
< div class = "px-3 input-group" >
< div class = "input-group-prepend" >
< span class = "input-group-text" >
< svg fill = "#000000" height = "25px" width = "20px" version = "1.1" id = "Capa_1" xmlns = "http://www.w3.org/2000/svg" xmlns : xlink = "http://www.w3.org/1999/xlink" viewBox = "0 0 490.4 490.4" xml : space = "preserve" > < g id = "SVGRepo_bgCarrier" stroke - width = "0" > < / g > < g id = "SVGRepo_tracerCarrier" stroke - linecap = "round" stroke - linejoin = "round" > < / g > < g id = "SVGRepo_iconCarrier" > < g > < path d = "M484.1,454.796l-110.5-110.6c29.8-36.3,47.6-82.8,47.6-133.4c0-116.3-94.3-210.6-210.6-210.6S0,94.496,0,210.796 s94.3,210.6,210.6,210.6c50.8,0,97.4-18,133.8-48l110.5,110.5c12.9,11.8,25,4.2,29.2,0C492.5,475.596,492.5,463.096,484.1,454.796z M41.1,210.796c0-93.6,75.9-169.5,169.5-169.5s169.6,75.9,169.6,169.5s-75.9,169.5-169.5,169.5S41.1,304.396,41.1,210.796z" > < / path > < / g > < / g > < / svg >
< / span >
< / div >
< input id = "search" placeholder = "Filter by group, rule or labels" type = "text" class = "form-control" / >
2024-02-20 12:31:41 +01:00
< / div >
< / div >
< / div >
2021-09-07 21:39:22 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:92
2023-05-10 14:38:13 +02:00
if len ( groups ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:92
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:93
2021-09-07 21:39:22 +02:00
for _ , g := range groups {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:93
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div
class = " group - heading ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2023-02-08 14:34:03 +01:00
if rNotOk [ g . ID ] > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` alert-danger ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( ` " data-bs-target="rules- ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2024-02-20 12:31:41 +01:00
qw422016 . N ( ) . S ( ` " data-group-name=" ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2024-02-20 12:31:41 +01:00
qw422016 . E ( ) . S ( g . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:95
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " >
2023-05-10 14:38:13 +02:00
< span class = "anchor" id = " group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:96
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:96
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " > < / span >
2023-05-10 14:38:13 +02:00
< a href = " # group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
if g . Type != "prometheus" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` ( ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . Type )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` ) ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` (every ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2022-03-15 12:54:53 +01:00
qw422016 . N ( ) . FPrec ( g . Interval , 0 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:97
2023-03-28 00:11:40 +02:00
qw422016 . N ( ) . S ( ` s ) # < / a >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2023-02-08 14:34:03 +01:00
if rNotOk [ g . ID ] > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( ` <span class="badge bg-danger" title="Number of rules with status Error"> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2023-02-08 14:34:03 +01:00
qw422016 . N ( ) . D ( rNotOk [ g . ID ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` </span> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:98
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
if rNoMatch [ g . ID ] > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( ` <span class="badge bg-warning" title="Number of rules with status NoMatch"> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . D ( rNoMatch [ g . ID ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( ` </span> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:99
2023-05-10 14:38:13 +02:00
qw422016 . N ( ) . S ( `
< span class = "badge bg-success" title = "Number of rules withs status Ok" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:100
2023-02-08 14:34:03 +01:00
qw422016 . N ( ) . D ( rOk [ g . ID ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:100
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / span >
2023-05-10 14:38:13 +02:00
< p class = "fs-6 fw-lighter" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:101
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . File )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:101
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / p >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:102
2021-12-02 13:45:08 +01:00
if len ( g . Params ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:102
2021-09-13 13:11:38 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div class = "fs-6 fw-lighter" > Extra params
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:104
2021-12-02 13:45:08 +01:00
for _ , param := range g . Params {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:104
2021-09-13 13:11:38 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< span class = "float-left badge bg-primary" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:105
2021-12-02 13:45:08 +01:00
qw422016 . E ( ) . S ( param )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:105
2021-09-13 13:11:38 +02:00
qw422016 . N ( ) . S ( ` < / span >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:106
2021-09-13 13:11:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:106
2021-09-13 13:11:38 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:108
2021-09-13 13:11:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:108
2021-09-13 13:11:38 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:109
2022-07-21 15:59:55 +02:00
if len ( g . Headers ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:109
2022-07-21 15:59:55 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div class = "fs-6 fw-lighter" > Extra headers
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:111
2022-07-21 15:59:55 +02:00
for _ , header := range g . Headers {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:111
2022-07-21 15:59:55 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< span class = "float-left badge bg-primary" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:112
2022-07-21 15:59:55 +02:00
qw422016 . E ( ) . S ( header )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:112
2022-07-21 15:59:55 +02:00
qw422016 . N ( ) . S ( ` < / span >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:113
2022-07-21 15:59:55 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:113
2022-07-21 15:59:55 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:115
2022-07-21 15:59:55 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:115
2022-07-21 15:59:55 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
2024-02-20 12:31:41 +01:00
< div class = "collapse rule-table" id = " rules - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:117
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:117
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " >
2023-05-10 14:38:13 +02:00
< table class = "table table-striped table-hover table-sm" >
< thead >
< tr >
< 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 >
< / tr >
< / thead >
< tbody >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:127
2022-03-15 12:54:53 +01:00
for _ , r := range g . Rules {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:127
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 12:31:41 +01:00
< tr class = " rule ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2022-03-15 12:54:53 +01:00
if r . LastError != "" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . N ( ) . S ( ` alert-danger ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . N ( ) . S ( ` " data-rule-name=" ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . E ( ) . S ( r . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . N ( ) . S ( ` " data-bs-target=" ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:128
2024-02-20 12:31:41 +01:00
qw422016 . N ( ) . S ( ` " >
2023-05-10 14:38:13 +02:00
< td >
< div class = "row" >
< div class = "col-12 mb-2" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:132
2022-03-15 12:54:53 +01:00
if r . Type == "alerting" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:132
2022-03-15 12:54:53 +01:00
qw422016 . N ( ) . S ( `
2023-07-27 15:13:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:133
2023-07-27 15:13:13 +02:00
if r . KeepFiringFor > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:133
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
< b > alert : < / b > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . S ( r . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` (for: ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . V ( r . Duration )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` seconds, keep_firing_for: ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . V ( r . KeepFiringFor )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:134
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` seconds )
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:135
2023-07-27 15:13:13 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:135
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
< b > alert : < / b > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:136
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . S ( r . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:136
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` (for: ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:136
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . V ( r . Duration )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:136
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` seconds )
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:137
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:137
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:138
2023-07-27 15:13:13 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:138
2022-03-15 12:54:53 +01:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< b > record : < / b > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:139
2022-03-15 12:54:53 +01:00
qw422016 . E ( ) . S ( r . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:139
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:140
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:140
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
|
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:142
2023-05-08 09:36:39 +02:00
streamseriesFetchedWarn ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:142
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< span > < a target = "_blank" href = " ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:143
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( prefix + r . WebLink ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:143
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` " > Details < / a > < / span >
2023-05-10 14:38:13 +02:00
< / div >
< div class = "col-12" >
< code > < pre > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:146
2022-03-15 12:54:53 +01:00
qw422016 . E ( ) . S ( r . Query )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:146
2022-05-04 18:02:18 +02:00
qw422016 . N ( ) . S ( ` < / pre > < / code >
2023-05-10 14:38:13 +02:00
< / div >
< div class = "col-12 mb-2" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:149
2022-03-15 12:54:53 +01:00
if len ( r . Labels ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:149
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` <b>Labels:</b> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:149
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:149
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:150
2022-03-15 12:54:53 +01:00
for k , v := range r . Labels {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:150
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 12:31:41 +01:00
< span class = "ms-1 badge bg-primary label" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:151
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:151
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` = ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:151
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( v )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:151
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / span >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:152
2022-05-04 18:02:18 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:152
2022-05-04 18:02:18 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:154
2022-05-04 18:02:18 +02:00
if r . LastError != "" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:154
2022-05-04 18:02:18 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div class = "col-12" >
< b > Error : < / b >
< div class = "error-cell" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:158
2022-05-04 18:02:18 +02:00
qw422016 . E ( ) . S ( r . LastError )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:158
2022-05-04 18:02:18 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
2022-05-04 18:02:18 +02:00
< / div >
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:161
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:161
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / div >
< / td >
< td class = "text-center" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:164
2022-03-15 12:54:53 +01:00
qw422016 . N ( ) . D ( r . LastSamples )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:164
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / td >
2023-05-10 14:38:13 +02:00
< td class = "text-center" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:165
2022-03-15 12:54:53 +01:00
qw422016 . N ( ) . FPrec ( time . Since ( r . LastEvaluation ) . Seconds ( ) , 3 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:165
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` s ago < / td >
2023-05-10 14:38:13 +02:00
< / tr >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:167
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:167
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< / tbody >
< / table >
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:171
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:171
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:172
2021-09-07 21:39:22 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:172
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div >
< p > No groups ... < / p >
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:176
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:176
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:178
2022-07-06 10:46:01 +02:00
tpl . StreamFooter ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:178
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2023-10-13 13:54:33 +02:00
func WriteListGroups ( qq422016 qtio422016 . Writer , r * http . Request , originGroups [ ] apiGroup ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2023-05-10 14:38:13 +02:00
StreamListGroups ( qw422016 , r , originGroups )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2023-10-13 13:54:33 +02:00
func ListGroups ( r * http . Request , originGroups [ ] apiGroup ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2023-05-10 14:38:13 +02:00
WriteListGroups ( qb422016 , r , originGroups )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:180
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:183
2023-10-13 13:54:33 +02:00
func StreamListAlerts ( qw422016 * qt422016 . Writer , r * http . Request , groupAlerts [ ] groupAlerts ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:183
2022-02-08 20:03:42 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:184
2022-07-08 10:26:13 +02:00
prefix := utils . Prefix ( r . URL . Path )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:184
2022-07-06 10:46:01 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:185
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "Alerts" , getLastConfigError ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:185
2022-07-08 10:26:13 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:186
2022-07-08 10:26:13 +02:00
if len ( groupAlerts ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:186
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< div class = "btn-toolbar mb-3" role = "toolbar" >
< div >
< a class = "btn btn-primary" role = "button" onclick = "collapseAll()" > Collapse All < / a >
< a class = "btn btn-primary" role = "button" onclick = "expandAll()" > Expand All < / a >
< / div >
< div class = "col-md-4 col-lg-5" >
< div class = "px-3 input-group" >
< div class = "input-group-prepend" >
< span class = "input-group-text" >
< svg fill = "#000000" height = "25px" width = "20px" version = "1.1" id = "Capa_1" xmlns = "http://www.w3.org/2000/svg" xmlns : xlink = "http://www.w3.org/1999/xlink" viewBox = "0 0 490.4 490.4" xml : space = "preserve" > < g id = "SVGRepo_bgCarrier" stroke - width = "0" > < / g > < g id = "SVGRepo_tracerCarrier" stroke - linecap = "round" stroke - linejoin = "round" > < / g > < g id = "SVGRepo_iconCarrier" > < g > < path d = "M484.1,454.796l-110.5-110.6c29.8-36.3,47.6-82.8,47.6-133.4c0-116.3-94.3-210.6-210.6-210.6S0,94.496,0,210.796 s94.3,210.6,210.6,210.6c50.8,0,97.4-18,133.8-48l110.5,110.5c12.9,11.8,25,4.2,29.2,0C492.5,475.596,492.5,463.096,484.1,454.796z M41.1,210.796c0-93.6,75.9-169.5,169.5-169.5s169.6,75.9,169.6,169.5s-75.9,169.5-169.5,169.5S41.1,304.396,41.1,210.796z" > < / path > < / g > < / g > < / svg >
< / span >
< / div >
< input id = "search" placeholder = "Filter by group, rule or labels" type = "text" class = "form-control" / >
< / div >
< / div >
< / div >
2021-09-07 21:39:22 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:203
2021-09-07 21:39:22 +02:00
for _ , ga := range groupAlerts {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:203
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:204
2021-09-07 21:39:22 +02:00
g := ga . Group
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:204
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< div class = "group-heading alert-danger" data - bs - target = " rules - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:205
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:205
qw422016 . N ( ) . S ( ` " data-group-name=" ` )
//line app/vmalert/web.qtpl:205
qw422016 . E ( ) . S ( g . Name )
//line app/vmalert/web.qtpl:205
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " >
< span class = "anchor" id = " group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:206
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:206
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " > < / span >
< a href = " # group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
if g . Type != "prometheus" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` ( ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . Type )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` ) ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:207
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / a >
< span class = "badge bg-danger" title = "Number of active alerts" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:208
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . D ( len ( ga . Alerts ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:208
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / span >
< br >
< p class = "fs-6 fw-lighter" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:210
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . File )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:210
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / p >
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:213
2021-09-07 21:39:22 +02:00
var keys [ ] string
2023-10-13 13:54:33 +02:00
alertsByRule := make ( map [ string ] [ ] * apiAlert )
2021-09-07 21:39:22 +02:00
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 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:222
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< div class = "collapse rule-table" id = " rules - ` )
//line app/vmalert/web.qtpl:223
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( g . ID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:223
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` " >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:224
2021-09-07 21:39:22 +02:00
for _ , ruleID := range keys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:224
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:226
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 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:232
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< br >
2024-02-20 13:07:05 +01:00
< div class = "rule" data - rule - name = " ` )
//line app/vmalert/web.qtpl:234
qw422016 . E ( ) . S ( defaultAR . Name )
//line app/vmalert/web.qtpl:234
qw422016 . N ( ) . S ( ` " data-bs-target=" ` )
//line app/vmalert/web.qtpl:234
qw422016 . E ( ) . S ( g . ID )
//line app/vmalert/web.qtpl:234
qw422016 . N ( ) . S ( ` " >
< b > alert : < / b > ` )
//line app/vmalert/web.qtpl:235
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( defaultAR . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:235
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` ( ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:235
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . D ( len ( alertsByRule [ ruleID ] ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:235
2021-10-13 14:25:11 +02:00
qw422016 . N ( ) . S ( ` )
2024-02-20 13:07:05 +01:00
| < span > < a target = "_blank" href = " ` )
//line app/vmalert/web.qtpl:236
2021-10-13 14:25:11 +02:00
qw422016 . E ( ) . S ( defaultAR . SourceLink )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:236
2021-10-13 14:25:11 +02:00
qw422016 . N ( ) . S ( ` " > Source < / a > < / span >
2024-02-20 13:07:05 +01:00
< br >
< b > expr : < / b > < code > < pre > ` )
//line app/vmalert/web.qtpl:238
2021-10-13 14:25:11 +02:00
qw422016 . E ( ) . S ( defaultAR . Expression )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:238
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / pre > < / code >
2024-02-20 13:07:05 +01:00
< 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 >
` )
//line app/vmalert/web.qtpl:250
2021-09-07 21:39:22 +02:00
for _ , ar := range alertsByRule [ ruleID ] {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:250
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< tr >
< td >
` )
//line app/vmalert/web.qtpl:253
2021-09-07 21:39:22 +02:00
for _ , k := range labelKeys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:253
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< span class = "ms-1 badge bg-primary label" > ` )
//line app/vmalert/web.qtpl:254
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:254
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` = ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:254
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( ar . Labels [ k ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:254
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / span >
2024-02-20 13:07:05 +01:00
` )
//line app/vmalert/web.qtpl:255
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:255
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< / td >
< td > ` )
//line app/vmalert/web.qtpl:257
2021-10-22 11:30:38 +02:00
streambadgeState ( qw422016 , ar . State )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:257
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / td >
2024-02-20 13:07:05 +01:00
< td >
` )
//line app/vmalert/web.qtpl:259
2021-10-22 11:30:38 +02:00
qw422016 . E ( ) . S ( ar . ActiveAt . Format ( "2006-01-02T15:04:05Z07:00" ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:259
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
` )
//line app/vmalert/web.qtpl:260
2021-10-22 11:30:38 +02:00
if ar . Restored {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:260
2021-10-22 11:30:38 +02:00
streambadgeRestored ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:260
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:260
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
` )
//line app/vmalert/web.qtpl:261
2023-07-27 15:13:13 +02:00
if ar . Stabilizing {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:261
2023-07-27 15:13:13 +02:00
streambadgeStabilizing ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:261
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:261
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< / td >
< td > ` )
//line app/vmalert/web.qtpl:263
2021-10-22 11:30:38 +02:00
qw422016 . E ( ) . S ( ar . Value )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:263
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / td >
2024-02-20 13:07:05 +01:00
< td >
< a href = " ` )
//line app/vmalert/web.qtpl:265
2022-07-08 10:26:13 +02:00
qw422016 . E ( ) . S ( prefix + ar . WebLink ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:265
2022-02-08 20:03:42 +01:00
qw422016 . N ( ) . S ( ` " > Details < / a >
2024-02-20 13:07:05 +01:00
< / td >
< / tr >
` )
//line app/vmalert/web.qtpl:268
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:268
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2024-02-20 13:07:05 +01:00
< / tbody >
< / table >
< / div >
2021-09-07 21:39:22 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:272
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:272
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:274
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:274
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:276
2021-09-07 21:39:22 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:276
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< div >
2022-09-14 14:04:24 +02:00
< p > No active alerts ... < / p >
2021-09-07 21:39:22 +02:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:280
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:280
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:282
2022-07-06 10:46:01 +02:00
tpl . StreamFooter ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:282
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2023-10-13 13:54:33 +02:00
func WriteListAlerts ( qq422016 qtio422016 . Writer , r * http . Request , groupAlerts [ ] groupAlerts ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2022-07-06 10:46:01 +02:00
StreamListAlerts ( qw422016 , r , groupAlerts )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2023-10-13 13:54:33 +02:00
func ListAlerts ( r * http . Request , groupAlerts [ ] groupAlerts ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2022-07-06 10:46:01 +02:00
WriteListAlerts ( qb422016 , r , groupAlerts )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:284
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:286
2022-07-06 10:46:01 +02:00
func StreamListTargets ( qw422016 * qt422016 . Writer , r * http . Request , targets map [ notifier . TargetType ] [ ] notifier . Target ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:286
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:287
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "Notifiers" , getLastConfigError ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:287
2022-07-06 10:46:01 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:288
2022-07-06 10:46:01 +02:00
if len ( targets ) > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:288
2022-02-02 13:11:41 +01: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 >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:293
2022-02-02 13:11:41 +01:00
var keys [ ] string
for key := range targets {
keys = append ( keys , string ( key ) )
}
sort . Strings ( keys )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:298
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:300
2022-02-02 13:11:41 +01:00
for i := range keys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:300
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:301
2022-02-02 13:11:41 +01:00
typeK , ns := keys [ i ] , targets [ notifier . TargetType ( keys [ i ] ) ]
count := len ( ns )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:303
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
2023-05-10 14:38:13 +02:00
< div class = "group-heading" data - bs - target = " notifiers - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:304
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( typeK )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:304
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` " >
2023-05-10 14:38:13 +02:00
< span class = "anchor" id = " group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:305
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( typeK )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:305
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` " > < / span >
2023-05-10 14:38:13 +02:00
< a href = " # group - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( typeK )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( typeK )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` ( ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . D ( count )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:306
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` ) < / a >
< / div >
< div class = "collapse show" id = " notifiers - ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:308
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( typeK )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:308
2022-02-02 13:11:41 +01: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 >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:317
2022-02-02 13:11:41 +01:00
for _ , n := range ns {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:317
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
< tr >
< td >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:320
2022-11-30 06:22:12 +01:00
for _ , l := range n . Labels . GetLabels ( ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:320
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
< span class = "ms-1 badge bg-primary" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:321
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( l . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:321
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` = ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:321
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( l . Value )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:321
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` < / span >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:322
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:322
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
< / td >
< td > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:324
2022-02-02 13:11:41 +01:00
qw422016 . E ( ) . S ( n . Notifier . Addr ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:324
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( ` < / td >
< / tr >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:326
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:326
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
< / tbody >
< / table >
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:330
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:330
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:332
2022-02-02 13:11:41 +01:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:332
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
< div >
2022-09-14 14:04:24 +02:00
< p > No targets ... < / p >
2022-02-02 13:11:41 +01:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:336
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:336
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:338
2022-07-06 10:46:01 +02:00
tpl . StreamFooter ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:338
2022-02-02 13:11:41 +01:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-07-06 10:46:01 +02:00
func WriteListTargets ( qq422016 qtio422016 . Writer , r * http . Request , targets map [ notifier . TargetType ] [ ] notifier . Target ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-07-06 10:46:01 +02:00
StreamListTargets ( qw422016 , r , targets )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-07-06 10:46:01 +02:00
func ListTargets ( r * http . Request , targets map [ notifier . TargetType ] [ ] notifier . Target ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-07-06 10:46:01 +02:00
WriteListTargets ( qb422016 , r , targets )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:340
2022-02-02 13:11:41 +01:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:342
2023-10-13 13:54:33 +02:00
func StreamAlert ( qw422016 * qt422016 . Writer , r * http . Request , alert * apiAlert ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:342
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:343
2022-07-08 10:26:13 +02:00
prefix := utils . Prefix ( r . URL . Path )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:343
2022-07-06 10:46:01 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:344
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "" , getLastConfigError ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:344
2022-07-08 10:26:13 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:346
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 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:357
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "display-6 pb-3 mb-3" > Alert : ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` <span class="ms-2 badge ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
if alert . State == "firing" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` bg-danger ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` bg-warning text-dark ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . State )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:358
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" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:365
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . ActiveAt . Format ( "2006-01-02T15:04:05Z07:00" ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:365
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 > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:375
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . Expression )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:375
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" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:385
2021-09-07 21:39:22 +02:00
for _ , k := range labelKeys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:385
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< span class = "m-1 badge bg-primary" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:386
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:386
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` = ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:386
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . Labels [ k ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:386
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / span >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:387
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:387
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" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:397
2021-09-07 21:39:22 +02:00
for _ , k := range annotationKeys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:397
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
< b > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:398
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:398
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` : < / b > < br >
< p > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:399
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . Annotations [ k ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:399
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / p >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:400
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:400
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" >
2022-07-08 10:26:13 +02:00
< a target = "_blank" href = " ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2022-07-08 10:26:13 +02:00
qw422016 . E ( ) . S ( prefix )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2022-07-08 10:26:13 +02:00
qw422016 . N ( ) . S ( ` groups#group- ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . GroupID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2021-09-07 21:39:22 +02:00
qw422016 . E ( ) . S ( alert . GroupID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:410
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( ` < / a >
< / div >
< / div >
2021-10-13 14:25:11 +02: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 = " ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:420
2021-10-13 14:25:11 +02:00
qw422016 . E ( ) . S ( alert . SourceLink )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:420
2021-10-13 14:25:11 +02:00
qw422016 . N ( ) . S ( ` " > Link < / a >
< / div >
< / div >
2021-09-07 21:39:22 +02:00
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:424
2022-07-06 10:46:01 +02:00
tpl . StreamFooter ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:424
2021-09-07 21:39:22 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2023-10-13 13:54:33 +02:00
func WriteAlert ( qq422016 qtio422016 . Writer , r * http . Request , alert * apiAlert ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-09-07 21:39:22 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2022-07-06 10:46:01 +02:00
StreamAlert ( qw422016 , r , alert )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-09-07 21:39:22 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2023-10-13 13:54:33 +02:00
func Alert ( r * http . Request , alert * apiAlert ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-09-07 21:39:22 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2022-07-06 10:46:01 +02:00
WriteAlert ( qb422016 , r , alert )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-10-22 11:30:38 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-10-22 11:30:38 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-10-22 11:30:38 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:426
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:429
2023-10-13 13:54:33 +02:00
func StreamRuleDetails ( qw422016 * qt422016 . Writer , r * http . Request , rule apiRule ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:429
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:430
2022-09-14 14:04:24 +02:00
prefix := utils . Prefix ( r . URL . Path )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:430
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:431
2023-08-07 21:58:40 +02:00
tpl . StreamHeader ( qw422016 , r , navItems , "" , getLastConfigError ( ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:431
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:433
2022-09-14 14:04:24 +02: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 )
2023-05-08 09:36:39 +02:00
var seriesFetchedEnabled bool
var seriesFetchedWarning bool
for _ , u := range rule . Updates {
2023-10-13 13:54:33 +02:00
if u . SeriesFetched != nil {
2023-05-08 09:36:39 +02:00
seriesFetchedEnabled = true
2023-10-13 13:54:33 +02:00
if * u . SeriesFetched == 0 && u . Samples == 0 {
2023-05-08 09:36:39 +02:00
seriesFetchedWarning = true
}
}
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:456
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
< div class = "display-6 pb-3 mb-3" > Rule : ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . Name )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` <span class="ms-2 badge ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
if rule . Health != "ok" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` bg-danger ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` bg-success text-dark ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . Health )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:457
2022-09-14 14:04:24 +02: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 > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:464
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . Query )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:464
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / pre > < / code >
< / div >
< / div >
< / div >
2022-09-15 16:15:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:468
2022-09-15 16:15:39 +02:00
if rule . Type == "alerting" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:468
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
For
< / div >
< div class = "col" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:475
2022-09-15 16:15:39 +02:00
qw422016 . E ( ) . V ( rule . Duration )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:475
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( ` seconds
2022-09-14 14:04:24 +02:00
< / div >
< / div >
< / div >
2022-09-15 16:15:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:479
2023-07-27 15:13:13 +02:00
if rule . KeepFiringFor > 0 {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:479
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
Keep firing for
< / div >
< div class = "col" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:486
2023-07-27 15:13:13 +02:00
qw422016 . E ( ) . V ( rule . KeepFiringFor )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:486
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` seconds
< / div >
< / div >
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:490
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:490
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:491
2022-09-15 16:15:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:491
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
Labels
< / div >
< div class = "col" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:498
2022-09-14 14:04:24 +02:00
for _ , k := range labelKeys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:498
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
< span class = "m-1 badge bg-primary" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:499
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:499
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` = ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:499
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . Labels [ k ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:499
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / span >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:500
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:500
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
< / div >
< / div >
< / div >
2022-09-15 16:15:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:504
2022-09-15 16:15:39 +02:00
if rule . Type == "alerting" {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:504
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
Annotations
< / div >
< div class = "col" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:511
2022-09-15 16:15:39 +02:00
for _ , k := range annotationKeys {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:511
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< b > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:512
2022-09-15 16:15:39 +02:00
qw422016 . E ( ) . S ( k )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:512
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( ` : < / b > < br >
2022-09-14 14:04:24 +02:00
< p > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:513
2022-09-15 16:15:39 +02:00
qw422016 . E ( ) . S ( rule . Annotations [ k ] )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:513
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( ` < / p >
2022-09-14 14:04:24 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:514
2022-09-15 16:15:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:514
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< / div >
< / div >
< / div >
2023-02-08 14:34:03 +01:00
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
Debug
< / div >
< div class = "col" >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:524
2023-02-08 14:34:03 +01:00
qw422016 . E ( ) . V ( rule . Debug )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:524
2023-02-08 14:34:03 +01:00
qw422016 . N ( ) . S ( `
< / div >
< / div >
< / div >
2022-09-15 16:15:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:528
2022-09-15 16:15:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:528
2022-09-15 16:15:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "container border-bottom p-2" >
< div class = "row" >
< div class = "col-2" >
Group
< / div >
< div class = "col" >
< a target = "_blank" href = " ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( prefix )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` groups#group- ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . GroupID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . E ( ) . S ( rule . GroupID )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:535
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / a >
< / div >
< / div >
< / div >
< br >
2023-05-08 09:36:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:541
2023-05-08 09:36:39 +02:00
if seriesFetchedWarning {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:541
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
< div class = "alert alert-warning" role = "alert" >
< strong > Warning : < / strong > some of updates have "Series fetched" equal to 0. < br >
It might be that either this data is missing in the datasource or there is a typo in rule ' s expression .
For example , < strong > foo { label = "bar" } > 0 < / strong > could never trigger because < strong > foo { label = "bar" } < / strong >
metric doesn ' t exist .
< br >
Rule ' s expressions without time series selector , like < strong > expr : 42 < / strong > or < strong > expr : time ( ) < / strong >
aren ' t fetching time series from datasource , so they could have "Series fetched" equal to 0 and this won ' t be a problem .
< br >
See more details about this detection < a target = "_blank" href = "https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4039" > here < / a > .
< / div >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:553
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:553
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< div class = "display-6 pb-3" > Last ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:554
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . D ( len ( rule . Updates ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:554
2022-12-29 12:36:44 +01:00
qw422016 . N ( ) . S ( ` / ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:554
2022-12-29 12:36:44 +01:00
qw422016 . N ( ) . D ( rule . MaxUpdates )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:554
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` updates < / span > : < / div >
< table class = "table table-striped table-hover table-sm" >
< thead >
< tr >
2022-09-15 12:40:22 +02: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 >
2023-05-08 09:36:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:560
2023-05-08 09:36:39 +02:00
if seriesFetchedEnabled {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:560
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` <th scope="col" style="width: 10%" class="text-center" title="How many series were scanned by datasource during the evaluation">Series fetched</th> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:560
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:560
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-15 12:40:22 +02:00
< 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 14:04:24 +02:00
< / tr >
< / thead >
< tbody >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:568
2022-09-14 14:04:24 +02:00
for _ , u := range rule . Updates {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:568
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
< tr ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:569
2023-10-13 13:54:33 +02:00
if u . Err != nil {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:569
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` class="alert-danger" ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:569
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:569
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` >
< td >
< span class = "badge bg-primary rounded-pill me-3" title = "Updated at" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:571
2023-10-13 13:54:33 +02:00
qw422016 . E ( ) . S ( u . Time . Format ( time . RFC3339 ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:571
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / span >
< / td >
2023-05-08 09:36:39 +02:00
< td class = "text-center" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:573
2023-10-13 13:54:33 +02:00
qw422016 . N ( ) . D ( u . Samples )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:573
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / td >
2023-05-08 09:36:39 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
if seriesFetchedEnabled {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` <td class="text-center"> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-10-13 13:54:33 +02:00
if u . SeriesFetched != nil {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-10-13 13:54:33 +02:00
qw422016 . N ( ) . D ( * u . SeriesFetched )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` </td> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:574
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
2022-09-14 14:04:24 +02:00
< td class = "text-center" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:575
2023-10-13 13:54:33 +02:00
qw422016 . N ( ) . FPrec ( u . Duration . Seconds ( ) , 3 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:575
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` s < / td >
< td class = "text-center" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:576
2023-10-13 13:54:33 +02:00
qw422016 . E ( ) . S ( u . At . Format ( time . RFC3339 ) )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:576
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / td >
2022-09-15 12:40:22 +02:00
< td >
< textarea class = "curl-area" rows = "1" onclick = "this.focus();this.select()" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:578
2023-10-13 13:54:33 +02:00
qw422016 . E ( ) . S ( u . Curl )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:578
2022-09-15 12:40:22 +02:00
qw422016 . N ( ) . S ( ` < / textarea >
< / td >
2022-09-14 14:04:24 +02:00
< / tr >
< / li >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:582
2023-10-13 13:54:33 +02:00
if u . Err != nil {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:582
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
< tr ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:583
2023-10-13 13:54:33 +02:00
if u . Err != nil {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:583
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` class="alert-danger" ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:583
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:583
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` >
2023-05-08 09:36:39 +02:00
< td colspan = " ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
if seriesFetchedEnabled {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` 6 ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
} else {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` 5 ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:584
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( ` " >
2022-09-14 14:04:24 +02:00
< span class = "alert-danger" > ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:585
2023-10-13 13:54:33 +02:00
qw422016 . E ( ) . V ( u . Err )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:585
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( ` < / span >
< / td >
< / tr >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:588
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:588
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:589
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:589
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:591
2022-09-14 14:04:24 +02:00
tpl . StreamFooter ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:591
2022-09-14 14:04:24 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2023-10-13 13:54:33 +02:00
func WriteRuleDetails ( qq422016 qtio422016 . Writer , r * http . Request , rule apiRule ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
StreamRuleDetails ( qw422016 , r , rule )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2023-10-13 13:54:33 +02:00
func RuleDetails ( r * http . Request , rule apiRule ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
WriteRuleDetails ( qb422016 , r , rule )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:592
2022-09-14 14:04:24 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:596
2021-10-22 11:30:38 +02:00
func streambadgeState ( qw422016 * qt422016 . Writer , state string ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:596
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:598
2021-10-22 11:30:38 +02:00
badgeClass := "bg-warning text-dark"
if state == "firing" {
badgeClass = "bg-danger"
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:602
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( `
< span class = " badge ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:603
2021-10-22 11:30:38 +02:00
qw422016 . E ( ) . S ( badgeClass )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:603
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( ` "> ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:603
2021-10-22 11:30:38 +02:00
qw422016 . E ( ) . S ( state )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:603
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( ` < / span >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
func writebadgeState ( qq422016 qtio422016 . Writer , state string ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
streambadgeState ( qw422016 , state )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
func badgeState ( state string ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
writebadgeState ( qb422016 , state )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:604
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:606
2021-10-22 11:30:38 +02:00
func streambadgeRestored ( qw422016 * qt422016 . Writer ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:606
2021-10-22 11:30:38 +02:00
qw422016 . N ( ) . S ( `
2021-10-27 18:59:13 +02: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 11:30:38 +02:00
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
func writebadgeRestored ( qq422016 qtio422016 . Writer ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
streambadgeRestored ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
func badgeRestored ( ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2021-10-22 11:30:38 +02:00
writebadgeRestored ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2023-05-08 09:36:39 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2023-05-08 09:36:39 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2023-05-08 09:36:39 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:608
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
func streambadgeStabilizing ( qw422016 * qt422016 . Writer ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( `
< span class = "badge bg-warning text-dark" title = " This firing state is kept because of ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( "`" )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` keep_firing_for ` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( "`" )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:610
2023-07-27 15:13:13 +02:00
qw422016 . N ( ) . S ( ` " > stabilizing < / span >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
func writebadgeStabilizing ( qq422016 qtio422016 . Writer ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
streambadgeStabilizing ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
func badgeStabilizing ( ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
writebadgeStabilizing ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:612
2023-07-27 15:13:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:614
2023-10-13 13:54:33 +02:00
func streamseriesFetchedWarn ( qw422016 * qt422016 . Writer , r apiRule ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:614
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:615
2023-05-10 14:38:13 +02:00
if isNoMatch ( r ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:615
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
< svg xmlns = "http://www.w3.org/2000/svg"
data - bs - toggle = "tooltip"
2023-05-19 12:45:15 +02:00
title = " No match ! This rule ' s last evaluation hasn ' t selected any time series from the datasource .
2023-05-08 09:36:39 +02:00
It might be that either this data is missing in the datasource or there is a typo in rule ' s expression .
See more in Details . "
width = "18" height = "18" fill = "currentColor" class = "bi bi-exclamation-triangle-fill flex-shrink-0 me-2" viewBox = "0 0 16 16" role = "img" aria - label = "Warning:" >
< path d = "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" / >
< / svg >
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:624
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:624
2023-05-08 09:36:39 +02:00
qw422016 . N ( ) . S ( `
` )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-10-13 13:54:33 +02:00
func writeseriesFetchedWarn ( qq422016 qtio422016 . Writer , r apiRule ) {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
streamseriesFetchedWarn ( qw422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-10-13 13:54:33 +02:00
func seriesFetchedWarn ( r apiRule ) string {
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-08 09:36:39 +02:00
writeseriesFetchedWarn ( qb422016 , r )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2021-09-07 21:39:22 +02:00
qs422016 := string ( qb422016 . B )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2021-09-07 21:39:22 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2021-09-07 21:39:22 +02:00
return qs422016
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:625
2023-05-10 14:38:13 +02:00
}
2024-02-20 13:07:05 +01:00
//line app/vmalert/web.qtpl:628
2023-10-13 13:54:33 +02:00
func isNoMatch ( r apiRule ) bool {
2023-05-10 14:38:13 +02:00
return r . LastSamples == 0 && r . LastSeriesFetched != nil && * r . LastSeriesFetched == 0
2021-09-07 21:39:22 +02:00
}