This repository has been archived by the owner on Oct 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (116 loc) · 5.24 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<link href='styles/main.css' rel='stylesheet' type='text/css'>
<title>dashboard</title>
</head>
<body>
<table class='layer app' border='0'>
<!-- <tr> -->
<!-- <td class='blank'>:)</td> -->
<!-- <th class='metric-name' colspan='3'>requests/sec</th> -->
<!-- <th class='metric-name' colspan='3'>response time (ms)</th> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <td></td> -->
<!-- <td class='time-span'>15</td> -->
<!-- <td class='time-span'>5</td> -->
<!-- <td class='time-span last'>1</td> -->
<!-- <td class='time-span'>15</td> -->
<!-- <td class='time-span'>5</td> -->
<!-- <td class='time-span last'>1</td> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <th class='instance-name'>a-0</th> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <th class='instance-name'>a-1</th> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <th class='instance-name'>a-2</th> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- </tr> -->
<!-- <tr> -->
<!-- <th class='instance-name'>a-3</th> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val'>WWWW</td> -->
<!-- <td class='metric-val last'>WWWW</td> -->
<!-- </tr> -->
</table>
<script src='js/libs/jquery-2.0.3.min.js'></script>
<script>
var data = {
layer: 'app',
metrics: [
{'name': 'requests/sec', 'intervals': ['15', '10', '1']},
{'name': 'response time (ms)', 'intervals': ['15', '10', '1']},
],
instances: [{
name: 'a-0',
values: [[450, 700, 895], [300, 350, 425]]
}, {
name: 'a-1',
values: [[450, 700, 895], [300, 350, 425]]
}, {
name: 'a-2',
values: [[450, 700, 895], [300, 350, 425]]
}, {
name: 'a-3',
values: [[450, 700, 895], [300, 350, 425]]
}]
};
$(function() {
var $table = $('.layer.' + data.layer);
var $headerRow = $('<tr><td class="blank">:)</td></tr>');
var $intervalRow = $('<tr><td></td></tr>');
$.each(data.metrics, function(i, metric) {
$headerRow.append($('<th class="metric-name" colspan="'+metric.intervals.length+'">'+metric.name+'</th>'));
$.each(metric.intervals, function(j, interval) {
var $td = $('<td class="interval">'+interval+'</td>');
if (j === metric.intervals.length-1) {
$td.addClass('last');
}
$intervalRow.append($td);
});
});
$table.append($headerRow);
$table.append($intervalRow);
$.each(data.instances, function(i, instance) {
var $row = $('<tr></tr>');
$row.append($('<th class="instance-name">'+instance.name+'</th>'));
$.each(instance.values, function(i, set) {
$.each(set, function(i, val) {
var $td = $('<td class="metric-val">'+val+'</td>');
if (i === set.length-1) {
$td.addClass('last');
}
$row.append($td);
});
});
$table.append($row);
});
});
</script>
</body>
</html>