DmitrMakeev
commited on
Commit
•
9c12554
1
Parent(s):
59b84b3
Update zapro.html
Browse files- zapro.html +35 -31
zapro.html
CHANGED
@@ -14,39 +14,43 @@
|
|
14 |
</head>
|
15 |
<body>
|
16 |
<h1>Онлайн данные системы</h1>
|
17 |
-
<p>День : <span id="dey"
|
18 |
-
<p>Неделя: <span id="wek"
|
19 |
<br>
|
20 |
-
<p>PH раствора: <span id="ph"
|
21 |
-
<p>EC раствора: <span id="ec"
|
22 |
-
<p>Т. раствора: <span id="tS"
|
23 |
-
<p>Т. воздуха: <span id="tA"
|
24 |
-
<p>Вл. воздуха: <span id="hDm"
|
25 |
-
<p>Об. вентилятора: <span id="sVen"
|
26 |
-
|
27 |
<script>
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
50 |
</script>
|
51 |
</body>
|
52 |
</html>
|
|
|
14 |
</head>
|
15 |
<body>
|
16 |
<h1>Онлайн данные системы</h1>
|
17 |
+
<p>День : <span id="dey"></span></p>
|
18 |
+
<p>Неделя: <span id="wek"></span></p>
|
19 |
<br>
|
20 |
+
<p>PH раствора: <span id="ph"></span></p>
|
21 |
+
<p>EC раствора: <span id="ec"></span></p>
|
22 |
+
<p>Т. раствора: <span id="tS"></span></p>
|
23 |
+
<p>Т. воздуха: <span id="tA"></span></p>
|
24 |
+
<p>Вл. воздуха: <span id="hDm"></span></p>
|
25 |
+
<p>Об. вентилятора: <span id="sVen"></span></p>
|
26 |
+
|
27 |
<script>
|
28 |
+
function updateValues(data) {
|
29 |
+
document.getElementById("dey").textContent = data.dey;
|
30 |
+
document.getElementById("wek").textContent = data.wek;
|
31 |
+
document.getElementById("ph").textContent = data.ph;
|
32 |
+
document.getElementById("ec").textContent = data.ec;
|
33 |
+
document.getElementById("tS").textContent = data.tS;
|
34 |
+
document.getElementById("tA").textContent = data.tA;
|
35 |
+
document.getElementById("hDm").textContent = data.hDm;
|
36 |
+
document.getElementById("sVen").textContent = data.sVen;
|
37 |
+
}
|
38 |
+
|
39 |
+
function fetchValues() {
|
40 |
+
var xhr = new XMLHttpRequest();
|
41 |
+
xhr.open("GET", "/zapro", true);
|
42 |
+
xhr.setRequestHeader("Content-Type", "application/json");
|
43 |
+
xhr.onreadystatechange = function () {
|
44 |
+
if (xhr.readyState === 4 && xhr.status === 200) {
|
45 |
+
var response = JSON.parse(xhr.responseText);
|
46 |
+
updateValues(response);
|
47 |
+
}
|
48 |
+
};
|
49 |
+
xhr.send();
|
50 |
+
}
|
51 |
+
|
52 |
+
fetchValues();
|
53 |
+
setInterval(fetchValues, 10000);
|
54 |
</script>
|
55 |
</body>
|
56 |
</html>
|