Update app.py
Browse files
app.py
CHANGED
@@ -22,10 +22,10 @@ if not initialize_database_connections():
|
|
22 |
|
23 |
def main_interface():
|
24 |
"""
|
25 |
-
|
26 |
"""
|
27 |
with gr.Blocks() as app_interface:
|
28 |
-
# Contenedores para las
|
29 |
landing_container = gr.Group(visible=True)
|
30 |
login_container = gr.Group(visible=False)
|
31 |
|
@@ -33,9 +33,10 @@ def main_interface():
|
|
33 |
landing_page = create_landing_interface()
|
34 |
login_page = create_login_interface()
|
35 |
|
|
|
36 |
def handle_navigation(page="landing"):
|
37 |
"""
|
38 |
-
|
39 |
"""
|
40 |
if page == "login":
|
41 |
return {
|
@@ -49,11 +50,11 @@ def main_interface():
|
|
49 |
|
50 |
# Landing Page
|
51 |
with landing_container:
|
52 |
-
landing_page
|
53 |
|
54 |
# Login Page
|
55 |
with login_container:
|
56 |
-
login_page
|
57 |
|
58 |
return app_interface
|
59 |
|
|
|
22 |
|
23 |
def main_interface():
|
24 |
"""
|
25 |
+
Crea la interfaz principal con redirecci贸n al login o landing.
|
26 |
"""
|
27 |
with gr.Blocks() as app_interface:
|
28 |
+
# Contenedores para las p谩ginas
|
29 |
landing_container = gr.Group(visible=True)
|
30 |
login_container = gr.Group(visible=False)
|
31 |
|
|
|
33 |
landing_page = create_landing_interface()
|
34 |
login_page = create_login_interface()
|
35 |
|
36 |
+
# Manejo de navegaci贸n
|
37 |
def handle_navigation(page="landing"):
|
38 |
"""
|
39 |
+
Redirige entre Landing Page y Login.
|
40 |
"""
|
41 |
if page == "login":
|
42 |
return {
|
|
|
50 |
|
51 |
# Landing Page
|
52 |
with landing_container:
|
53 |
+
landing_page(navigate_to_login=lambda: handle_navigation("login"))
|
54 |
|
55 |
# Login Page
|
56 |
with login_container:
|
57 |
+
login_page(navigate_back=lambda: handle_navigation("landing"))
|
58 |
|
59 |
return app_interface
|
60 |
|