From 98c4cb608c41c6a091c1b971f3b6afb31bd91c4d Mon Sep 17 00:00:00 2001 From: tparkercbn Date: Wed, 18 Oct 2017 12:50:54 -0400 Subject: [PATCH] Make the page title in the html templates a variable in default_settings.py (#378) Make the page title configurable. Admins with many sites running separate puppetservers with separate puppetbords may find it useful to be able to chagen the page title from Puppetboard to something more site specific. --- puppetboard/default_settings.py | 1 + puppetboard/docker_settings.py | 1 + puppetboard/templates/layout.html | 2 +- puppetboard/templates/radiator.html | 2 +- test/test_app.py | 20 ++++++++++++++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/puppetboard/default_settings.py b/puppetboard/default_settings.py index 7bd6cc1..d33126c 100644 --- a/puppetboard/default_settings.py +++ b/puppetboard/default_settings.py @@ -26,6 +26,7 @@ DISPLAYED_METRICS = ['resources.total', OFFLINE_MODE = False ENABLE_CATALOG = False OVERVIEW_FILTER = None +PAGE_TITLE = "Puppetboard" GRAPH_TYPE = 'pie' GRAPH_FACTS = ['architecture', 'clientversion', diff --git a/puppetboard/docker_settings.py b/puppetboard/docker_settings.py index 3f61b33..b797906 100644 --- a/puppetboard/docker_settings.py +++ b/puppetboard/docker_settings.py @@ -43,6 +43,7 @@ DISPLAYED_METRICS = [x.strip() for x in os.getenv('DISPLAYED_METRICS', OFFLINE_MODE = bool(os.getenv('OFFLINE_MODE', 'False').upper() == 'TRUE') ENABLE_CATALOG = bool(os.getenv('ENABLE_CATALOG', 'False').upper() == 'TRUE') OVERVIEW_FILTER = os.getenv('OVERVIEW_FILTER', None) +PAGE_TITLE = os.getenv('PAGE_TITLE', 'Puppetboard') GRAPH_FACTS_DEFAULT = ','.join(['architecture', 'clientversion', 'domain', 'lsbcodename', 'lsbdistcodename', 'lsbdistid', diff --git a/puppetboard/templates/layout.html b/puppetboard/templates/layout.html index b3ee645..4395099 100644 --- a/puppetboard/templates/layout.html +++ b/puppetboard/templates/layout.html @@ -2,7 +2,7 @@ - Puppetboard + {{config.PAGE_TITLE}} {% if config.OFFLINE_MODE %}