-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
88 lines (80 loc) · 3.6 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import dash
import dash_design_kit as ddk
from dash import dcc, html, Input, Output, State, callback, no_update
import plotly.express as px
import dash_mantine_components as dmc
from datetime import datetime
import time
from constants import app
# import utils
from dash_iconify import DashIconify
server = app.server
df = px.data.stocks()
print(dash.page_registry.values())
app.layout = dmc.MantineProvider(
dmc.NotificationsProvider(
ddk.App(
[
ddk.Header(
[
ddk.Logo(src=app.get_asset_url("bofa_logo.png")),
ddk.Title("Bank of America Query Engine"),
html.Div(
dmc.Badge(
"latest deployment: "
+ datetime.today().strftime("%Y-%m-%d"),
size="sm",
fullWidth=False,
),
style={"width": "50px"},
),
ddk.Menu(
children=[
html.Div(
dmc.Menu(
children=[
dmc.MenuTarget(
dmc.Button(
DashIconify(
icon="material-symbols:menu"
),
style={
"border-radius": "4px",
},
),
),
dmc.MenuDropdown(
[
html.Div(
dmc.MenuItem(
[
f"{page['name']} - {page['path']}",
DashIconify(
icon="tabler:external-link"
),
],
href=page["relative_path"],
target="_blank",
icon=DashIconify(
icon="material-symbols:add"
),
),
)
for page in dash.page_registry.values()
]
),
]
)
),
]
)
]
),
dash.page_container,
],
show_editor=True,
)
)
)
if __name__ == "__main__":
app.run_server(debug=True)