Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1968,15 +1968,8 @@ function refresh() {
|
|
| 1968 |
}
|
| 1969 |
"""
|
| 1970 |
|
| 1971 |
-
def
|
| 1972 |
-
|
| 1973 |
-
vw_customers_style = gr.Button.update(variant="primary") # Highlighted
|
| 1974 |
-
vw_prospects_style = gr.Button.update(variant="secondary") # Default
|
| 1975 |
-
else:
|
| 1976 |
-
vw_customers_style = gr.Button.update(variant="secondary") # Default
|
| 1977 |
-
vw_prospects_style = gr.Button.update(variant="primary") # Highlighted
|
| 1978 |
-
|
| 1979 |
-
return vw_customers_style, vw_prospects_style
|
| 1980 |
|
| 1981 |
with gr.Blocks(js=js_func) as demo:
|
| 1982 |
with gr.Column():
|
|
@@ -2020,8 +2013,7 @@ with gr.Blocks(js=js_func) as demo:
|
|
| 2020 |
vw_customers_state = gr.State(value=["VW Customers.xlsx"])
|
| 2021 |
vw_prospects_state = gr.State(value=["Volkswagen Non Customers.xlsx"])
|
| 2022 |
|
| 2023 |
-
|
| 2024 |
-
vw_prospects_btn.click(fn=update_buttons)
|
| 2025 |
|
| 2026 |
with gr.Column():
|
| 2027 |
gr.Markdown(
|
|
@@ -2088,6 +2080,11 @@ with gr.Blocks(js=js_func) as demo:
|
|
| 2088 |
inputs=[vw_prospects_state],
|
| 2089 |
outputs= outputs,
|
| 2090 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2091 |
|
| 2092 |
radio.change(fn=update_ai_dataset_selection, inputs=radio, outputs=[])
|
| 2093 |
demo.load(
|
|
@@ -2100,6 +2097,11 @@ with gr.Blocks(js=js_func) as demo:
|
|
| 2100 |
inputs=[vw_customers_state],
|
| 2101 |
outputs=outputs
|
| 2102 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2103 |
|
| 2104 |
|
| 2105 |
|
|
|
|
| 1968 |
}
|
| 1969 |
"""
|
| 1970 |
|
| 1971 |
+
def highlight_button(button_name):
|
| 1972 |
+
return gr.Button.update(variant="primary") # Highlight the clicked button
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1973 |
|
| 1974 |
with gr.Blocks(js=js_func) as demo:
|
| 1975 |
with gr.Column():
|
|
|
|
| 2013 |
vw_customers_state = gr.State(value=["VW Customers.xlsx"])
|
| 2014 |
vw_prospects_state = gr.State(value=["Volkswagen Non Customers.xlsx"])
|
| 2015 |
|
| 2016 |
+
|
|
|
|
| 2017 |
|
| 2018 |
with gr.Column():
|
| 2019 |
gr.Markdown(
|
|
|
|
| 2080 |
inputs=[vw_prospects_state],
|
| 2081 |
outputs= outputs,
|
| 2082 |
)
|
| 2083 |
+
vw_customers_btn.click(
|
| 2084 |
+
fn=highlight_button, # Highlight this button
|
| 2085 |
+
inputs=[vw_customers_state], # Pass the button name (optional, could also be omitted)
|
| 2086 |
+
outputs=vw_customers_btn, # Update only this button
|
| 2087 |
+
)
|
| 2088 |
|
| 2089 |
radio.change(fn=update_ai_dataset_selection, inputs=radio, outputs=[])
|
| 2090 |
demo.load(
|
|
|
|
| 2097 |
inputs=[vw_customers_state],
|
| 2098 |
outputs=outputs
|
| 2099 |
)
|
| 2100 |
+
demo.load(
|
| 2101 |
+
fn=highlight_button,
|
| 2102 |
+
inputs=[vw_customers_state], # Highlight VW Owners by default
|
| 2103 |
+
outputs=vw_customers_btn
|
| 2104 |
+
)
|
| 2105 |
|
| 2106 |
|
| 2107 |
|