plesna/dashboard/app.py

34 lines
969 B
Python
Raw Normal View History

2024-07-27 13:55:20 +00:00
import dash
from dash import Dash, html, dcc
2024-07-27 15:39:09 +00:00
from .pages import home, config
2024-07-27 13:55:20 +00:00
2024-07-27 16:21:42 +00:00
external_scripts = [
{'src': 'https://cdn.tailwindcss.com'}
]
# external_script = ["https://tailwindcss.com/", {"src": "https://cdn.tailwindcss.com"}]
app = Dash(__name__, use_pages=True, external_scripts=external_scripts)
app.scripts.config.serve_locally = True
2024-07-27 15:39:09 +00:00
dash.register_page(home.__name__, path='/', layout=home.layout)
dash.register_page(config.__name__, path='/config', layout=config.layout)
2024-07-27 13:55:20 +00:00
app.layout = html.Div([
html.Div([
2024-07-27 16:21:42 +00:00
dcc.Link(
html.H1('Plesna', ),
href="/",
className="text-4xl p-4 text-center grow align-baseline"
),
dcc.Link("Config",
href="/config",
className="flex-none hover:bg-gray-300 p-4 align-middle"
)
],
className="bg-gray-100 flex flex-row"
),
2024-07-27 13:55:20 +00:00
dash.page_container
])
if __name__ == '__main__':
app.run(debug=True)