-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepoui.py
54 lines (42 loc) · 1.35 KB
/
repoui.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
import panel as pn
pn.extension(
"gridstack", "tabulator", "codeeditor", notifications=True, design="native"
)
import datetime as dt
import sys
from dms_datastore_ui import fullscreen
main_panel = pn.Column(
pn.indicators.LoadingSpinner(
value=True, color="primary", size=50, name="Loading..."
)
)
sidebar_panel = pn.Column(
pn.indicators.LoadingSpinner(
value=True, color="primary", size=50, name="Loading..."
)
)
template = pn.template.VanillaTemplate(
title="DMS Datastore",
sidebar=[sidebar_panel],
main=[main_panel],
sidebar_width=650,
header_color="blue",
logo="https://sciencetracker.deltacouncil.ca.gov/themes/custom/basic/images/logos/DWR_Logo.png",
)
def load_explorer():
import dms_datastore_ui.map_inventory_explorer as mie
dir = "continuous"
explorer = mie.StationInventoryExplorer(dir)
te = explorer.create_view()
# Clear existing content first
main_panel.clear()
sidebar_panel.clear()
for obj in te.sidebar.objects:
sidebar_panel.append(obj)
# Add objects individually to ensure proper reactivity
for obj in te.main.objects:
main_panel.append(pn.panel(obj))
# Add the disclaimer text to the modal
template.modal.append(explorer.get_disclaimer_text())
pn.state.onload(load_explorer)
template.servable(title="Station Inventory Explorer")