2014-11-20 10:41:25 -08:00
|
|
|
{{/* vim: set ft=html: */}}
|
|
|
|
{{/* Load Prometheus console library JS/CSS. Should go in <head> */}}
|
|
|
|
{{define "prom_console_head"}}
|
|
|
|
<link type="text/css" rel="stylesheet" href="/static/vendor/rickshaw/rickshaw.min.css">
|
2015-01-22 02:39:41 -08:00
|
|
|
<link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.css">
|
2014-11-20 10:41:25 -08:00
|
|
|
<link type="text/css" rel="stylesheet" href="/static/css/prom_console.css">
|
|
|
|
<script src="/static/vendor/rickshaw/vendor/d3.min.js"></script>
|
|
|
|
<script src="/static/vendor/rickshaw/vendor/d3.layout.min.js"></script>
|
|
|
|
<script src="/static/vendor/rickshaw/rickshaw.min.js"></script>
|
|
|
|
<script src="/static/vendor/js/jquery.min.js"></script>
|
2015-01-22 02:39:41 -08:00
|
|
|
<script src="/static/vendor/bootstrap-3.3.1/js/bootstrap.min.js"></script>
|
2014-11-20 10:41:25 -08:00
|
|
|
<script src="/static/js/prom_console.js"></script>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{/* Top of all pages. */}}
|
|
|
|
{{define "head"}}
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
{{template "prom_console_head"}}
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
{{template "navbar" .}}
|
|
|
|
{{template "menu" .}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ define "__prom_query_drilldown_noop" }}{{ . }}{{ end }}
|
|
|
|
{{ define "humanize" }}{{ humanize . }}{{ end }}
|
|
|
|
{{ define "humanizeNoSmallPrefix" }}{{ if and (lt . 1.0) (gt . -1.0) }}{{ printf "%.3g" . }}{{ else }}{{ humanize . }}{{ end }}{{ end }}
|
|
|
|
{{ define "humanize1024" }}{{ humanize1024 . }}{{ end }}
|
|
|
|
{{ define "humanizeDuration" }}{{ humanizeDuration . }}{{ end }}
|
|
|
|
{{ define "printf.3g" }}{{ printf "%.3g" . }}{{ end }}
|
|
|
|
|
|
|
|
{{/* prom_query_drilldown (args expr suffix? renderTemplate?)
|
|
|
|
Displays the result of the expression, with a link to /graph for it.
|
|
|
|
|
|
|
|
renderTemplate is the name of the template to use to render the value.
|
|
|
|
*/}}
|
|
|
|
{{ define "prom_query_drilldown" }}
|
|
|
|
{{ $expr := .arg0}}{{ $suffix := (or .arg1 "")}}{{ $renderTemplate := (or .arg2 "__prom_query_drilldown_noop")}}
|
|
|
|
<a class="prom_query_drilldown" href="{{ graphLink $expr }}">{{ with query $expr }}{{tmpl $renderTemplate ( . | first | value )}}{{ $suffix }}{{else}}-{{ end }}</a>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "prom_path" }}/consoles/{{.Path}}?{{range $param, $value := .Params}}{{$param}}={{$value}}&{{end}}{{ end }}"
|
|
|
|
|
|
|
|
{{define "prom_right_table_head"}}
|
|
|
|
<div class="prom_console_rhs">
|
|
|
|
<table class="table table-bordered table-hover table-condensed">
|
|
|
|
{{end}}
|
|
|
|
{{define "prom_right_table_tail"}}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "prom_content_head"}}
|
|
|
|
<div class="prom_console_content">
|
2015-01-22 02:39:41 -08:00
|
|
|
<div class="container">
|
2014-11-20 10:41:25 -08:00
|
|
|
{{template "prom_graph_timecontrol" .}}
|
|
|
|
{{end}}
|
|
|
|
{{define "prom_content_tail"}}
|
2015-01-22 02:39:41 -08:00
|
|
|
</div>
|
2014-11-20 10:41:25 -08:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "prom_graph_timecontrol"}}
|
|
|
|
<div class="prom_graph_timecontrol">
|
|
|
|
<div class="prom_graph_timecontrol_inner">
|
2015-01-22 02:39:41 -08:00
|
|
|
<div class="prom_graph_timecontrol_group">
|
|
|
|
<button class="btn btn-default pull-left" type="button" id="prom_graph_duration_shrink" title="Shrink the time range.">
|
|
|
|
<i class="glyphicon glyphicon-minus"></i>
|
2014-11-20 10:41:25 -08:00
|
|
|
</button>
|
2015-01-22 02:39:41 -08:00
|
|
|
<input class="input pull-left" size="3" title="Time range of graph" type="text" id="prom_graph_duration">
|
|
|
|
<button class="btn btn-default pull-left" type="button" id="prom_graph_duration_grow" title="Grow the time range.">
|
|
|
|
<i class="glyphicon glyphicon-plus"></i>
|
2014-11-20 10:41:25 -08:00
|
|
|
</button>
|
|
|
|
</div>
|
2015-01-22 02:39:41 -08:00
|
|
|
|
|
|
|
<div class="prom_graph_timecontrol_group">
|
|
|
|
<button class="btn btn-default pull-left" type="button" id="prom_graph_time_back" title="Rewind the end time.">
|
|
|
|
<i class="glyphicon glyphicon-backward"></i>
|
2014-11-20 10:41:25 -08:00
|
|
|
</button>
|
2015-01-22 02:39:41 -08:00
|
|
|
<input class="input pull-left" title="End time of graph" placeholder="Until" type="text" id="prom_graph_time_end" size="16" value="">
|
|
|
|
<button class="btn btn-default pull-left" type="button" id="prom_graph_time_forward" title="Advance the end time.">
|
|
|
|
<i class="glyphicon glyphicon-forward"></i>
|
2014-11-20 10:41:25 -08:00
|
|
|
</button>
|
2015-01-22 02:39:41 -08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="prom_graph_timecontrol_group">
|
|
|
|
<div class="btn-group dropup prom_graph_timecontrol_refresh pull-left">
|
|
|
|
<button type="button" class="btn btn-default pull-left" id="prom_graph_refresh_button" title="Refresh.">
|
|
|
|
<i class="glyphicon glyphicon-repeat"></i>
|
|
|
|
<span class="icon-repeat"></span>
|
|
|
|
(<span id="prom_graph_refresh_button_value">Off</span>)
|
2014-11-20 10:41:25 -08:00
|
|
|
</button>
|
2015-01-22 02:39:41 -08:00
|
|
|
<button type="button" class="btn btn-default pull-left dropdown-toggle" data-toggle="dropdown" title="Set autorefresh." aria-expanded="false">
|
2014-11-20 10:41:25 -08:00
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu" id="prom_graph_refresh_intervals" role="menu">
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
new PromConsole.TimeControl();
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{/* Bottom of all pages. */}}
|
|
|
|
{{define "tail"}}
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
{{end}}
|