moved Dashboard.html in speparate folder to refresh zones.

This commit is contained in:
schrom01
2022-08-25 13:24:11 +02:00
parent 442a7a8b11
commit 1066adcc63
5 changed files with 29 additions and 172 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ function executeActionByValueID(command, index, valueID, valueFactor){
}
function switchZoneMode(autoMode, zone) {
executeAction('switch_zone_mode' ,zone, (autoMode ? 'automatic' : 'manual'))
}
}
+13 -5
View File
@@ -6,7 +6,7 @@ function sleep (time) {
function send_web_request($url, $messagestring, $varstring) {
function send_web_request(url, messageString, varString, elementId) {
// Browserkompatibles Request-Objekt erzeugen:
r = null;
@@ -41,14 +41,22 @@ function send_web_request($url, $messagestring, $varstring) {
// HTTP-POST
r.open('POST', $url, true);
r.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(elementId).innerHTML = this.responseText;
}
};
r.open('POST', url, true);
r.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
r.send($varstring);
if($messagestring != 'no')
r.send(varString);
if(messageString != 'no')
{
alert($messagestring);
alert(messageString);
}
sleep(500).then(() => {