From 381e2de59c796a243a2028a3cdd829602697fa57 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 4 May 2022 20:26:38 +0300 Subject: [PATCH] app/vmalert: run `make quicktemplate-gen` from the root directory after the commit f6dcfbcdd64935eab24203b0b43843aea984e5f2 --- .../notifier/alertmanager_request.qtpl.go | 112 +-- app/vmalert/tpl/footer.qtpl.go | 36 +- app/vmalert/tpl/header.qtpl.go | 50 +- app/vmalert/tpl/nav.qtpl.go | 62 +- app/vmalert/web.qtpl.go | 790 +++++++++--------- docs/CHANGELOG.md | 2 +- 6 files changed, 526 insertions(+), 526 deletions(-) diff --git a/app/vmalert/notifier/alertmanager_request.qtpl.go b/app/vmalert/notifier/alertmanager_request.qtpl.go index f3f7b193a..8a6ce45e2 100644 --- a/app/vmalert/notifier/alertmanager_request.qtpl.go +++ b/app/vmalert/notifier/alertmanager_request.qtpl.go @@ -1,135 +1,135 @@ // Code generated by qtc from "alertmanager_request.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line notifier/alertmanager_request.qtpl:1 +//line app/vmalert/notifier/alertmanager_request.qtpl:1 package notifier -//line notifier/alertmanager_request.qtpl:1 +//line app/vmalert/notifier/alertmanager_request.qtpl:1 import ( "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 func streamamRequest(qw422016 *qt422016.Writer, alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) { -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 qw422016.N().S(`[`) -//line notifier/alertmanager_request.qtpl:10 +//line app/vmalert/notifier/alertmanager_request.qtpl:10 for i, alert := range alerts { -//line notifier/alertmanager_request.qtpl:10 +//line app/vmalert/notifier/alertmanager_request.qtpl:10 qw422016.N().S(`{"startsAt":`) -//line notifier/alertmanager_request.qtpl:12 +//line app/vmalert/notifier/alertmanager_request.qtpl:12 qw422016.N().Q(alert.Start.Format(time.RFC3339Nano)) -//line notifier/alertmanager_request.qtpl:12 +//line app/vmalert/notifier/alertmanager_request.qtpl:12 qw422016.N().S(`,"generatorURL":`) -//line notifier/alertmanager_request.qtpl:13 +//line app/vmalert/notifier/alertmanager_request.qtpl:13 qw422016.N().Q(generatorURL(alert)) -//line notifier/alertmanager_request.qtpl:13 +//line app/vmalert/notifier/alertmanager_request.qtpl:13 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:14 +//line app/vmalert/notifier/alertmanager_request.qtpl:14 if !alert.End.IsZero() { -//line notifier/alertmanager_request.qtpl:14 +//line app/vmalert/notifier/alertmanager_request.qtpl:14 qw422016.N().S(`"endsAt":`) -//line notifier/alertmanager_request.qtpl:15 +//line app/vmalert/notifier/alertmanager_request.qtpl:15 qw422016.N().Q(alert.End.Format(time.RFC3339Nano)) -//line notifier/alertmanager_request.qtpl:15 +//line app/vmalert/notifier/alertmanager_request.qtpl:15 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:16 +//line app/vmalert/notifier/alertmanager_request.qtpl:16 } -//line notifier/alertmanager_request.qtpl:16 +//line app/vmalert/notifier/alertmanager_request.qtpl:16 qw422016.N().S(`"labels": {"alertname":`) -//line notifier/alertmanager_request.qtpl:18 +//line app/vmalert/notifier/alertmanager_request.qtpl:18 qw422016.N().Q(alert.Name) -//line notifier/alertmanager_request.qtpl:19 +//line app/vmalert/notifier/alertmanager_request.qtpl:19 lbls := alert.toPromLabels(relabelCfg) -//line notifier/alertmanager_request.qtpl:20 +//line app/vmalert/notifier/alertmanager_request.qtpl:20 for _, l := range lbls { -//line notifier/alertmanager_request.qtpl:20 +//line app/vmalert/notifier/alertmanager_request.qtpl:20 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().Q(l.Name) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().S(`:`) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().Q(l.Value) -//line notifier/alertmanager_request.qtpl:22 +//line app/vmalert/notifier/alertmanager_request.qtpl:22 } -//line notifier/alertmanager_request.qtpl:22 +//line app/vmalert/notifier/alertmanager_request.qtpl:22 qw422016.N().S(`},"annotations": {`) -//line notifier/alertmanager_request.qtpl:25 +//line app/vmalert/notifier/alertmanager_request.qtpl:25 c := len(alert.Annotations) -//line notifier/alertmanager_request.qtpl:26 +//line app/vmalert/notifier/alertmanager_request.qtpl:26 for k, v := range alert.Annotations { -//line notifier/alertmanager_request.qtpl:27 +//line app/vmalert/notifier/alertmanager_request.qtpl:27 c = c - 1 -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().Q(k) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().S(`:`) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().Q(v) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 if c > 0 { -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 } -//line notifier/alertmanager_request.qtpl:29 +//line app/vmalert/notifier/alertmanager_request.qtpl:29 } -//line notifier/alertmanager_request.qtpl:29 +//line app/vmalert/notifier/alertmanager_request.qtpl:29 qw422016.N().S(`}}`) -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 if i != len(alerts)-1 { -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 } -//line notifier/alertmanager_request.qtpl:33 +//line app/vmalert/notifier/alertmanager_request.qtpl:33 } -//line notifier/alertmanager_request.qtpl:33 +//line app/vmalert/notifier/alertmanager_request.qtpl:33 qw422016.N().S(`]`) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 func writeamRequest(qq422016 qtio422016.Writer, alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) { -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qw422016 := qt422016.AcquireWriter(qq422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 streamamRequest(qw422016, alerts, generatorURL, relabelCfg) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qt422016.ReleaseWriter(qw422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 func amRequest(alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) string { -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qb422016 := qt422016.AcquireByteBuffer() -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 writeamRequest(qb422016, alerts, generatorURL, relabelCfg) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qs422016 := string(qb422016.B) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qt422016.ReleaseByteBuffer(qb422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 return qs422016 -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } diff --git a/app/vmalert/tpl/footer.qtpl.go b/app/vmalert/tpl/footer.qtpl.go index 7100c36bc..fd5a0a1ce 100644 --- a/app/vmalert/tpl/footer.qtpl.go +++ b/app/vmalert/tpl/footer.qtpl.go @@ -1,25 +1,25 @@ // Code generated by qtc from "footer.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 package tpl -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 func StreamFooter(qw422016 *qt422016.Writer) { -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 qw422016.N().S(` @@ -56,31 +56,31 @@ func StreamFooter(qw422016 *qt422016.Writer) { `) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 func WriteFooter(qq422016 qtio422016.Writer) { -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qw422016 := qt422016.AcquireWriter(qq422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 StreamFooter(qw422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qt422016.ReleaseWriter(qw422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 func Footer() string { -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qb422016 := qt422016.AcquireByteBuffer() -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 WriteFooter(qb422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qs422016 := string(qb422016.B) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qt422016.ReleaseByteBuffer(qb422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 return qs422016 -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } diff --git a/app/vmalert/tpl/header.qtpl.go b/app/vmalert/tpl/header.qtpl.go index 386cefac0..1bc0adf7a 100644 --- a/app/vmalert/tpl/header.qtpl.go +++ b/app/vmalert/tpl/header.qtpl.go @@ -1,39 +1,39 @@ // Code generated by qtc from "header.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 package tpl -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) { -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 qw422016.N().S(` vmalert`) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 if title != "" { -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.N().S(` - `) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.E().S(title) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 } -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.N().S(`