-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpanel_index.html
67 lines (65 loc) · 2.22 KB
/
webpanel_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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8' />
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<title>DmxTester | All Channels</title>
<style>
body {
font-family: 'Courier New', Courier, monospace;
}
.channel {
background-color: rgb(192, 192, 192);
width: 60px;
height: 60px;
padding: 5px;
margin: 2px;
display: inline-block;
}
.ch-nr {
display: block;
font-weight: 900;
font-size: 20px;
}
.ch-val {
font-size: 18px;
}
.ch-progress {
width: 100%;
}
</style>
</head>
<body>
<h1>DmxTester - All values</h1>
<div id='channels'></div>
<script>
ch_container = document.getElementById('channels');
function update() {
fetch('/api/all')
.then((data) => data.json())
.then(function (data) {
var values = data.data;
ch_container.innerHTML = '';
for (i = 1; i <= 512; i++) {
ch_container.innerHTML += `
<a href='/single?ch=${i}'>
<div class='channel'>
<span class='ch-nr'>CH${i
.toString()
.padStart(3, '0')}</span>
<span class='ch-val'>VAL${values[i - 1]
.toString()
.padStart(3, '0')}</span>
<progress max='255' value='${
values[i - 1]
}' class='ch-progress'></progress>
</div></a>`;
}
});
}
update();
setInterval(update, 1000);
</script>
</body>
</html>