This repository was archived by the owner on Aug 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
72 lines (69 loc) · 2.21 KB
/
test.html
File metadata and controls
72 lines (69 loc) · 2.21 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
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>[test] unlocks-local</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<style>
body {
margin: 0;
padding: 0;
color: #d8d9da;
font-size: 13px;
background-color: #161719;
font-family: Roboto,Helvetica Neue,Arial,sans-serif;
}
#outer {
margin: 1em;
width: 454px;
height: 303px;
overflow: auto;
line-height: 1.5;
border: 1px dashed red;
}
</style>
</head>
<body>
<h3>Recente doorduino unlocks</h3>
<div id="outer">
<!-- copy/paste below this in a text panel in grafana, see https://grafana.com/docs/features/panels/text/ -->
<div id="unlocks-local" style="font-size: 85%;">Loading...</div>
<script>
var unlocks_local = function() {
$.getJSON("http://10.42.14.9:42042/", function(data) {
var div = $("#unlocks-local");
div.empty();
div.css('column-count', 2);
for(const unlock of data) {
var t = new Date(unlock.ts*1000).toLocaleTimeString();
div.append(
"<div><span style='color: #999'>"+t+"</span> "+
"<strong>"+unlock.door+"</strong> "+
"<span style='color: #999'>unlocked by</span> "+
"<strong>"+unlock.name+"</strong></div>");
}
while(div.height() < div.parent().height()) {
div.prepend("<br>");
}
while(div.height() > div.parent().height()) {
div[0].childNodes[0].remove();
}
}).fail(function(data) {
$("#unlocks-local").html(
"<p>Recente doorduino unlocks zijn alleen lokaal binnen RevSpace zichtbaar.</p>"+
"<p>Ben je nu verbonden met het RevSpace netwerk? Het kan nodig zijn om \"onveilige "+
"scripts\" of \"mixed content\" toe te staan in je browser</p>"+
"<img src=\"https://i.imgur.com/RhGyAX9.png\">"
);
});
};
$(function() {
unlocks_local();
setInterval(unlocks_local, 1000);
});
</script>
<!-- end copy/paste -->
</div>
<h5>ok doei</h5>
</body>
</html>