fix simple command (e.g. stop)

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

View File

@ -48,7 +48,7 @@
}
.row-waiting-for-answer {
background-color: orangered;
background-color: LightGoldenrodYellow;
}
/* ------------------------------ icon-modules ------------------------------ */

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);

View File

@ -223,7 +223,12 @@ function createValue (component) {
value.classList.add('col-right-value-with-write-permission');
}
value.setAttribute('name', component.name);
value.__ctype__ = 'rdonly';
if (component.type == 'pushbutton') {
console.log('CREATE', component.name);
value.__ctype__ = 'none';
} else {
value.__ctype__ = 'rdonly';
}
return value;
}