From c21677dbd2e819c250a0a138376c289e8e0951e9 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Mon, 18 Sep 2017 16:17:45 +0200 Subject: [PATCH] DASH: navbar in bs base view & new bs pv_overview --- python_suite/dashboard/dashboard.py | 6 ++- python_suite/dashboard/example.config.json | 20 +++++++++- python_suite/dashboard/views/base.jinja2 | 2 +- .../dashboard/views/base_bootstrap.jinja2 | 37 ++++++++++++------- python_suite/dashboard/views/gview.jinja2 | 4 +- 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/python_suite/dashboard/dashboard.py b/python_suite/dashboard/dashboard.py index d7710a5..2643667 100755 --- a/python_suite/dashboard/dashboard.py +++ b/python_suite/dashboard/dashboard.py @@ -190,7 +190,11 @@ def list_pvs(page): @route('/gview/') @view('gview.jinja2') def gview(name): - return {'config': CONFIG, 'svg': name} + try: + svg = CONFIG['pages'][name]['gview'] + except KeyError: + return abort(404, 'Page not found') + return {'config': CONFIG, 'svg': svg} @route('/api/values.json') @json_replace_nan() diff --git a/python_suite/dashboard/example.config.json b/python_suite/dashboard/example.config.json index d014643..f8d52c3 100644 --- a/python_suite/dashboard/example.config.json +++ b/python_suite/dashboard/example.config.json @@ -99,8 +99,10 @@ {"name": "CBM:MVD:PT100:VAC:CONV_RATE"} ], "page_hierarchy": { - "top": ["general_overview"], - "general_overview": ["cooling_system", "low_voltage_system"] + "top": ["top_list"], + "top_gview": ["gview_cooling", "gview_cooling_vac"], + "top_list": ["general_overview"], + "general_overview": ["cooling_system", "low_voltage_system", "relhum"] }, "pages": { "general_overview": { @@ -114,12 +116,26 @@ "temperature" ] }, + "gview_cooling": { + "name": "PRESTO Cooling System", + "gview": "/static/gview/cooling.svg" + }, + "gview_cooling_vac": { + "name": "PRESTO Cooling & Vaccum System", + "gview": "/static/gview/Cooling.svg" + }, "cooling_system": { "name": "Details Cooling System", "groups": [ "cooling_extended" ] }, + "relhum": { + "name": "Relative Humidity", + "groups": [ + "relhum" + ] + }, "low_voltage_system": { "name": "Details Low Voltage", "groups": [ diff --git a/python_suite/dashboard/views/base.jinja2 b/python_suite/dashboard/views/base.jinja2 index 5a279f7..fdafa5d 100644 --- a/python_suite/dashboard/views/base.jinja2 +++ b/python_suite/dashboard/views/base.jinja2 @@ -14,7 +14,7 @@

PRESTO - Overview
Prototype of the Second Station of the Micro Vertex Detector of the Compressed Baryonic Matter