Spaces:
Sleeping
Sleeping
Update ui/navigator_tab.py
Browse files- ui/navigator_tab.py +7 -1
ui/navigator_tab.py
CHANGED
|
@@ -18,11 +18,15 @@ def reset_all():
|
|
| 18 |
{} # state
|
| 19 |
)
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Main UI builder
|
| 22 |
def create_navigator_tab():
|
| 23 |
with gr.TabItem("π§ Navigator"):
|
| 24 |
with gr.Row():
|
| 25 |
-
country = gr.Dropdown(label="π Country", choices=
|
| 26 |
state = gr.Dropdown(label="π State", choices=[], interactive=True)
|
| 27 |
city = gr.Dropdown(label="π City", choices=[], interactive=True)
|
| 28 |
store = gr.Dropdown(label="πͺ Store", choices=[], interactive=True)
|
|
@@ -80,3 +84,5 @@ def create_navigator_tab():
|
|
| 80 |
result, data_state
|
| 81 |
]
|
| 82 |
)
|
|
|
|
|
|
|
|
|
| 18 |
{} # state
|
| 19 |
)
|
| 20 |
|
| 21 |
+
# Load choices on app load
|
| 22 |
+
def load_initial_country_choices():
|
| 23 |
+
return gr.update(choices=get_subfolders(BASE_DIR), value=None)
|
| 24 |
+
|
| 25 |
# Main UI builder
|
| 26 |
def create_navigator_tab():
|
| 27 |
with gr.TabItem("π§ Navigator"):
|
| 28 |
with gr.Row():
|
| 29 |
+
country = gr.Dropdown(label="π Country", choices=[], interactive=True)
|
| 30 |
state = gr.Dropdown(label="π State", choices=[], interactive=True)
|
| 31 |
city = gr.Dropdown(label="π City", choices=[], interactive=True)
|
| 32 |
store = gr.Dropdown(label="πͺ Store", choices=[], interactive=True)
|
|
|
|
| 84 |
result, data_state
|
| 85 |
]
|
| 86 |
)
|
| 87 |
+
|
| 88 |
+
return country, # so we can use it in demo.load() from layout.py
|