forked from HappyFaceMonitoring/HappyFaceModules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashboardSummary.html
58 lines (55 loc) · 2.04 KB
/
DashboardSummary.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
## -*- coding: utf-8 -*-
<%inherit file="/module_base.html" />
<%def name="content()">
<script type="text/javascript">
function ${module.instance_name}_plot_test(metric_name){
$('[name=chosen_quantity_name]').remove();
$('#${module.instance_name}_data').append('<input type="hidden" name="chosen_quantity_name" value="'+metric_name+'" />');
$('#${module.instance_name}_data').submit();
}
</script>
<form id="${module.instance_name}_data" method="get" action="${hf.plotgenerator.getCustomPlotUrl()}" target="_blank">
<input name="module_instance_name" type="hidden" value="${module.instance_name}" />
<input name="tier_name" type="hidden" value="${tier_name}" />
<input name="subtable_name" type="hidden" value="formatted_history_data" />
<input name="x_name" type="hidden" value="time" />
<input name="y_name" type="hidden" value="status" />
<input name="quantity_column_name" type="hidden" value="metric_name" />
<input name="run_id" type="hidden" value="${run['id']}" />
<h3>Note: Currently used view option for dashboard metrics: <a href="${link_url}">"${view_option}"</a></h3>
<table class='TableData'>
<tr>
<td>Status color coding used here:</td>
<td class='ok'>OK</td>
<td class='warning'>Warning</td>
<td class='critical'>Error</td>
<td class='undefined'>Other</td>
</tr>
<tr class='TableHeader'>
<td>Metric name</td>
<td colspan=2>UTC time of latest status</td>
<td colspan=2>Plot status history</td>
</tr>
<%!
import time
%>
%for entry in latest_data:
%if entry['latest_status'] == 3:
<tr class='critical'>
%elif entry['latest_status'] == 4:
<tr class='warning'>
%elif entry['latest_status'] == 5:
<tr class='ok'>
%elif entry['latest_status'] == -1:
<% continue %>
%else:
<tr class='undefined'>
%endif
<td>${entry['metric_name']}</td>
<td colspan=2>${time.asctime(time.gmtime(entry['latest_time']))}</td>
<td colspan=2><center><input type="button" onclick = "${module.instance_name}_plot_test('${entry['metric_name']}')" value="Plot Metric" name="Plot Metric" /></center></td>
</tr>
%endfor
</table>
</form>
</%def>