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
No related branches found
No related tags found
No related merge requests found
......@@ -56,12 +56,19 @@ def create_panel(data):
return template.render({**data, 'yaxes': yaxes, 'targets': targets})
def render_dashboard(dashboard):
file = os.path.abspath(os.path.join(
os.path.dirname(__file__),
'templates',
'shared',
'dashboard.json.j2'))
def render_dashboard(dashboard, nren=False):
if nren:
file = os.path.abspath(os.path.join(
os.path.dirname(__file__),
'templates',
'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:
template = jinja2.Template(f.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment