mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
fixed not successful rebase in PR, moved svg icons to a sprite and added VM logo to UI <img width="1290" alt="image" src="https://github.com/user-attachments/assets/34cfdc61-6349-4320-b133-38965cb6c30f" /> ### Describe Your Changes Please provide a brief description of the changes you made. Be as specific as possible to help others understand the purpose and impact of your modifications. ### Checklist The following checks are **mandatory**: - [ ] My change adheres to [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/victoriametrics/contributing/).
345 lines
10 KiB
Go
345 lines
10 KiB
Go
// Code generated by qtc from "header.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
//line app/vmalert/tpl/header.qtpl:1
|
|
package tpl
|
|
|
|
//line app/vmalert/tpl/header.qtpl:1
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
"path"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/vmalertutil"
|
|
)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:9
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:9
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:9
|
|
func StreamHeader(qw422016 *qt422016.Writer, r *http.Request, navItems []NavItem, title string, userErr error) {
|
|
//line app/vmalert/tpl/header.qtpl:9
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:10
|
|
prefix := vmalertutil.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:10
|
|
qw422016.N().S(`
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>vmalert`)
|
|
//line app/vmalert/tpl/header.qtpl:14
|
|
if title != "" {
|
|
//line app/vmalert/tpl/header.qtpl:14
|
|
qw422016.N().S(` - `)
|
|
//line app/vmalert/tpl/header.qtpl:14
|
|
qw422016.E().S(title)
|
|
//line app/vmalert/tpl/header.qtpl:14
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:14
|
|
qw422016.N().S(`</title>
|
|
<link href="`)
|
|
//line app/vmalert/tpl/header.qtpl:15
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/tpl/header.qtpl:15
|
|
qw422016.N().S(`static/css/bootstrap.min.css" rel="stylesheet" />
|
|
<link href="`)
|
|
//line app/vmalert/tpl/header.qtpl:16
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/tpl/header.qtpl:16
|
|
qw422016.N().S(`static/css/custom.css" rel="stylesheet" />
|
|
<script src="`)
|
|
//line app/vmalert/tpl/header.qtpl:17
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/tpl/header.qtpl:17
|
|
qw422016.N().S(`static/js/bootstrap.bundle.min.js" type="text/javascript" defer></script>
|
|
<script src="`)
|
|
//line app/vmalert/tpl/header.qtpl:18
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/tpl/header.qtpl:18
|
|
qw422016.N().S(`static/js/custom.js" type="text/javascript" defer></script>
|
|
</head>
|
|
<body>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:21
|
|
streamprintNavItems(qw422016, r, title, navItems, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:21
|
|
qw422016.N().S(`
|
|
<main class="px-4 py-2">
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:23
|
|
streamerrorBody(qw422016, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:23
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
func WriteHeader(qq422016 qtio422016.Writer, r *http.Request, navItems []NavItem, title string, userErr error) {
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
StreamHeader(qw422016, r, navItems, title, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
func Header(r *http.Request, navItems []NavItem, title string, userErr error) string {
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
WriteHeader(qb422016, r, navItems, title, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
return qs422016
|
|
//line app/vmalert/tpl/header.qtpl:24
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:28
|
|
type NavItem struct {
|
|
Name string
|
|
URL string
|
|
Icon string
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:35
|
|
func streamprintNavItems(qw422016 *qt422016.Writer, r *http.Request, current string, items []NavItem, userErr error) {
|
|
//line app/vmalert/tpl/header.qtpl:35
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:36
|
|
prefix := vmalertutil.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:36
|
|
qw422016.N().S(`
|
|
<nav class="navbar navbar-expand navbar-dark fixed-top bg-dark">
|
|
<div class="container-fluid">
|
|
<div class="collapse navbar-collapse" id="navbarCollapse">
|
|
<ul class="navbar-nav me-auto mb-0 align-items-center">
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:41
|
|
for _, item := range items {
|
|
//line app/vmalert/tpl/header.qtpl:41
|
|
qw422016.N().S(`
|
|
<li class="nav-item">
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:44
|
|
u, _ := url.Parse(item.URL)
|
|
|
|
//line app/vmalert/tpl/header.qtpl:45
|
|
qw422016.N().S(`
|
|
<a class="d-flex gap-2 align-items-center nav-link`)
|
|
//line app/vmalert/tpl/header.qtpl:46
|
|
if current == item.Name {
|
|
//line app/vmalert/tpl/header.qtpl:46
|
|
qw422016.N().S(` active`)
|
|
//line app/vmalert/tpl/header.qtpl:46
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:46
|
|
qw422016.N().S(`"
|
|
href="`)
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
if u.IsAbs() {
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
qw422016.E().S(item.URL)
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
} else {
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
qw422016.E().S(path.Join(prefix, item.URL))
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:47
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:48
|
|
if item.Icon != "" {
|
|
//line app/vmalert/tpl/header.qtpl:48
|
|
qw422016.N().S(`
|
|
<svg width="40" height="40"><use href="`)
|
|
//line app/vmalert/tpl/header.qtpl:49
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/tpl/header.qtpl:49
|
|
qw422016.N().S(`static/icons/icons.svg#`)
|
|
//line app/vmalert/tpl/header.qtpl:49
|
|
qw422016.E().S(item.Icon)
|
|
//line app/vmalert/tpl/header.qtpl:49
|
|
qw422016.N().S(`"></svg>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:50
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:50
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:51
|
|
qw422016.E().S(item.Name)
|
|
//line app/vmalert/tpl/header.qtpl:51
|
|
qw422016.N().S(`
|
|
</a>
|
|
</li>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:54
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:54
|
|
qw422016.N().S(`
|
|
</ul>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:57
|
|
streamerrorIcon(qw422016, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:57
|
|
qw422016.N().S(`
|
|
</nav>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
func writeprintNavItems(qq422016 qtio422016.Writer, r *http.Request, current string, items []NavItem, userErr error) {
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
streamprintNavItems(qw422016, r, current, items, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
func printNavItems(r *http.Request, current string, items []NavItem, userErr error) string {
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
writeprintNavItems(qb422016, r, current, items, userErr)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
return qs422016
|
|
//line app/vmalert/tpl/header.qtpl:59
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:61
|
|
func streamerrorIcon(qw422016 *qt422016.Writer, err error) {
|
|
//line app/vmalert/tpl/header.qtpl:61
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:62
|
|
if err != nil {
|
|
//line app/vmalert/tpl/header.qtpl:62
|
|
qw422016.N().S(`
|
|
<div class="d-flex" data-bs-toggle="tooltip" data-bs-placement="left" title="Configuration file failed to reload! Click to see more details.">
|
|
<a type="button" data-bs-toggle="collapse" href="#reload-groups-error">
|
|
<span class="text-danger">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill" viewBox="0 0 16 16">
|
|
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
|
</svg>
|
|
</span>
|
|
</a>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:72
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:72
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
func writeerrorIcon(qq422016 qtio422016.Writer, err error) {
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
streamerrorIcon(qw422016, err)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
func errorIcon(err error) string {
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
writeerrorIcon(qb422016, err)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
return qs422016
|
|
//line app/vmalert/tpl/header.qtpl:73
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:75
|
|
func streamerrorBody(qw422016 *qt422016.Writer, err error) {
|
|
//line app/vmalert/tpl/header.qtpl:75
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:76
|
|
if err != nil {
|
|
//line app/vmalert/tpl/header.qtpl:76
|
|
qw422016.N().S(`
|
|
<div class="collapse mt-2 mb-2" id="reload-groups-error">
|
|
<div class="card card-body">
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:79
|
|
qw422016.E().S(err.Error())
|
|
//line app/vmalert/tpl/header.qtpl:79
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:82
|
|
}
|
|
//line app/vmalert/tpl/header.qtpl:82
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
func writeerrorBody(qq422016 qtio422016.Writer, err error) {
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
streamerrorBody(qw422016, err)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
}
|
|
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
func errorBody(err error) string {
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
writeerrorBody(qb422016, err)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
return qs422016
|
|
//line app/vmalert/tpl/header.qtpl:83
|
|
}
|