Skip to content

Commit 7921a6f

Browse files
authored
Add support for configurable page title
1 parent d89e068 commit 7921a6f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

mqttdblg/config.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ DEFAULT_RANGE = 2
2929
DEFAULT_GRAPH = acin
3030
# Topics to graph, used in the dropdown selection box. JSON formatted, topic first, pretty label after.
3131
GRAPHED_TOPICS = {"load":"Load (%)", "acoutw":"Load (W)", "heatsinktemp":"Temp (°C)", "acin":"AC In (V)", "acinhz":"AC In (Hz)", "acout":"AC Out (V)", "acouthz":"AC Out (Hz)", "battv":"Battery (V)", "battcappa":"Capacity (%)", "battdischrg":"Discharge (A)"}
32+
# Page title
33+
PAGE_TITLE = Historical Data

mqttdblg/mqttdbgrapher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
config.read('config.ini', 'UTF-8')
88

99
database_file = config.get('config', 'DATABASE_FILE')
10+
page_title = config.get('config', 'PAGE_TITLE')
1011
root_topic = config.get('config', 'ROOT_TOPIC')
1112
default_range = int(config.get('config', 'DEFAULT_RANGE'))
1213
default_graph = config.get('config', 'DEFAULT_GRAPH')
@@ -24,7 +25,7 @@ def load(datasource):
2425

2526
@app.route("/graph")
2627
def graph():
27-
return render_template('graph.html', default_range=default_range, default_graph=default_graph, graphed_topics=graphed_topics)
28+
return render_template('graph.html', page_title=page_title, default_range=default_range, default_graph=default_graph, graphed_topics=graphed_topics)
2829

2930
if __name__ == '__main__':
3031
app.run(

0 commit comments

Comments
 (0)