2022-06-27 10:12:16 +00:00
|
|
|
{% import (
|
2022-07-06 08:46:01 +00:00
|
|
|
"strings"
|
|
|
|
"net/http"
|
|
|
|
"path"
|
2022-07-08 08:26:13 +00:00
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
2022-06-27 10:12:16 +00:00
|
|
|
) %}
|
|
|
|
|
2022-07-06 08:46:01 +00:00
|
|
|
{% func Header(r *http.Request, navItems []NavItem, title string) %}
|
2022-07-08 08:26:13 +00:00
|
|
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
2021-09-07 19:39:22 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>vmalert{% if title != "" %} - {%s title %}{% endif %}</title>
|
2022-07-06 08:46:01 +00:00
|
|
|
<link href="{%s prefix %}static/css/bootstrap.min.css" rel="stylesheet" />
|
2021-09-07 19:39:22 +00: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 16:02:18 +00:00
|
|
|
.table {
|
|
|
|
table-layout: fixed;
|
|
|
|
}
|
2021-09-07 19:39:22 +00:00
|
|
|
.table .error-cell{
|
|
|
|
word-break: break-word;
|
2022-05-04 16:02:18 +00: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 19:39:22 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-07-06 08:46:01 +00:00
|
|
|
{%= printNavItems(r, title, navItems) %}
|
2021-09-07 19:39:22 +00:00
|
|
|
<main class="px-2">
|
|
|
|
{% endfunc %}
|
2022-07-06 08:46:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
{% code
|
|
|
|
type NavItem struct {
|
|
|
|
Name string
|
|
|
|
Url string
|
|
|
|
}
|
|
|
|
%}
|
|
|
|
|
|
|
|
{% func printNavItems(r *http.Request, current string, items []NavItem) %}
|
|
|
|
{%code
|
|
|
|
prefix := "/vmalert/"
|
|
|
|
if strings.HasPrefix(r.URL.Path, prefix) {
|
|
|
|
prefix = ""
|
|
|
|
}
|
|
|
|
%}
|
|
|
|
<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">
|
|
|
|
{% for _, item := range items %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link{% if current == item.Name %} active{% endif %}" href="{%s path.Join(prefix,item.Url) %}">
|
|
|
|
{%s item.Name %}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
{% endfunc %}
|