2014-11-20 18:41:25 +00:00
|
|
|
{{/* vim: set ft=html: */}}
|
|
|
|
|
|
|
|
{{/* Navbar, should be passed . */}}
|
|
|
|
{{ define "navbar" }}
|
2019-02-07 21:18:09 +00:00
|
|
|
<nav class="navbar fixed-top navbar-expand-sm navbar-dark bg-dark">
|
2015-01-22 10:39:41 +00:00
|
|
|
<div class="container-fluid">
|
|
|
|
<!-- Brand and toggle get grouped for better mobile display -->
|
|
|
|
<div class="navbar-header">
|
2019-02-07 21:18:09 +00:00
|
|
|
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" aria-controls="navbar-nav" aria-label="toggle navigation">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-22 10:39:41 +00:00
|
|
|
</button>
|
2015-06-18 17:25:19 +00:00
|
|
|
<a class="navbar-brand" href="{{ pathPrefix }}/">Prometheus</a>
|
2015-01-22 10:39:41 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
|
|
|
<ul class="nav navbar-nav">
|
2019-02-07 21:18:09 +00:00
|
|
|
<li class="nav-item"><a class="nav-link" href="{{ pathPrefix }}/alerts">Alerts</a></li>
|
|
|
|
<li class="nav-item"><a class="nav-link" href="https://www.pagerduty.com/">PagerDuty</a></li>
|
2019-02-18 13:14:58 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2014-11-20 18:41:25 +00:00
|
|
|
</div>
|
2015-01-22 10:39:41 +00:00
|
|
|
</nav>
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{/* LHS menu, should be passed . */}}
|
|
|
|
{{ define "menu" }}
|
2019-02-07 21:18:09 +00:00
|
|
|
<div class="prom_lhs_menu row">
|
|
|
|
<nav class="col-md-2 md-block bg-dark sidebar prom_lhs_menu_nav">
|
|
|
|
<div class="sidebar-sticky">
|
|
|
|
<ul class="nav flex-column">
|
|
|
|
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ template "_menuItem" (args . "index.html.example" "Overview") }}
|
2015-01-23 17:40:48 +00:00
|
|
|
|
|
|
|
{{ if query "up{job='node'}" }}
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ template "_menuItem" (args . "node.html" "Node") }}
|
|
|
|
{{ if match "^node" .Path }}
|
|
|
|
{{ if .Params.instance }}
|
2015-01-22 10:39:41 +00:00
|
|
|
<ul>
|
2019-02-07 21:18:09 +00:00
|
|
|
<li {{ if eq .Path "node-overview.html" }}class="prom_lhs_menu_selected nav-item"{{ end }}>
|
|
|
|
<a class="nav-link" href="node-overview.html?instance={{ .Params.instance }}">{{ reReplaceAll "(.*?://)([^:/]+?)(:\\d+)?/.*" "$2" .Params.instance }}</a>
|
2014-11-20 18:41:25 +00:00
|
|
|
</li>
|
|
|
|
<ul>
|
2019-02-07 21:18:09 +00:00
|
|
|
<li {{ if eq .Path "node-cpu.html" }}class="prom_lhs_menu_selected nav-item"{{ end }}>
|
|
|
|
<a class="nav-link" href="node-cpu.html?instance={{ .Params.instance }}">CPU</a>
|
2014-11-20 18:41:25 +00:00
|
|
|
</li>
|
2019-02-07 21:18:09 +00:00
|
|
|
<li {{ if eq .Path "node-disk.html" }}class="prom_lhs_menu_selected nav-item"{{ end }}>
|
|
|
|
<a class="nav-link" href="node-disk.html?instance={{ .Params.instance }}">Disk</a>
|
2014-11-20 18:41:25 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
2015-01-22 10:39:41 +00:00
|
|
|
{{ end }}
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ end }}
|
2015-01-23 17:40:48 +00:00
|
|
|
{{ end }}
|
|
|
|
|
2015-08-07 15:09:16 +00:00
|
|
|
{{ if query "up{job='prometheus'}" }}
|
|
|
|
{{ template "_menuItem" (args . "prometheus.html" "Prometheus") }}
|
|
|
|
{{ if match "^prometheus" .Path }}
|
|
|
|
{{ if .Params.instance }}
|
|
|
|
<ul>
|
2019-02-07 21:18:09 +00:00
|
|
|
<li {{ if eq .Path "prometheus-overview.html" }}class="prom_lhs_menu_selected nav-item"{{ end }}>
|
|
|
|
<a class="nav-link" href="prometheus-overview.html?instance={{ .Params.instance }}">{{.Params.instance }}</a>
|
2015-08-07 15:09:16 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
2014-11-20 18:41:25 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2019-02-07 21:18:09 +00:00
|
|
|
</nav>
|
|
|
|
</div>
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{/* Helper, pass (args . path name) */}}
|
|
|
|
{{ define "_menuItem" }}
|
2019-02-07 21:18:09 +00:00
|
|
|
<li {{ if eq .arg0.Path .arg1 }} class="prom_lhs_menu_selected nav-item" {{ end }}><a class="nav-link" href="{{ .arg1 }}">{{ .arg2 }}</a></li>
|
2014-11-20 18:41:25 +00:00
|
|
|
{{ end }}
|
|
|
|
|