-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.html
47 lines (41 loc) · 1.15 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
<!DOCTYPE html>
<html>
<style>
.card {
max-width: 400px;
min-height: 250px;
background: #02b875;
padding: 30px;
box-sizing: border-box;
color: #FFF;
margin: 20px;
box-shadow: 0px 2px 18px -4px rgba(0, 0, 0, 0.75);
}
</style>
<body>
<div class="card">
<h4>Smart BMS monitor</h4><br>
<h1>Sensor data:</h1><br>
<span id="data">0</span>V
<h1>Vyliz mi prdel</h1><br>
<br><a href="/firmware">Update firmware</a>
</div>
<script>
setInterval(function () {
// Call a function repetatively with 2 Second interval
getData();
}, 2000); //2000mSeconds update rate
function getData() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("data").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "getdata", true);
xhttp.send();
}
</script>
</body>
</html>