Fixed light power button optical handling.

This commit is contained in:
Kai Lauterbach 2023-05-03 14:16:00 +02:00
parent ebf587c73e
commit fa90339fea
2 changed files with 235 additions and 233 deletions

View file

@ -38,8 +38,7 @@ amain.classList.remove("pure-button-primary");
acfg.classList.remove("pure-button-primary");
atde.classList.add("pure-button-primary");
});
</script>
<script>
function loadGraphData() {
console.log('----> generate graph <----');
$.getJSON('/tc_data_blocks', function(data) {
@ -208,9 +207,7 @@ pwmElementTxt.innerText = pwmValue.toString();
}
updatePWMValues();
setInterval(updatePWMValues, 5000);
</script>
<script>
var links = document.querySelectorAll('[id^="on"][id$="_off"]');
@ -226,6 +223,8 @@ xhr.open('GET', 'http://{{IP_ADDRESS}}/?on' + id + '=false&transition=' + docume
xhr.send();
updateLightState();
this.classList.add('pure-button-primary');
document.getElementById('on'+id+'_on').classList.remove('pure-button-primary');
});
});
@ -243,6 +242,8 @@ xhr.open('GET', 'http://{{IP_ADDRESS}}/?on' + id + '=true&transition=' + documen
xhr.send();
updateLightState();
this.classList.remove('pure-button-primary');
document.getElementById('on'+id+'_off').classList.remove('pure-button-primary');
});
});
</script>

View file

@ -38,8 +38,7 @@
acfg.classList.remove("pure-button-primary");
atde.classList.add("pure-button-primary");
});
</script>
<script>
function loadGraphData() {
console.log('----> generate graph <----');
$.getJSON('/tc_data_blocks', function(data) {
@ -208,9 +207,7 @@
}
updatePWMValues();
setInterval(updatePWMValues, 5000);
</script>
<script>
// Suche nach allen Links auf der Seite mit IDs von on0_off bis on3_off
var links = document.querySelectorAll('[id^="on"][id$="_off"]');
// Füge einen Klick-Listener zu jedem Link hinzu
@ -226,6 +223,8 @@
// Sende die Anfrage im Hintergrund
xhr.send();
updateLightState();
this.classList.add('pure-button-primary');
document.getElementById('on'+id+'_on').classList.remove('pure-button-primary');
});
});
// Suche nach allen Links auf der Seite mit IDs von on0_off bis on3_off
@ -243,6 +242,8 @@
// Sende die Anfrage im Hintergrund
xhr.send();
updateLightState();
this.classList.remove('pure-button-primary');
document.getElementById('on'+id+'_off').classList.remove('pure-button-primary');
});
});
</script>