heartbeatHistory.js
1.95 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
function disksGraph(size, diskHistoryGraph) {
if (size > 0) {
// this.parentNode.parentNode.rowIndex
var graphID = document.getElementById('graph');
var memoryGraph = document.getElementById('memoryGraph');
var memroyIndex = memoryGraph.rowIndex;
var diskInfoHead = graphID.insertRow(memroyIndex + 1);
diskInfoHead.innerHTML = '';
for (len = 0; len < size / 3; len++) {
var id = "diskGraph" + len;
var graphRow = graphID.insertRow(memroyIndex + 2 + len);
graphRow.setAttribute("id", id);
}
for (i = 0; i < size; i++) {
var index = Math.floor(i / 3);
var id = "diskGraph" + index;
var graphData = diskHistoryGraph[i];
var graphCell = document.getElementById(id).insertCell();
var div = document.createElement("div");
graphCell.appendChild(div);
div.setAttribute("class", "graph");
graphLineChart(div, graphData);
}
}
}
function buildExtensionGraph(size, extensionGraphs) {
if (size > 0) {
var graphID = document.getElementById('graph');
var extensionGraph = document.getElementById('extensionGraph');
var extensionIndex = extensionGraph.rowIndex;
var extensionHead = graphID.insertRow(extensionIndex + 1);
extensionHead.innerHTML = '';
for (len = 0; len < size / 3; len++) {
var id = "extensionGraph" + len;
var graphRow = graphID.insertRow(extensionIndex + 2 + len);
graphRow.setAttribute("id", id);
}
for (i = 0; i < size; i++) {
var index = Math.floor(i / 3);
var id = "extensionGraph" + index;
var graphData = extensionGraphs[i];
var graphCell = document.getElementById(id).insertCell();
var div = document.createElement("div");
graphCell.appendChild(div);
div.setAttribute("class", "graph");
graphLineChart(div, graphData);
}
}
}
$(document).delegate('.heartbeat_graph_link', 'click', function(e){
var anchor = this;
var el = $(anchor);
var div = el.attr('data-status');
var cell = document.getElementById(div);
cell.src=anchor.href;
cell.style.display="block";
return false;
});