Fixed light power button optical handling.
This commit is contained in:
parent
ebf587c73e
commit
fa90339fea
2 changed files with 235 additions and 233 deletions
|
@ -38,8 +38,7 @@ amain.classList.remove("pure-button-primary");
|
||||||
acfg.classList.remove("pure-button-primary");
|
acfg.classList.remove("pure-button-primary");
|
||||||
atde.classList.add("pure-button-primary");
|
atde.classList.add("pure-button-primary");
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function loadGraphData() {
|
function loadGraphData() {
|
||||||
console.log('----> generate graph <----');
|
console.log('----> generate graph <----');
|
||||||
$.getJSON('/tc_data_blocks', function(data) {
|
$.getJSON('/tc_data_blocks', function(data) {
|
||||||
|
@ -208,9 +207,7 @@ pwmElementTxt.innerText = pwmValue.toString();
|
||||||
}
|
}
|
||||||
updatePWMValues();
|
updatePWMValues();
|
||||||
setInterval(updatePWMValues, 5000);
|
setInterval(updatePWMValues, 5000);
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
var links = document.querySelectorAll('[id^="on"][id$="_off"]');
|
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();
|
xhr.send();
|
||||||
updateLightState();
|
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();
|
xhr.send();
|
||||||
updateLightState();
|
updateLightState();
|
||||||
|
this.classList.remove('pure-button-primary');
|
||||||
|
document.getElementById('on'+id+'_off').classList.remove('pure-button-primary');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -38,8 +38,7 @@
|
||||||
acfg.classList.remove("pure-button-primary");
|
acfg.classList.remove("pure-button-primary");
|
||||||
atde.classList.add("pure-button-primary");
|
atde.classList.add("pure-button-primary");
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
function loadGraphData() {
|
function loadGraphData() {
|
||||||
console.log('----> generate graph <----');
|
console.log('----> generate graph <----');
|
||||||
$.getJSON('/tc_data_blocks', function(data) {
|
$.getJSON('/tc_data_blocks', function(data) {
|
||||||
|
@ -208,9 +207,7 @@
|
||||||
}
|
}
|
||||||
updatePWMValues();
|
updatePWMValues();
|
||||||
setInterval(updatePWMValues, 5000);
|
setInterval(updatePWMValues, 5000);
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Suche nach allen Links auf der Seite mit IDs von on0_off bis on3_off
|
// Suche nach allen Links auf der Seite mit IDs von on0_off bis on3_off
|
||||||
var links = document.querySelectorAll('[id^="on"][id$="_off"]');
|
var links = document.querySelectorAll('[id^="on"][id$="_off"]');
|
||||||
// Füge einen Klick-Listener zu jedem Link hinzu
|
// Füge einen Klick-Listener zu jedem Link hinzu
|
||||||
|
@ -226,6 +223,8 @@
|
||||||
// Sende die Anfrage im Hintergrund
|
// Sende die Anfrage im Hintergrund
|
||||||
xhr.send();
|
xhr.send();
|
||||||
updateLightState();
|
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
|
// Suche nach allen Links auf der Seite mit IDs von on0_off bis on3_off
|
||||||
|
@ -243,6 +242,8 @@
|
||||||
// Sende die Anfrage im Hintergrund
|
// Sende die Anfrage im Hintergrund
|
||||||
xhr.send();
|
xhr.send();
|
||||||
updateLightState();
|
updateLightState();
|
||||||
|
this.classList.remove('pure-button-primary');
|
||||||
|
document.getElementById('on'+id+'_off').classList.remove('pure-button-primary');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue