Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os
|
|
5 |
def check_words(user_text, input_text):
|
6 |
# If the entered text is "user" and "casa", show Panel 2 and hide Panel 1
|
7 |
if user_text == os.getenv("USERNAME") and input_text == os.getenv("PASSWORD"):
|
8 |
-
return gr.update(visible=True), gr.update(visible=False) # Show Panel 2, hide Panel 1
|
9 |
else:
|
10 |
return gr.update(visible=False), gr.update(visible=True) # Keep Panel 2 hidden, show Panel 1
|
11 |
|
@@ -41,7 +41,7 @@ with gr.Blocks() as demo:
|
|
41 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
|
42 |
|
43 |
# Configure the buttons and the panel visibility
|
44 |
-
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1]) # Hide Panel 1 and show Panel 2
|
45 |
|
46 |
# Launch the Gradio interface
|
47 |
demo.launch()
|
|
|
5 |
def check_words(user_text, input_text):
|
6 |
# If the entered text is "user" and "casa", show Panel 2 and hide Panel 1
|
7 |
if user_text == os.getenv("USERNAME") and input_text == os.getenv("PASSWORD"):
|
8 |
+
return gr.update(visible=True), gr.update(visible=False, gr.update(value=""), gr.update(value="") # Show Panel 2, hide Panel 1
|
9 |
else:
|
10 |
return gr.update(visible=False), gr.update(visible=True) # Keep Panel 2 hidden, show Panel 1
|
11 |
|
|
|
41 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
|
42 |
|
43 |
# Configure the buttons and the panel visibility
|
44 |
+
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1, user_text, input_text]) # Hide Panel 1 and show Panel 2
|
45 |
|
46 |
# Launch the Gradio interface
|
47 |
demo.launch()
|