This commit is contained in:
derlole
2025-05-09 11:21:53 +00:00
parent 416d30ae1c
commit 175c918c49
3 changed files with 39 additions and 16 deletions

View File

@@ -15,24 +15,25 @@ socket.on('static_data', (data) => {
gebId("ip_local").innerText = data.esp_conn_infos.ip_local
gebId("valid_connection").innerText = data.esp_conn_infos.connection_valid
gebId("last_seen").innerText = data.esp_conn_infos.last_seen
stBut = gebId("machine-status-butt")
switch (data.machine.state) {
case "ON":
gebId("machine-status").innerText = "AN";
gebId("machine-status-butt").classList.remove("blink-orange");
gebId("machine-status-butt").classList.remove("initBackRed");
gebId("machine-status-butt").classList.add("initBackGreen");
stBut.classList.remove("blink-orange");
stBut.classList.remove("initBackRed");
stBut.classList.add("initBackGreen");
break;
case "PENDING":
gebId("machine-status").innerText = "WARTEN";
gebId("machine-status-butt").classList.add("blink-orange");
gebId("machine-status-butt").classList.remove("initBackRed");
gebId("machine-status-butt").classList.remove("initBackGreen");
stBut.classList.add("blink-orange");
stBut.classList.remove("initBackRed");
stBut.classList.remove("initBackGreen");
break;
case "OFF":
gebId("machine-status").innerText = "AUS";
gebId("machine-status-butt").classList.remove("blink-orange");
gebId("machine-status-butt").classList.add("initBackRed");
gebId("machine-status-butt").classList.remove("initBackGreen");
stBut.classList.remove("blink-orange");
stBut.classList.add("initBackRed");
stBut.classList.remove("initBackGreen");
break;
default:
@@ -60,11 +61,11 @@ socket.on('static_data', (data) => {
}
if(data.machine.berror){
gebId("machine-error-butt").classList.add("initBackRed");
gebId("machiene-error-text").innerText = machine.error;
gebId("machiene-error-text").innerText = data.machine.error;
}
else {
gebId("machine-error-butt").classList.remove("initBackRed");
gebId("machiene-error-text").innerText = "";
gebId("machiene-error-text").innerText = "Keiner";
}
machienReady = gebId("machine-ready-butt")
makeCoffee = gebId("make-coffee-butt")
@@ -74,12 +75,12 @@ socket.on('static_data', (data) => {
makeCoffee.classList.add("deniePress");
}
if(data.machine.ready){
machienReady.classList.add("initBackRed");
machienReady.classList.remove("initBackGreen");
gebId("machiene-ready-text").innerText = "Bereit";
}else {
machienReady.classList.remove("initBackRed");
machienReady.classList.add("initBackGreen");
gebId("machiene-ready-text").innerText = "Bereit";
}else {
machienReady.classList.add("initBackRed");
machienReady.classList.remove("initBackGreen");
gebId("machiene-ready-text").innerText = "Nicht bereit";
}
});