File size: 787 Bytes
614f4c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# modules/ui/views/user_dashboard.py
import gradio as gr

class DashboardView:
    def __init__(self):
        with gr.Blocks() as self.view:
            with gr.Column():
                gr.Markdown("# Panel de Control")
                with gr.Row():
                    self.username_display = gr.Textbox(
                        label="Usuario",
                        interactive=False
                    )
                    self.role_display = gr.Textbox(
                        label="Rol",
                        interactive=False
                    )
                
                self.logout_button = gr.Button("Cerrar Sesión")

    @property
    def submit(self):
        return self.logout_button.click

def create_dashboard_view():
    return DashboardView().view