-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
72 lines (65 loc) · 2.5 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
<!DOCTYPE html>
<html>
<head>
<title>Volumetric Data Dashboard</title>
<meta charset='utf-8'/>
<meta name='viewport' content='initial-scale=1,user-scalable=yes'/>
<style>
table,
td,
th {
margin: 10px 0;
padding: 2px 4px;
text-align: center;
border-collapse: collapse;
}
td,
th {
border: 1px solid black;
}
</style>
</head>
<body>
<table id="volumetric-dashboard" class="sort"></table>
<script>
fetch(`data_volumetric.json`).then((r) => r.json()).then((data) => {
var table = document.getElementById('volumetric-dashboard');
var col = ['name', 'zone_type', 'result', 'status']
for (var i = 0; i < data.length; i++) {
var result_text = `${ (data[i]['total'] != -1)
? data[i]['total']
: "??"} `
result_text += `<br>(expected : ${data[i]['expected_min']} ~ ${data[i]['expected_max']})`
var status = ''
if (data[i]['test_status'] == 'ok') {
status = '✅'
status += (data[i]['is_known_failure'] == "yes")
? " 😍 "
: "✅";
}
if (data[i]['test_status'] == 'ko') {
status += (data[i]['is_known_failure'] == "yes")
? "📉"
: "❎❎";
}
if (data[i]['test_status'] == 'skip') {
status = '🤔'
}
var tr = table.insertRow(-1);
tr.insertCell(-1).innerHTML = data[i]['name']
tr.insertCell(-1).innerHTML = data[i]['zone_type']
var tabCell = tr.insertCell(-1);
tabCell.innerHTML = result_text;
tr.insertCell(-1).innerHTML = status
}
var header = table.createTHead();
var trh = header.insertRow(0);
for (var i = 0; i < col.length; i++) {
var th = document.createElement("th");
th.innerHTML = col[i];
trh.appendChild(th);
}
})
</script>
</body>
</html>