Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1810,24 +1810,41 @@ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft(primary_hue="indigo")) as de
|
|
| 1810 |
outputs=analytics_display
|
| 1811 |
)
|
| 1812 |
|
| 1813 |
-
|
| 1814 |
-
|
| 1815 |
-
|
| 1816 |
-
|
| 1817 |
-
|
| 1818 |
-
|
| 1819 |
-
|
| 1820 |
-
|
| 1821 |
-
|
| 1822 |
-
|
| 1823 |
-
|
| 1824 |
-
|
| 1825 |
-
|
| 1826 |
-
|
| 1827 |
-
|
| 1828 |
-
|
| 1829 |
-
)
|
| 1830 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1831 |
register_btn.click(
|
| 1832 |
fn=register_student,
|
| 1833 |
inputs=[reg_username, reg_password, reg_name],
|
|
|
|
| 1810 |
outputs=analytics_display
|
| 1811 |
)
|
| 1812 |
|
| 1813 |
+
def login_function():
|
| 1814 |
+
# This function runs when the login button is clicked
|
| 1815 |
+
return (
|
| 1816 |
+
gr.update(visible=False), # login_group
|
| 1817 |
+
gr.update(visible=True), # main_app
|
| 1818 |
+
gr.update(value=[]), # chatbot
|
| 1819 |
+
gr.update(visible=True), # files
|
| 1820 |
+
gr.update(visible=True), # assignments_display
|
| 1821 |
+
gr.update(visible=True), # groups_display
|
| 1822 |
+
gr.update(value="✅ Logged in successfully!", visible=True), # login_status
|
| 1823 |
+
gr.update(visible=True), # user_display
|
| 1824 |
+
gr.update(visible=True), # logout_btn
|
| 1825 |
+
gr.update(visible=True), # avatar_display
|
| 1826 |
+
gr.update(visible=True), # dark_mode_btn
|
| 1827 |
+
gr.update() # css placeholder (no change)
|
| 1828 |
+
)
|
|
|
|
| 1829 |
|
| 1830 |
+
login_btn.click(
|
| 1831 |
+
fn=login_function,
|
| 1832 |
+
inputs=[],
|
| 1833 |
+
outputs=[
|
| 1834 |
+
login_group,
|
| 1835 |
+
main_app,
|
| 1836 |
+
chatbot,
|
| 1837 |
+
files,
|
| 1838 |
+
assignments_display,
|
| 1839 |
+
groups_display,
|
| 1840 |
+
login_status,
|
| 1841 |
+
user_display,
|
| 1842 |
+
logout_btn,
|
| 1843 |
+
avatar_display,
|
| 1844 |
+
dark_mode_btn,
|
| 1845 |
+
css_placeholder
|
| 1846 |
+
]
|
| 1847 |
+
)
|
| 1848 |
register_btn.click(
|
| 1849 |
fn=register_student,
|
| 1850 |
inputs=[reg_username, reg_password, reg_name],
|