diff --git a/dashboard/app.py b/dashboard/app.py new file mode 100644 index 0000000..7af5c57 --- /dev/null +++ b/dashboard/app.py @@ -0,0 +1,17 @@ +import dash +from dash import Dash, html, dcc + +app = Dash(__name__, use_pages=True) + +app.layout = html.Div([ + html.H1('Plesna'), + html.Div([ + html.Div( + dcc.Link(f"{page['name']} - {page['path']}", href=page["relative_path"]) + ) for page in dash.page_registry.values() + ]), + dash.page_container +]) + +if __name__ == '__main__': + app.run(debug=True) diff --git a/dashboard/pages/config.py b/dashboard/pages/config.py new file mode 100644 index 0000000..47a3bf7 --- /dev/null +++ b/dashboard/pages/config.py @@ -0,0 +1,17 @@ +import dash +from dash import html +from dotenv import dotenv_values +import os + +env = { + **dotenv_values(".env"), + **os.environ, +} + + +dash.register_page(__name__, path='/config') + +layout = html.Div([ + html.H1('This is our Config page'), + html.Ul(children = [html.Li(f"{k} = {v}") for k,v in env.items()]), +]) diff --git a/dashboard/pages/home.py b/dashboard/pages/home.py new file mode 100644 index 0000000..69f06c4 --- /dev/null +++ b/dashboard/pages/home.py @@ -0,0 +1,9 @@ +import dash +from dash import html + +dash.register_page(__name__, path='/') + +layout = html.Div([ + html.H1('This is our Home page'), + html.Div('This is our Home page content.'), +])