Update modules/ui/views/dashboard_view.py
Browse files
modules/ui/views/dashboard_view.py
CHANGED
|
@@ -1,26 +1,18 @@
|
|
| 1 |
-
# modules/ui/views/
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
class DashboardView:
|
| 5 |
-
def __init__(self):
|
| 6 |
-
with gr.Blocks() as self.view:
|
| 7 |
-
with gr.Column():
|
| 8 |
-
gr.Markdown("# Panel de Control")
|
| 9 |
-
with gr.Row():
|
| 10 |
-
self.username_display = gr.Textbox(
|
| 11 |
-
label="Usuario",
|
| 12 |
-
interactive=False
|
| 13 |
-
)
|
| 14 |
-
self.role_display = gr.Textbox(
|
| 15 |
-
label="Rol",
|
| 16 |
-
interactive=False
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
self.logout_button = gr.Button("Cerrar Sesi贸n")
|
| 20 |
-
|
| 21 |
-
@property
|
| 22 |
-
def submit(self):
|
| 23 |
-
return self.logout_button.click
|
| 24 |
-
|
| 25 |
def create_dashboard_view():
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# modules/ui/views/dashboard_view.py
|
| 2 |
import gradio as gr
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
def create_dashboard_view():
|
| 5 |
+
"""Crea la vista del dashboard"""
|
| 6 |
+
with gr.Blocks() as view:
|
| 7 |
+
gr.Markdown("# Panel de Control")
|
| 8 |
+
with gr.Row():
|
| 9 |
+
username_display = gr.Textbox(label="Usuario", interactive=False)
|
| 10 |
+
role_display = gr.Textbox(label="Rol", interactive=False)
|
| 11 |
+
|
| 12 |
+
logout_button = gr.Button("Cerrar Sesi贸n")
|
| 13 |
+
|
| 14 |
+
# Asignar componentes al view
|
| 15 |
+
view.username = username_display
|
| 16 |
+
view.role = role_display
|
| 17 |
+
|
| 18 |
+
return view, logout_button
|