fix simple command (e.g. stop)

This commit is contained in:
2025-05-05 14:01:18 +02:00
parent fae76f2ae1
commit 07bd5407e0
5 changed files with 30 additions and 20 deletions

View File

@ -277,13 +277,12 @@ function updateValue(component) {
for (var j = 0; j < matches.length; j++) {
let elem = matches[j];
let type = elem.__ctype__; // -> Show Dom-Properties
if (type == "rdonly" || type == "none") {
if (type == "rdonly") {
let text = htmlEscape(component.formatted);
if (text) {
elem.innerHTML = text;
}
}
else if (type == "input") {
} else if (type == "input") {
let row = elem.closest('div');
row.classList.remove('row-waiting-for-answer');
elem.actualValue = component.value;
@ -306,10 +305,10 @@ function updateValue(component) {
// elem.value = j + 1;
// }
// }
elem.value = component.value;
console.log('update pushbutton');
console.log('component.name:', component.name);
console.log('element', elem);
} else if (type == "none") {
// pushbutton (e.g. stop command)
let row = elem.closest('div');
row.classList.remove('row-waiting-for-answer');
}
}
}
@ -468,6 +467,12 @@ function successHandler(s, message) {
// Response to a "updategraph"-server-request.
case "accept-graph":
break;
case "accept-command":
console.log('ACCEPT', message.result)
if (message.result) {
updateValue(message.result);
}
break;
case "error":
console.log("%cError-Message received!", "color:white;background:red");
console.log(message);