feat: init dashboard
This commit is contained in:
parent
1ed6ed43ed
commit
ed6d1c87d1
17
dashboard/app.py
Normal file
17
dashboard/app.py
Normal file
@ -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)
|
17
dashboard/pages/config.py
Normal file
17
dashboard/pages/config.py
Normal file
@ -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()]),
|
||||
])
|
9
dashboard/pages/home.py
Normal file
9
dashboard/pages/home.py
Normal file
@ -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.'),
|
||||
])
|
Loading…
Reference in New Issue
Block a user