mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add back consoles link.
Goes in index.html in consoles or else user data, if present. Change-Id: I5303d30aa24ca0c20d2e0f49121e04a260b9c4f4
This commit is contained in:
parent
dba246e97a
commit
35fb5378bc
|
@ -275,7 +275,7 @@ func dropCommonLabelsImpl(timestamp clientmodel.Timestamp, view *viewAdapter, ar
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, el := range vector {
|
for _, el := range vector {
|
||||||
for k, _ := range el.Metric {
|
for k := range el.Metric {
|
||||||
if _, ok := common[k]; ok {
|
if _, ok := common[k]; ok {
|
||||||
delete(el.Metric, k)
|
delete(el.Metric, k)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="brand" href="/">Prometheus</a>
|
<a class="brand" href="/">Prometheus</a>
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
|
{{$consoles := getConsoles}}
|
||||||
|
{{if $consoles}}
|
||||||
|
<li><a href="{{$consoles}}">Consoles</a></li>
|
||||||
|
{{ end }}
|
||||||
<li><a href="/alerts">Alerts</a></li>
|
<li><a href="/alerts">Alerts</a></li>
|
||||||
<li><a href="/graph">Graph</a></li>
|
<li><a href="/graph">Graph</a></li>
|
||||||
<li><a href="/">Status</a></li>
|
<li><a href="/">Status</a></li>
|
||||||
|
|
15
web/web.go
15
web/web.go
|
@ -132,10 +132,23 @@ func getTemplateFile(name string) (string, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getConsoles() string {
|
||||||
|
if _, err := os.Stat(*consoleTemplatesPath + "/index.html"); !os.IsNotExist(err) {
|
||||||
|
return "/consoles/index.html"
|
||||||
|
}
|
||||||
|
if *userAssetsPath != "" {
|
||||||
|
if _, err := os.Stat(*userAssetsPath + "/index.html"); !os.IsNotExist(err) {
|
||||||
|
return "/user/index.html"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func getTemplate(name string) (t *template.Template, err error) {
|
func getTemplate(name string) (t *template.Template, err error) {
|
||||||
t = template.New("_base")
|
t = template.New("_base")
|
||||||
t.Funcs(template.FuncMap{
|
t.Funcs(template.FuncMap{
|
||||||
"since": time.Since,
|
"since": time.Since,
|
||||||
|
"getConsoles": getConsoles,
|
||||||
})
|
})
|
||||||
file, err := getTemplateFile("_base")
|
file, err := getTemplateFile("_base")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue