server current

This commit is contained in:
derlole
2025-06-26 00:06:58 +00:00
parent 00e701f3c1
commit e07176af52
5 changed files with 31 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ gebId("ip_local").innerText = esp_conn_infos.ip_local
gebId("valid_connection").innerText = esp_conn_infos.connection_valid
gebId("last_seen").innerText = esp_conn_infos.last_seen
machienReady = gebId("machine-ready-butt")
makeCoffee = gebId("make-coffee-butt")
makeCoffeeVar = gebId("make-coffee-butt")
if(machine.status == "OFF"){
gebId("machine-status").innerText = "AUS";
gebId("machine-status-butt").classList.add("initBackRed");
@@ -32,7 +32,7 @@ if(machine.berror){
gebId("machiene-error-text").innerText = machine.error;
}
if(machine.ready && machine.state == "ON" && !machine.berror && esp_conn_infos.connection_valid){
makeCoffee.classList.remove("deniePress");
makeCoffeeVar.classList.remove("deniePress");
}
if(machine.ready){
machienReady.classList.remove("initBackRed");
@@ -100,11 +100,11 @@ function makeCoffee(){
return;
}
console.log("makeCoffee")
fetch('/unsecure/esp/make_coffee', {method: 'POST'})
fetch('/unsecure/esp/make-coffee', {method: 'POST'})
.then(res => res.json())
.then(data =>{
console.log(data)
})
});
}
function waterRefill(){
if (gebId("water-fill").parentElement.classList.contains("deniePress")){

View File

@@ -68,11 +68,11 @@ socket.on('static_data', (data) => {
gebId("machiene-error-text").innerText = "Keiner";
}
machienReady = gebId("machine-ready-butt")
makeCoffee = gebId("make-coffee-butt")
makeCoffeeVar2 = gebId("make-coffee-butt")
if(data.machine.ready && data.machine.state == "ON" && !data.machine.berror && data.esp_conn_infos.connection_valid){
makeCoffee.classList.remove("deniePress");
makeCoffeeVar2.classList.remove("deniePress");
}else {
makeCoffee.classList.add("deniePress");
makeCoffeeVar2.classList.add("deniePress");
}
if(data.machine.ready){
machienReady.classList.remove("initBackRed");