Skip to content

Commit

Permalink
Merge d879ab7 into f819f2d
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianrakel committed Oct 4, 2021
2 parents f819f2d + d879ab7 commit 9dad505
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions puppetboard/app.py
Expand Up @@ -64,28 +64,26 @@
puppetdb = get_puppetdb()


def build_menuentries():
entries = {
'index': 'Overview',
'nodes': 'Nodes',
'facts': 'Facts',
'reports': 'Reports',
'metrics': 'Metrics',
'inventory': 'Inventory',
'catalogs': 'Catalogs',
'radiator': 'Radiator',
'query': 'Query'
}
if not app.config.get('ENABLE_QUERY'):
del(entries['query'])
menu_entries = [
('index', 'Overview'),
('nodes', 'Nodes'),
('facts', 'Facts'),
('reports', 'Reports'),
('metrics', 'Metrics'),
('inventory', 'Inventory'),
('catalogs', 'Catalogs'),
('radiator', 'Radiator'),
('query', 'Query')
]

if not app.config.get('ENABLE_CATALOG'):
del(entries['catalogs'])
if not app.config.get('ENABLE_QUERY'):
menu_entries.remove(('query', 'Query'))

return ((x, entries[x]) for x in entries)
if not app.config.get('ENABLE_CATALOG'):
menu_entries.remove(('catalogs', 'Catalogs'))


app.jinja_env.globals.update(menu_entries=build_menuentries())
app.jinja_env.globals.update(menu_entries=menu_entries)


@app.template_global()
Expand Down

0 comments on commit 9dad505

Please sign in to comment.