From 8f7406c31b42171d4479a4b448b07285ce43c44f Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Fri, 25 Apr 2025 09:00:47 +0200 Subject: [PATCH] fixes for select_instrument --- client/jsFiles/SEAWebClientMain.js | 6 +++--- influxgraph.py | 2 ++ webserver.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/jsFiles/SEAWebClientMain.js b/client/jsFiles/SEAWebClientMain.js index 24032e5..d022caf 100644 --- a/client/jsFiles/SEAWebClientMain.js +++ b/client/jsFiles/SEAWebClientMain.js @@ -78,8 +78,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") @@ -87,7 +87,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; } diff --git a/influxgraph.py b/influxgraph.py index 9bbf008..53b9c5a 100644 --- a/influxgraph.py +++ b/influxgraph.py @@ -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"]} diff --git a/webserver.py b/webserver.py index acc93a8..aded0fd 100755 --- a/webserver.py +++ b/webserver.py @@ -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')