Commit 0c3d79dc authored by Patrick Godwin's avatar Patrick Godwin
Browse files

serve.py: add duration/gps checks for backwards compatibility

parent bd92ec6a
Pipeline #74597 passed with stages
in 1 minute and 58 seconds
...@@ -86,8 +86,12 @@ def index(): ...@@ -86,8 +86,12 @@ def index():
if config['dashboard']['type'] == 'online': if config['dashboard']['type'] == 'online':
if 'lookback' in bottle.request.query: if 'lookback' in bottle.request.query:
config['dashboard']['lookback'] = int(bottle.request.query['lookback']) config['dashboard']['lookback'] = int(bottle.request.query['lookback'])
elif 'duration' in config['dashboard']: ### backwards compatibility
config['dashboard']['lookback'] = config['dashboard']['duration']
if 'delay' in bottle.request.query: if 'delay' in bottle.request.query:
config['dashboard']['delay'] = int(bottle.request.query['delay']) config['dashboard']['delay'] = int(bottle.request.query['delay'])
elif 'gps' in config['dashboard'] and config['dashboard']['gps'] < 0: ### backwards compatibility
config['dashboard']['delay'] = - config['dashboard']['gps']
else: else:
config['dashboard']['start'] = int(bottle.request.query['start']) config['dashboard']['start'] = int(bottle.request.query['start'])
config['dashboard']['end'] = int(bottle.request.query['end']) config['dashboard']['end'] = int(bottle.request.query['end'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment