Merge branch 'daniel' of https://gitlab.psi.ch/samenv/seweb into daniel

This commit is contained in:
Daniel
2025-04-25 17:05:47 +02:00
2 changed files with 10 additions and 4 deletions

View File

@ -276,7 +276,7 @@ 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 == "rdlink") {
if (type == "rdonly" || type == "none") {
let text = htmlEscape(component.formatted);
if (text) {
elem.innerHTML = text;

View File

@ -60,14 +60,20 @@ class SecopInteractor(SecopClient):
def add_main_components(self, components):
for name, desc in self.modules.items():
component = dict(type='rdlink', name=f'{name}:value', title=name)
if 'status' in desc['parameters']:
parameters = desc['parameters']
component = {'type': 'rdonly' if 'value' in parameters else 'none'}
if 'status' in parameters:
component['statusname'] = f'{name}:status'
if 'target' in desc['parameters']:
targetpar = parameters.get('target')
if targetpar:
component.update(convert_par(name, 'target', targetpar))
component['targetname'] = f'{name}:target'
info = desc['properties'].get('description')
if info:
component['info'] = info
component['name'] = f'{name}:value'
component['title'] = name
print(component)
components.append(component)
self.param_updates.add('value')
self.param_updates.add('status')