This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathNodeMonitoring.html
136 lines (131 loc) · 4.34 KB
/
NodeMonitoring.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
## -*- coding: utf-8 -*-
<%inherit file="/module_base.html" />
<%def name="content()">
<img src=${module.dataset["filename_plot"].getArchiveUrl()} />
<br/>
<script type="text/javascript">
$(function() {
function handle_ajax_response(data) {
$('#${module.instance_name}_spinner').remove();
if(data["status"] == "success") {
var table = $('#${module.instance_name}_details table');
console.log(table);
console.log(data["data"].length);
console.log(data["data"][0]);
for(var i = 0; i < data["data"].length; i++) {
var row = data["data"][i];
var name = row["name"]
/*table.append("<tr class=\"report\" style=\"background-color: "+row["bg_color"]+"\" ><td>"+row["name"]+"</td>"
+ "<td>"+row["bare_total_files"]+" files<br />"+row["bare_total_size"]+" GiB</td>"
+ "<td>"+row["bare_on_disk_files"]+" files"+row["bare_on_disk_files_rel"]+"%<br />"
+row["bare_on_disk_size"]+" GiB "+row["bare_on_disk_size_rel"]+"%</td>"
+ "<td>"+row["total_on_disk_files"]+"<br />"+row["total_on_disk_size"]+" GiB</td></tr>");*/
}
}
else {
// Todo: Give user some feedback
}
}
downloaded_additional_data = false;
$('#${module.instance_name}_toggle').click(function() {
$('#${module.instance_name}_details').toggle();
if(!downloaded_additional_data) {
downloaded_additional_data = true;
$.ajax("${module.ajaxUrl()}", {
error: function(jqXHR, textStatus, errorThrown) {
handle_ajax_response({"status": "error", "code": 0, "reason": errorThrown});
},
success: function(data, textStatus, jqXHR) {
handle_ajax_response(data);
2},
dataType: "json"
});
}
});
});
</script>
<input type="button" value="show/hide summary" onfocus="this.blur()" id="${module.instance_name}_toggle" />
<div class="DetailedInfo" id="${module.instance_name}_details" style="display:none;">
<p id="${module.instance_name}_spinner">Loading contents of details table, this might take a few seconds...</br>
<img src="${hf.config.get("paths", "static_url")}/images/spinner.gif" />
</p>
<br>
<table class="TableData">
%if module.dataset['SecondaryKey'] == '':
<tr>
<td>${module.dataset['PrimaryKey']}</td>
%for value in attribute_values:
<td>${value}</td>
%endfor
</tr>
%for entry in statistics:
%if entry['PrimaryKeyURL'] == '':
<tr>
<td>${entry['PrimaryKey']}</td>
%for value in attribute_values:
<td>
%if value in entry:
${entry[value]}
%else:
-
%endif
</td>
%endfor
</tr>
%else:
<tr>
<td><a href="${entry['PrimaryKeyURL']}">${entry['PrimaryKey']}</a></td>
%for value in attribute_values:
<td>
%if value in entry:
${entry[value]}
%else:
-
%endif
</td>
%endfor
</tr>
%endif
%endfor
%else:
<tr>
<td>${module.dataset['PrimaryKey']}</td>
<td>${module.dataset['SecondaryKey']}</td>
%for value in attribute_values:
<td>${value}</td>
%endfor
</tr>
%for entry in statistics:
%if entry['PrimaryKeyURL'] == '':
<tr>
<td>${entry['PrimaryKey']}</td>
<td>${entry['SecondaryKey']}</td>
%for value in attribute_values:
<td>
%if value in entry:
${entry[value]}
%else:
-
%endif
</td>
%endfor
</tr>
%else:
<tr>
<td><a href="${entry['PrimaryKeyURL']}">${entry['PrimaryKey']}</a></td>
<td>${entry['SecondaryKey']}</td>
%for value in attribute_values:
<td>
%if value in entry:
${entry[value]}
%else:
-
%endif
</td>
%endfor
</tr>
%endif
%endfor
%endif
</table>
</%def>