2021-09-07 21:39:22 +02:00
|
|
|
// Code generated by qtc from "header.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
2022-05-04 19:26:38 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:1
|
2021-09-07 21:39:22 +02:00
|
|
|
package tpl
|
|
|
|
|
2022-05-04 19:26:38 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:1
|
2022-06-27 12:12:16 +02:00
|
|
|
import (
|
2022-07-06 10:46:01 +02:00
|
|
|
"net/http"
|
2022-08-07 23:28:52 +02:00
|
|
|
"net/url"
|
2022-07-06 10:46:01 +02:00
|
|
|
"path"
|
|
|
|
"strings"
|
2022-07-08 10:26:13 +02:00
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
2022-06-27 12:12:16 +02:00
|
|
|
)
|
|
|
|
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:10
|
2021-09-07 21:39:22 +02:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:10
|
2021-09-07 21:39:22 +02:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:10
|
2022-07-06 10:46:01 +02:00
|
|
|
func StreamHeader(qw422016 *qt422016.Writer, r *http.Request, navItems []NavItem, title string) {
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:10
|
2022-07-08 10:26:13 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:11
|
2022-07-08 10:26:13 +02:00
|
|
|
prefix := utils.Prefix(r.URL.Path)
|
2022-06-27 12:12:16 +02:00
|
|
|
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:11
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>vmalert`)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
if title != "" {
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(` - `)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.E().S(title)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:15
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`</title>
|
2022-06-27 12:12:16 +02:00
|
|
|
<link href="`)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:16
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.E().S(prefix)
|
2022-08-07 23:28:52 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:16
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`static/css/bootstrap.min.css" rel="stylesheet" />
|
2021-09-07 21:39:22 +02:00
|
|
|
<style>
|
|
|
|
body{
|
|
|
|
min-height: 75rem;
|
|
|
|
padding-top: 4.5rem;
|
|
|
|
}
|
|
|
|
.group-heading {
|
|
|
|
cursor: pointer;
|
|
|
|
padding: 5px;
|
|
|
|
margin-top: 5px;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
.group-heading .anchor {
|
|
|
|
position:absolute;
|
|
|
|
top:-60px;
|
|
|
|
}
|
|
|
|
.group-heading span {
|
|
|
|
float: right;
|
|
|
|
margin-left: 5px;
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
.group-heading:hover {
|
|
|
|
background-color: #f8f9fa!important;
|
|
|
|
}
|
2022-05-04 18:02:18 +02:00
|
|
|
.table {
|
|
|
|
table-layout: fixed;
|
|
|
|
}
|
2021-09-07 21:39:22 +02:00
|
|
|
.table .error-cell{
|
|
|
|
word-break: break-word;
|
2022-05-04 18:02:18 +02:00
|
|
|
font-size: 14px;
|
|
|
|
}
|
|
|
|
pre {
|
|
|
|
overflow: scroll;
|
|
|
|
min-height: 30px;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
pre::-webkit-scrollbar {
|
|
|
|
-webkit-appearance: none;
|
|
|
|
width: 0px;
|
|
|
|
height: 5px;
|
|
|
|
}
|
|
|
|
pre::-webkit-scrollbar-thumb {
|
|
|
|
border-radius: 5px;
|
|
|
|
background-color: rgba(0,0,0,.5);
|
|
|
|
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
2022-09-15 12:40:22 +02:00
|
|
|
textarea.curl-area{
|
|
|
|
width: 100%;
|
|
|
|
line-height: 1;
|
|
|
|
font-size: 12px;
|
|
|
|
border: none;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
overflow: scroll;
|
|
|
|
}
|
2021-09-07 21:39:22 +02:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:74
|
2022-07-06 10:46:01 +02:00
|
|
|
streamprintNavItems(qw422016, r, title, navItems)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:74
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<main class="px-2">
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
func WriteHeader(qq422016 qtio422016.Writer, r *http.Request, navItems []NavItem, title string) {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
StreamHeader(qw422016, r, navItems, title)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
func Header(r *http.Request, navItems []NavItem, title string) string {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
WriteHeader(qb422016, r, navItems, title)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
return qs422016
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:76
|
2022-07-06 10:46:01 +02:00
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:80
|
2022-07-06 10:46:01 +02:00
|
|
|
type NavItem struct {
|
|
|
|
Name string
|
|
|
|
Url string
|
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:86
|
2022-07-06 10:46:01 +02:00
|
|
|
func streamprintNavItems(qw422016 *qt422016.Writer, r *http.Request, current string, items []NavItem) {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:86
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:88
|
2022-07-06 10:46:01 +02:00
|
|
|
prefix := "/vmalert/"
|
|
|
|
if strings.HasPrefix(r.URL.Path, prefix) {
|
|
|
|
prefix = ""
|
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:92
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="collapse navbar-collapse" id="navbarCollapse">
|
|
|
|
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:97
|
2022-07-06 10:46:01 +02:00
|
|
|
for _, item := range items {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:97
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li class="nav-item">
|
2022-08-07 23:28:52 +02:00
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:100
|
2022-08-07 23:28:52 +02:00
|
|
|
u, _ := url.Parse(item.Url)
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:101
|
2022-08-07 23:28:52 +02:00
|
|
|
qw422016.N().S(`
|
2022-07-06 10:46:01 +02:00
|
|
|
<a class="nav-link`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:102
|
2022-07-06 10:46:01 +02:00
|
|
|
if current == item.Name {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:102
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(` active`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:102
|
2022-08-07 23:28:52 +02:00
|
|
|
}
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:102
|
2022-08-07 23:28:52 +02:00
|
|
|
qw422016.N().S(`"
|
|
|
|
href="`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-08-07 23:28:52 +02:00
|
|
|
if u.IsAbs() {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-08-07 23:28:52 +02:00
|
|
|
qw422016.E().S(item.Url)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-08-07 23:28:52 +02:00
|
|
|
} else {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-08-07 23:28:52 +02:00
|
|
|
qw422016.E().S(path.Join(prefix, item.Url))
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-07-06 10:46:01 +02:00
|
|
|
}
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:103
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`">
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:104
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.E().S(item.Name)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:104
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:107
|
2022-07-06 10:46:01 +02:00
|
|
|
}
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:107
|
2022-07-06 10:46:01 +02:00
|
|
|
qw422016.N().S(`
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
`)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2022-07-06 10:46:01 +02:00
|
|
|
func writeprintNavItems(qq422016 qtio422016.Writer, r *http.Request, current string, items []NavItem) {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2022-07-06 10:46:01 +02:00
|
|
|
streamprintNavItems(qw422016, r, current, items)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|
|
|
|
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2022-07-06 10:46:01 +02:00
|
|
|
func printNavItems(r *http.Request, current string, items []NavItem) string {
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2022-07-06 10:46:01 +02:00
|
|
|
writeprintNavItems(qb422016, r, current, items)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
return qs422016
|
2022-09-15 12:40:22 +02:00
|
|
|
//line app/vmalert/tpl/header.qtpl:111
|
2021-09-07 21:39:22 +02:00
|
|
|
}
|