-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_headerInfo.html
More file actions
67 lines (53 loc) · 1.67 KB
/
example_headerInfo.html
File metadata and controls
67 lines (53 loc) · 1.67 KB
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
<div>
<h1 id="title">RRD Header Info</h1>
<div class="form-group">
<label for="input_fname">rrd file</label>
<select id="file" onchange="input_update()">
</select>
</div>
<button onclick="input_update()" class="btn btn-default">Update</button>
<hr />
<dl class="dl-horizontal">
<dt>filename</dt><dd id="fname">NA</dd>
<dt>min step</dt><dd id="step">NA</dd>
<dt>last update</dt><dd id="last_update">NA</dd>
<dt>version</dt><dd id="version">NA</dd>
</dl>
<table id="dsInfo" class="table table-condensed table-bordered">
<caption>DS list</caption>
<thead><tr><th>Name</th><th>Type</th></tr></thead>
<tbody></tbody>
</table>
<table id="rraInfo" class="table table-condensed table-bordered">
<caption>RRA list</caption>
<thead><tr><th>consolidation function</th><th>Rows</th><th>Steps</th></tr></thead>
<tbody></tbody>
</table>
<script type="text/javascript">
//<![CDATA[
function update_info(bf) {
var rrd_data = new RRDFile(bf);
// cleanup
$("#dsInfo tbody>tr").remove();
$("#rraInfo tbody>tr").remove();
// Generic header info
$('#fname').text($('#input_fname').val());
$('#step').text(rrd_data.pdp_step);
$('#last_update').text(new Date(rrd_data.lastUpdate*1000));
$('#version').text(rrd_data.version);
// DS info
for (var oDS of rrd_data.ds) {
$('#dsInfo tbody').append('<tr><td>'+oDS.name+'</td><td>'+oDS.type+'</td></tr>');
}
// RRA Info
for (var oRRA of rrd_data.rra) {
$('#rraInfo tbody').append('<tr><td>'+oRRA.cf_nam+'</td><td>'+oRRA.nrRows+'</td><td>'+oRRA.step+'</td></tr>');
}
}
function input_update() {
new BinaryFile("rrd/"+$('#file').val()+".rrd", update_info);
}
fillFileOptions($('#file'));
// ]]>
</script>
</div>