Skip to content
Snippets Groups Projects
Commit 62a92e71 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Add template choice to render_dashboard

parent e849043b
Branches
Tags
No related merge requests found
...@@ -56,12 +56,19 @@ def create_panel(data): ...@@ -56,12 +56,19 @@ def create_panel(data):
return template.render({**data, 'yaxes': yaxes, 'targets': targets}) return template.render({**data, 'yaxes': yaxes, 'targets': targets})
def render_dashboard(dashboard): def render_dashboard(dashboard, nren=False):
file = os.path.abspath(os.path.join( if nren:
os.path.dirname(__file__), file = os.path.abspath(os.path.join(
'templates', os.path.dirname(__file__),
'shared', 'templates',
'dashboard.json.j2')) 'nren_access',
'nren-dashboard.json.j2'))
else:
file = os.path.abspath(os.path.join(
os.path.dirname(__file__),
'templates',
'shared',
'dashboard.json.j2'))
with open(file) as f: with open(file) as f:
template = jinja2.Template(f.read()) template = jinja2.Template(f.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment