File: template.html

package info (click to toggle)
prometheus-pushgateway 1.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,348 kB
  • sloc: javascript: 119; sh: 54; makefile: 40
file content (281 lines) | stat: -rw-r--r-- 11,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!DOCTYPE html>
{{/*
Copyright 2014 The Prometheus Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="robots" content="noindex,nofollow">
	<title>Prometheus Pushgateway</title>
	
	<link rel="shortcut icon" href="{{.PathPrefix}}/static/favicon.ico?v={{.BuildInfo.revision}}">
	
	<script src="{{.PathPrefix}}/static/jquery/jquery.min.js?v={{.BuildInfo.revision}}"></script>
	<script src="{{.PathPrefix}}/static/bootstrap4/js/bootstrap.min.js?v={{.BuildInfo.revision}}"></script>
	<script src="{{.PathPrefix}}/static/functions.js?v={{.BuildInfo.revision}}"></script>
	
	<link type="text/css" rel="stylesheet" href="{{.PathPrefix}}/static/bootstrap4/css/bootstrap.min.css?v={{.BuildInfo.revision}}">
	<link type="text/css" rel="stylesheet" href="{{.PathPrefix}}/static/prometheus.css?v={{.BuildInfo.revision}}">
	<link type="text/css" rel="stylesheet" href="{{.PathPrefix}}/static/bootstrap4-glyphicons/css/bootstrap-glyphicons.css?v={{.BuildInfo.revision}}">
</head>

<body>
	<nav class="navbar fixed-top navbar-expand-sm navbar-dark bg-dark">
		<div class="container-fluid">
			<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#nav-content" aria-expanded="false" aria-controls="nav-content" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<a class="navbar-brand" href="#">Pushgateway</a>
			<!-- Collect the nav links, forms, and other content for toggling -->
			<div id="nav-content" class="navbar-collapse collapse">
				<ul class="navbar-nav">
					<li class="nav-item active" onclick="pushgateway.switchToMetrics()" id="metrics-li">
						<a class="nav-link" href="#">Metrics</a>
					</li>
					<li class="nav-item" onclick="pushgateway.switchToStatus()" id="status-li">
						<a class="nav-link" href="#">Status</a>
					</li>
					<li class="nav-item" >
						<a class ="nav-link" href="https://github.com/prometheus/pushgateway/blob/master/README.md" target="_blank">Help</a>
					</li>
				</ul>
			</div>
		</div>
	</nav>
	<div class="container-fluid" id="metrics-div">
		{{- $data := .}}
		{{- if eq (index .Flags "web.enable-admin-api") "true"}}
		<div class="blank-card">
			<button class="btn btn-xs btn-danger float-right {{if le (len .MetricGroups) 0}}disabled{{end}}" onclick="pushgateway.showDelAllModal()" id="del-all">Delete All <span class="badge badge-warning" id="del-all-counter">{{.MetricGroups | len}}</span> Groups</button>
		</div>
		{{- end}}
		<div class="accordion" id="job-accordion">
	{{- range .MetricGroups}}
	{{- $gCount := $data.Count}}
	<div class="card">
		<div class="card-header" id="group-panel-{{$gCount}}">
			<h2 class="mb-0">
				<button class="btn btn-secondary collapsed" type="button" data-toggle="collapse" data-target="#j-{{$gCount}}" aria-expanded="false" aria-controls="j-{{$gCount}}">
					<span class="toggle-icon glyphicon glyphicon-collapse-down"></span>
					{{- $metricGroup := .}}
					{{- range $i, $ln := .SortedLabels}}
					<span class="badge {{if eq $ln "job"}}badge-warning{{else if eq $ln "instance"}}badge-primary{{else}}badge-info{{end}}">{{formatLabelName $ln}}="{{index $metricGroup.Labels $ln}}"</span>
					{{- end}}
				</button>
				{{- if not $metricGroup.LastPushSuccess}}<span class="badge badge-pill badge-danger" role="alert">Last push failed!</span>{{end}}
				<button class="btn btn-xs btn-danger float-right" onclick="pushgateway.showDelModal({ {{range $i, $ln := .SortedLabels}}{{if $i}}, {{end}}'{{$ln}}': '{{index $metricGroup.Labels $ln}}'{{end}} }, { {{range $i, $ln := .SortedLabels}}{{if $i}}, {{end}}'{{$ln}}': '{{index $metricGroup.Labels $ln | base64}}'{{end}} }, 'group-panel-{{$gCount}}', event)">Delete Group</button>
			</h2>
		</div>
		<div id="j-{{$gCount}}" class="collapse" aria-labelledby="group-panel-{{$gCount}}" data-parent="#job-accordion">
			<div class="card-body">
				<div class="accordion" id="metric-accordion-{{$gCount}}">
	{{- range $name, $tmf := .Metrics }}
	{{- $mCount := $data.Count}}
	<div class="card">
		<div class="card-header" id="metric-panel-{{$mCount}}">
			<h2 class="mb-0">
				<button class="btn btn-secondary collapsed" type="button" data-toggle="collapse" data-target="#m-{{$mCount}}" aria-expanded="false" aria-controls="#m-{{$mCount}}" style="text-align:left">
					<span class="toggle-icon glyphicon glyphicon-collapse-down"></span>
					{{- $name}}
					<span class="badge badge-light">{{$tmf.GetMetricFamily.GetHelp}}</span>
					<span class="badge badge-success">{{$tmf.GetMetricFamily.GetType}}</span>
					last pushed: {{$tmf.Timestamp | timeFormat }}
				</button>
			</h2>
		</div>
		<div id="m-{{$mCount}}" class="collapse" aria-labelledby="metric-panel-{{$mCount}}" data-parent="#metric-accordion-{{$gCount}}" >
			<div class="card-body" style="max-width: 100%; overflow-x: auto">
				<table class="table table-striped table-bordered">
					<thead>
						<tr>
							<th>Labels</th>
							<th>Value</th>
						</tr>
					</thead>
					<tbody>
	{{- range $tmf.GetMetricFamily.Metric}}
	<tr>
		<td>
			{{- range .Label}}
			<span class="badge {{if eq .GetName "job"}}badge-warning{{else if eq .GetName "instance"}}badge-primary{{else}}badge-info{{end}}">{{formatLabelName .Name}}="{{.GetValue}}"</span>
			{{- end}}
		</td>
		<td>
			{{- with .Gauge}}
			{{- value .GetValue}}
			{{- else}}
			{{- with .Counter}}
			{{- value .GetValue}}
			{{- else}}
			{{- with .Untyped}}
			{{- value .GetValue}}
			{{- else}}
			{{- with .Summary}}
			<table class="table table-striped table-bordered">
				{{- range .Quantile}}
				<tr>
					<th scope="row">Quantile {{.GetQuantile}}</th>
					<td>{{value .GetValue}}</td>
				</tr>
				{{- end}}
				<tr>
					<th scope="row">Sample Count</th>
					<td>{{.GetSampleCount}}</td>
				</tr>
				<tr>
					<th scope="row">Sample Sum</th>
					<td>{{value .GetSampleSum}}</td>
				</tr>
			</table>
			{{- else}}
                        {{- $h := .Histogram}}
			{{- with .Histogram}}
                        {{- $numBuckets := len .Bucket}}
                        {{- $numNBuckets := add (len .PositiveSpan) (len .NegativeSpan)}}
			<table class="table table-striped table-bordered">
                                {{- if gt $numNBuckets 0}}
				<tr>
                                    <th scope="row">Native Histogram representation</th>
                                    <td>{{formatHistogram $h}}</td>
				</tr>
                                {{- end}}
                                {{- if gt $numBuckets 0}}
                                        {{- range .Bucket}}
                                        <tr>
                                                <th scope="row">Sample values &le; {{value .GetUpperBound}}</th>
                                                <td>{{.GetCumulativeCount}}</td>
                                        </tr>
                                        {{- end}}
                                        <tr>
                                                <th scope="row">Total sample Count</th>
                                                <td>{{.GetSampleCount}}</td>
                                        </tr>
                                        <tr>
                                                <th scope="row">Sample Sum</th>
                                                <td>{{value .GetSampleSum}}</td>
                                        </tr>
                                {{- end}}
                                {{- if eq (add $numNBuckets $numBuckets) 0}}
                                        <tr>
                                                <th scope="row">Total sample Count</th>
                                                <td>{{.GetSampleCount}}</td>
                                        </tr>
                                        <tr>
                                                <th scope="row">Sample Sum</th>
                                                <td>{{value .GetSampleSum}}</td>
                                        </tr>
                                {{- end}}
			</table>
			{{- end}}
			{{- end}}
			{{- end}}
			{{- end}}
			{{- end}}
		</td>
	</tr>
	{{- end}}
	</tbody>
				</table>
			</div>
		</div>
	</div>
	{{- end}}
				</div>
			</div>
		</div>
	</div>
	{{- end}}
		</div>
	</div>

	<div class="container-fluid" id="status-div" style="display: none;">
		<h2>Runtime Information</h2>
		<table class="table table-condensed table-bordered table-striped">
			<tbody>
				<tr>
					<th>Started</th>
					<td>{{.Birth}}</td>
				</tr>
			</tbody>
		</table>
		
		<h2>Build Information</h2>
		<table class="table table-condensed table-bordered table-striped">
			<tbody>
				{{- range $key, $value := .BuildInfo}}
				<tr>
					<th scope="row">{{$key}}</th>
					<td>{{$value}}</td>
				</tr>
				{{- end}}
			</tbody>
		</table>
		
		<h2>Startup Flags</h2>
		<table class="table table-condensed table-bordered table-striped">
			<tbody>
				{{- range $key, $value := .Flags}}
				<tr>
					<th scope="row">{{$key}}</th>
					<td>{{$value}}</td>
				</tr>
				{{- end}}
			</tbody>
		</table>
	</div>
	
	<!-- del modal -->
	<div id="del-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="del-header" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title">Deletion Confirmation</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body">
					<p id="del-modal-msg"><!-- To be filled dynamically. --></p>
				</div>
				<div class="modal-footer">
					<button class="btn btn-secondary" data-dismiss="modal">Cancel</button>
					<button class="btn btn-primary btn-danger" onclick="pushgateway.deleteGroup()">Delete</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- del ALL modal -->
	<div id="del-all-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="del-header" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title">Deletion Confirmation</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body">
					<p id="del-modal-all-msg"><!-- To be filled dynamically. --></p>
				</div>
				<div class="modal-footer">
					<button class="btn btn-secondary" data-dismiss="modal">Cancel</button>
					<button class="btn btn-primary btn-danger" onclick="pushgateway.deleteAllGroup()">Delete All</button>
				</div>
			</div>
		</div>
	</div>
	
</body>
</html>