diff options
author | Lukas Metzger | 2020-05-27 16:03:13 +0200 |
---|---|---|
committer | Lukas Metzger | 2020-05-27 16:03:13 +0200 |
commit | b44e62cd1bc982d0c6a7695c27808a2e59287509 (patch) | |
tree | d1e19ad2aa73ce40201ef4ec9d2e9879f345d637 | |
parent | Added dozmod statistics (diff) | |
download | bwlp-statistics-b44e62cd1bc982d0c6a7695c27808a2e59287509.tar.gz bwlp-statistics-b44e62cd1bc982d0c6a7695c27808a2e59287509.tar.xz bwlp-statistics-b44e62cd1bc982d0c6a7695c27808a2e59287509.zip |
Added deployment features
-rw-r--r-- | index.py | 7 | ||||
-rw-r--r-- | requirements.txt | 1 |
2 files changed, 7 insertions, 1 deletions
@@ -11,6 +11,7 @@ import plotly.express as px from app import app from pages import satellites, total, machines, locations, vms, dozmod +# Array of all available Pages pages = [ {'name': 'Satellites', 'link': '/', 'id': 'satellites', 'layout': satellites.layout}, {'name': 'Total', 'link': '/total', 'id': 'total', 'layout': total.layout}, @@ -20,6 +21,7 @@ pages = [ {'name': 'Dozmod', 'link': '/dozmod', 'id': 'dozmod', 'layout': dozmod.layout}, ] +# Set Graph Defaults pio.templates['custom'] = dict( layout=go.Layout( title=dict( @@ -35,7 +37,7 @@ pio.templates['custom'] = dict( ) pio.templates.default = 'custom' - +# Index Layout app.layout = html.Div([ dcc.Location(id='url', refresh=False), dbc.NavbarSimple(dark=True, color="dark", fluid=True, style={'marginBottom': '20px'}, children=[ @@ -44,6 +46,9 @@ app.layout = html.Div([ html.Div(id='page-content') ]) +# Expose Server for Deployment +server = app.server + @app.callback(Output('page-content', 'children'), [Input('url', 'pathname')]) def display_page(pathname): diff --git a/requirements.txt b/requirements.txt index 4e0e72c..0baad9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ dash-table==4.7.0 Flask==1.1.2 Flask-Compress==1.5.0 future==0.18.2 +gunicorn==20.0.4 humanize==2.4.0 itsdangerous==1.1.0 Jinja2==2.11.2 |