-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.html
More file actions
40 lines (38 loc) · 975 Bytes
/
status.html
File metadata and controls
40 lines (38 loc) · 975 Bytes
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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Buttonstatus vom ESP32</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding-top: 50px;
}
#status {
font-size: 2em;
font-weight: bold;
color: green;
}
</style>
</head>
<body>
<h1>ESP32 Buttonstatus</h1>
<p>Der aktuelle Status ist:</p>
<div id="status">Lade...</div>
<script>
function updateStatus() {
fetch("status.txt?" + new Date().getTime()) // cache umgehen
.then(response => response.text())
.then(text => {
document.getElementById("status").textContent = text;
})
.catch(err => {
document.getElementById("status").textContent = "Fehler beim Laden";
});
}
setInterval(updateStatus, 1000); // jede Sekunde aktualisieren
updateStatus(); // sofort laden
</script>
</body>
</html>