forked from ezbz/graphitus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashboard.html
426 lines (420 loc) · 24 KB
/
dashboard.html
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/css/base/jquery.ui.all.min.css" type="text/css" />
<link href="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.1/select2.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-lightbox/0.5/bootstrap-lightbox.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/rickshaw/1.3.0/rickshaw.min.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/graphitus.css">
<link type="text/css" rel="stylesheet" href="css/graph.css">
<link type="text/css" rel="stylesheet" href="css/detail.css">
<link type="text/css" rel="stylesheet" href="css/legend.css">
<link type="text/css" rel="stylesheet" href="css/extensions.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.1/select2.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.3.1/jquery.cookie.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.3.9/d3.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/rickshaw/1.3.0/rickshaw.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-lightbox/0.5/bootstrap-lightbox.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.4.0/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.0.3/moment-timezone.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/slidesjs/3.0/jquery.slides.min.js"></script>
<script src="js/moment-timezone-data.js"></script>
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="js/jquery.waitforimages.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/dashboard.js"></script>
<script type="text/javascript" src="js/extensions.js"></script>
<script type="text/javascript" src="js/extended-graph.js"></script>
<script type="text/javascript" src="js/histogram.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>
<script type="text/javascript" src="js/grafana.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
loadGraphitusConfig(renderGraphitus);
});
</script>
<script type="text/template" id="tmpl-dashboards-view">
<% for (idx in config.data) { %>
<% for(col=0; col<config.columns; col++) { %>
<% if( (idx % config.columns) == col) { %>
<div id="item<%=idx%>" class="well span<%=12/config.columns%>" style="width:<%=config.width%>px">
<h5 class="pull-left" style="margin: 0px;">
<span id="title<%=idx%>"></span>
<% if(config.data[idx].description){ %>
<a href="#" rel="tooltip" data-toggle="tooltip" title="<%=applyParameters(config.data[idx].description)%>"><i class="fa fa-question-circle"/></a>
<% } %>
</h5>
<div class="pull-right">
<div class="pull-left btn-group">
<a class="btn btn-small btn-success dropdown-toggle hspacer" data-toggle="dropdown" href="#" title="Functions..."><i class="fa fa-lg fa-cogs"></i><span class="fa fa-lg fa-caret-down"></span></a>
<ul class="dropdown-menu">
<li>
<input id="yMin<%=idx%>" type="text" class="input-mini hspacer" placeholder="yMin">
<label class="pull-right hspacer">
<a target="_blank" class="label label-info pull-left" href="http://graphite.readthedocs.org/en/1.0/url-api.html"><i class="fa fa-question-circle"></i> Help</a>
</label>
</li>
<li>
<input id="yMax<%=idx%>" type="text" class="input-mini hspacer" placeholder="yMax">
</li>
<li>
<input id="otherUrlParamName<%=idx%>" type="text" class="input-mini hspacer" placeholder="name">
<input id="otherUrlParamValue<%=idx%>" type="text" class="input-mini hspacer" placeholder="value">
</li>
<li>
<label>
<button class="btn btn-small btn-primary pull-right hspacer" onclick="updateGraph(<%=idx%>);">Update</button>
</label>
</li>
</ul>
</div>
<div class="pull-left btn-group">
<a class="btn btn-small btn-warning dropdown-toggle hspacer" data-toggle="dropdown" href="#" title="Images..."><i class="fa fa-lg fa-picture-o"></i><span class="fa fa-lg fa-caret-down"></span></a>
<ul class="dropdown-menu">
<li class="navbar-text"><a id="lLink<%=idx%>" href="#" target="_blank"><i class="fa fa-lg fa-picture-o"></i> large</a></li>
<li class="navbar-text"><a id="mLink<%=idx%>" href="#" target="_blank"><i class="fa fa-lg fa-picture-o"></i> medium</a></li>
<li class="navbar-text"><a id="sLink<%=idx%>" href="#" target="_blank"><i class="fa fa-lg fa-picture-o"></i> small</a></li>
</ul>
</div>
<div class="pull-right">
<a href="#" class="btn btn-small btn-primary pull-right hspacer" onclick="toggleSource(<%=idx%>); return false;" title="Source"><i class="fa fa-lg fa-list"></i></a>
<a id="gLink<%=idx%>" href="#" title="Graphlot"><button class="btn btn-small btn-info pull-right hspacer"><i class="fa fa-lg fa-signal"></i></button></a>
<a href="#" class="btn btn-small pull-right hspacer" onclick="showHistogram(<%=idx%>); return false;" title="Histogram"><i class="fa fa-lg fa-bar-chart-o"></i></a>
</div>
</div>
<br/>
<a href="#" onclick1="showExtendedGraph(<%=idx%>); return false;"><img id="img<%=idx%>" class="img-rounded" width="<%=config.width%>" height="<%=config.height%>"/></a>
<br/>
<div id="sourceContainer<%=idx%>"class="hide">
<div><textarea id="source<%=idx%>" style="width:<%=config.width-10%>px" class="source" placeholder="Target Source"></textarea></div>
<div><input type="text" id="graphParams<%=idx%>" style="width:<%=config.width-10%>px" placeholder="Additional URL Parameters" class="source"/></div>
<button class="btn btn-small" onclick="updateSource(<%=idx%>);">Update</button>
</div>
</div>
<% } %>
<% } %>
<% } %>
</script>
<script type="text/template" id="tmpl-dashboards-menu">
<% if(isLeaf){ %>
<li>
<a href="dashboard.html?id=<%= path %>"><%= name %></a>
</li>
<% }else{ %>
<li class="dropdown-submenu">
<a tabindex="-1" href="#"><%= name %></a>
<ul class="dropdown-menu">
<% for (node in dashboardsRoot) { %>
<%= generateDashboardsMenu(node, path + "." + node, dashboardsRoot[node], depth++) %>
<% } %>
</ul>
</li>
<% } %>
</script>
<script type="text/template" id="tmpl-toolbar">
<a class="brand hidden-zoom1" href="index.html"> graphitus</a>
<ul class="nav">
<li class="dropdown hidden-zoom3">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= title %><b class="fa fa-lg fa-caret-down"></b></a>
<ul id="dashboards" class="dropdown-menu">
<%= dashboardsMenu %>
</ul>
</li>
<li class="navbar-text"><div><i class="fa fa-lg fa-link"></i> <a href="#" title="permalink" id="permalink">permalink </a></div></li>
<li class="divider-vertical"></li>
<li class="navbar-text"><div><i class="fa fa-lg fa-play active-hover" id="playSlideshow" title="start slideshow" onclick="startSlideshow();"></i><i class="fa fa-lg fa-stop hide active-hover" id="stopSlideshow" title="stop slideshow" onclick="stopSlideshow();"></i></div></li>
</li>
<li class="divider-vertical"></li>
<li class="hidden-zoom2">
<form class="navbar-search form-inline pull-right">
<input id="search" type="text" style="margin-top: 0px;" class="search-query input-small" placeholder="Search" />
</form>
</li>
<li class="divider-vertical"></li>
<li class="navbar-text"><i class="fa fa-lg fa-clock-o"></i> Back</li>
<li class="divider-vertical"></li>
<li><input placeholder="back" type="text" class="input-mini" style="width: 30px;" id="timeBack" name="timeBack" value="<%= (config.timeBack) ? config.timeBack : "" %>" onchange="useHours()" /></li>
<li class="divider-vertical"></li>
<li class="navbar-text"></li>
<li class="divider-vertical"></li>
<li class="navbar-text"><i class="fa fa-lg fa-calendar"></i> Dates </li>
<li class="divider-vertical"></li>
<li><input type="text" class="input-small" placeholder="start date" id="start" name="start" value="<%= (config.from) ? config.from : ""%>" onchange="useDateRange()" /></li>
<li class="divider-vertical"></li>
<li><input type="text" class="input-small" placeholder="end date" id="end" name="end" value="<%=(config.until) ? config.until : ""%>" onchange="useDateRange()" /></li>
<li class="divider-vertical"></li>
<li class="dropdown hidden-zoom4">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-lg fa-cog"></i> Options<b class="fa fa-lg fa-caret-down"></b></a>
<ul id="options" class="dropdown-menu" style="width: 200px;">
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="average" name="average" <% if(config.averageSeries) { %>checked="checked"<% } %> onchange="updateGraphs()" />Average Series
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="n50percentile" name="n50percentile" <% if(config.n50percentile) { %>checked="checked"<% } %> onchange="updateGraphs()" />50 percentile
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="n95percentile" name="n95percentile" <% if(config.n95percentile) { %>checked="checked"<% } %> onchange="updateGraphs()" />95 percentile
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="n99percentile" name="n99percentile" <% if(config.n99percentile) { %>checked="checked"<% } %> onchange="updateGraphs()" />99 percentile
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="sum" name="sum" <% if(config.sumSeries) { %>checked="checked"<% } %> onchange="updateGraphs()" />Sum Series
</label>
</li>
<li class="divider"></li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="legend" name="legend" <% if(config.legend && config.legend!=="false") {%> checked="checked" <% } %> onchange="updateGraphs()" /> Show Legend
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="events" name="events" <% if(config.showEvents && config.showEvents!=="false") {%> checked="checked" <% } %> onchange="updateGraphs()" /> Show Events
</label>
</li>
<li>
<label class="checkbox" style="margin: 10px">
<input type="checkbox" id="refresh" name="refresh" <% if(config.refresh) { %>checked="checked"<% } %> onchange="toggleAutoRefresh();" />Auto Refresh
</label>
</li>
<li class="divider"></li>
<li>
<label class="select" style="margin-left: 10px;"> Time Zone: </label>
<div class="pull-right" style="margin-right: 10px;margin-bottom: 10px;">
<select id="tz" onchange="setTimezone();" name="tz" class="input input-medium" style="margin-top: 0px;">
<% for(timezone in graphitusConfig.timezones){ %>
<option value="<%=graphitusConfig.timezones[timezone]%>"><%=graphitusConfig.timezones[timezone]%></option>
<% } %>
</select>
</div>
</li>
<li class="divider"></li>
<li class="navbar-text"><center><li class="navbar-text"><button class="btn btn-small btn-primary" onclick="generateGrafanaConfig(); return false;"><i class="fa fa-sign-out active-hover"></i> Export to Grafana</button></center>
</li>
<li class="navbar-text"><center><li class="navbar-text"><button class="btn btn-small btn-warning" onclick="downloadGrafanaConfig(); return false;"><i class="fa fa-download active-hover"></i> Download Grafana Config</button></center>
</li>
</ul>
</li>
<li class="divider-vertical"></li>
<li>
<button class="btn btn-small btn-primary pull-right hspacer" style="margin-top:8px" onclick="updateGraphs();return false;"><i class="fa fa-circle-arrow-right"></i> Update</button>
</li>
<li class="divider-vertical"></li>
<li class="hidden-zoom3">
<div id="loadingProgress" class="progress progress-striped active" style="width: 100px;margin: 10px">
<div class="bar" style="width: 100%;"><i class="fa fa-refresh fa-spin"></i> Updating... </div>
</div>
<div id="refreshCounter" class="navbar-text"></div>
</li>
</ul>
</script>
<script type="text/template" id="tmpl-parameter-sel">
<li class="navbar-text">
<div style="margin-top:5px; margin-right: 10px;line-height: 30px">
<%= group %> <i class="fa fa-lg fa-chevron-right"></i>
<select id="<%= group %>" name="<%= group %>"></select>
</div>
</li>
<li class="divider-vertical"></li>
</script>
<script type="text/template" id="tmpl-parameter-sel-item">
<% for(paramName in params){ %>
<% var value = ( typeof params[paramName][group] === "undefined") ? paramName : params[paramName][group]; %>
<% var selectedHtml = (selected && selected != "" && (selected === value || selected === paramName) ) ? "selected='selected'" : "" %>
<option value="<%= value %>" <%= selectedHtml %>><%= paramName %></option>
<% } %>
</script>
<script type="text/template" id="tmpl-warning-dashboard">
<div class="alert alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Warning!</h4>
Could not load dashboard <%= dashboardId %>, check the dashboard index and configuration file.<br/>
Go back to <a href="index.html">Graphitus Homepage</a>
</div>
</script>
<script type="text/template" id="tmpl-warning-parameters">
<div class="alert alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Warning!</h4>
<%= message %>
Go back to <a href="index.html">Graphitus Homepage</a>
</div>
</script>
</head>
<body lang="en">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<form id="toolbar" class="navbar-form form-inline pull-left">
</form>
</div>
</div>
<div style="margin-top: 40px;"></div>
<div id="parameters-toolbar" class="navbar" style="z-index: 999;">
<div class="navbar-inner">
<form class="navbar-form form-inline">
<span class="pull-left" style="width: 95%">
<ul class="nav" id="parametersToolbarContent" ></ul>
</span>
<span class="pull-right" style="margin-top: 3px"><a href='#' class="btn btn-mini btn-inverse" id="parametersToolbarPin" onclick="togglePinnedParametersToolbar();"><i class="fa fa-lg fa-lock"></i></a></span>
</form>
</div>
</div>
<div id="message" class="hide"></div>
<center>
<div id="loader" class="progress progress-striped active" style="width: 30%;">
<div id="progressBar" class="bar" style="width: 100%;">Loading Dashboard...</div>
</div>
</center>
<div id="dashboards-view" class="container" style="width: 100%">
</div>
<div id="extendedGraph" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class='lightbox-header'>
<button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">×</button>
</div>
<div class='lightbox-content'>
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<ul class="nav">
<li><label class="navbar-text" id="extendedGraphTitle"></label></li>
<li class="divider-vertical"></li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bar-chart"></i> Options<b class="fa fa-lg fa-caret-down"></b></a>
<ul class="dropdown-menu" style="width: 400px;text-align: left;">
<div style="margin-left: 10px;">
<form id="extendedChartOptionsForm" style="width: 400px;padding-bottom: 0px;">
<h1>Chart Options</h1>
<section>
<div id="renderer_form" class="toggler">
<input type="radio" name="renderer" id="area" value="area" checked>
<label for="area">area</label>
<input type="radio" name="renderer" id="bar" value="bar">
<label for="bar">bar</label>
<input type="radio" name="renderer" id="line" value="line">
<label for="line">line</label>
<input type="radio" name="renderer" id="scatter" value="scatterplot">
<label for="scatter">scatter</label>
</div>
</section>
<section>
<div id="offset_form">
<label for="stack">
<input type="radio" name="offset" id="stack" value="zero" checked>
<span>stack</span>
</label>
<label for="stream">
<input type="radio" name="offset" id="stream" value="wiggle">
<span>stream</span>
</label>
<label for="pct">
<input type="radio" name="offset" id="pct" value="expand">
<span>pct</span>
</label>
<label for="value">
<input type="radio" name="offset" id="value" value="value">
<span>value</span>
</label>
</div>
<div id="interpolation_form">
<label for="cardinal">
<input type="radio" name="interpolation" id="cardinal" value="cardinal" checked>
<span>cardinal</span>
</label>
<label for="linear">
<input type="radio" name="interpolation" id="linear" value="linear">
<span>linear</span>
</label>
<label for="step">
<input type="radio" name="interpolation" id="step" value="step-after">
<span>step</span>
</label>
</div>
</section>
<section>
<h6>Smoothing</h6>
<div id="smoother" style="width: 80%; padding-left: 5px;"></div>
</section>
<section><span class="trademark">powered by <a href="http://code.shutterstock.com/rickshaw/" target="_blank">rickshaw</a></span></section>
</form>
</div>
</ul>
</li>
<li style="width: 400px;">
<div id="lightboxProgress" class="progress progress-striped active" style="margin-top: 10px;">
<div class="bar" id="lightboxProgressText" style="width: 100%;"></div>
</div>
</li>
<li>
<label class="hide label label-warning" style="margin-top: 10px;" id="lightboxProgressWarningWarning"></label>
</li>
</ul>
</div>
</div>
<div style="padding: 20px;">
<div class="pull-left">
<div id="extendedChart"></div>
<div id="timeline"></div>
<div id="slider" style="margin-top: 30px;"></div>
</div>
<div class="pull-right">
<div style="padding-right: 3px; width: 170px;" id="extendedLegend"></div>
</div>
</div>
</div>
</div>
<div id="hitogramLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class='lightbox-header'>
<button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">×</button>
</div>
<div class='lightbox-content'>
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<ul class="nav">
<li><label class="navbar-text" id="histogramTitle"></label></li>
<li class="divider-vertical"></li>
<li style="width: 400px;">
<div id="histogramProgress" class="progress progress-striped active" style="margin-top: 10px;">
<div class="bar" id="histogramProgressText" style="width: 100%;"></div>
</div>
</li>
<li>
<label class="hide label label-warning" style="margin-top: 10px;" id="histogramMultipleSeriesWarning">histogram shows average of multiple series</label>
</li>
</ul>
</div>
</div>
<div style="padding: 20px;">
<div class="pull-left">
<div id="histogram"></div>
</div>
</div>
</div>
</div>
<div id="slideShow">
<center><h5 id="slideTitle"></h5></center>
<center>
<div id="slideProgress" class="progress progress-striped active hide" style="width: 200px;margin: 10px">
<div class="bar" style="width: 100%;"><i class="fa fa-refresh fa-spin"></i> Loading slideshow... </div>
</div>
</center>
<div id="slidesContainer">
</div>
</div>
</body>
</html>