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

This commit is contained in:
Daniel
2025-04-25 09:55:44 +02:00
4 changed files with 14 additions and 5 deletions

View File

@ -79,8 +79,8 @@ new Settings()
.treat("hideRightPart", "hr", to_bool, false) //used to completely disable the right part
.treat("wideGraphs", "wg", to_bool, false) //used to toggle the size of the graphs part
.treat("showAsync", "sa", to_bool, false)
.treat("device", "dev", 0, "")
.treat("server", "srv", 0, "")
.treat("device", "device", 0, "")
.treat("stream", "stream", 0, "")
.treat("instrument", "instrument", 0, "")
.treat("timerange", "time", 0, "-1800,0")
@ -88,7 +88,7 @@ if (window.instrument) {
window.clientTags = "&instrument=" + window.instrument;
} else {
let args = '';
if (window.server) { args += "&stream=" + window.server; }
if (window.stream) { args += "&stream=" + window.stream; }
if (window.device) { args += "&device=" + window.device; }
window.clientTags = args;
}

View File

@ -160,6 +160,8 @@ class InfluxGraph(HandlerBase):
if self.instrument:
streams, tags, self.device_name = self.server.lookup_streams(self.instrument, **self.init_tags)
self.tags = {**self.init_tags, **tags}
else:
self.tags = self.init_tags
blocks = self.get_available_variables(start_time, end_time, self.chart_configs, userconfiguration)
# initialize self.last_values to keep track of the available variables
self.last_values = {var["name"]: [0, None] for block in blocks for var in block["curves"]}

View File

@ -19,17 +19,24 @@ def convert_par(module, name, par):
def convert_cmd(module, name, cmd):
result = dict(type='input', button=True, name=module+":"+name, title=name)
result = dict(type='pushbutton', name=module+":"+name, title=name)
result['command'] = 'do %s:%s' % (module, name)
argument = cmd['datainfo'].get('argument')
if cmd['datainfo'].get('result'):
result['result'] = True
else:
if not argument: # simple command like stop
return result
result['button'] = not argument
# result['type'] = pushbutton will be replaced below
if argument:
if argument['type'] == 'enum':
result['enum_names'] = [dict(title=k, value=v) for k, v in argument['members'].items()]
result['type'] = 'enum'
elif argument['type'] == 'bool':
result['type'] = 'checkbox'
else:
result['type'] = 'input'
else:
result['type'] = 'rdonly'
if cmd['description']:

View File

@ -297,7 +297,7 @@ def replace_by_empty(file):
@app.route('/')
def default():
if not any(flask.request.values.get(k) for k in ('instrument', 'server', 'device')):
if not any(flask.request.values.get(k) for k in ('instrument', 'stream', 'device')):
if not server.single_instrument:
return select_experiment()
return general_file('SEAWebClient.html')