|
import streamlit as st |
|
from ..database.database import create_student_user |
|
|
|
def admin_page(): |
|
st.title("Panel de Administraci贸n AIdeaText") |
|
st.write(f"Bienvenido, {st.session_state.username}") |
|
|
|
st.header("Crear Nuevo Usuario Estudiante") |
|
new_username = st.text_input("Correo electr贸nico del nuevo usuario", key="admin_new_username") |
|
new_password = st.text_input("Contrase帽a", type="password", key="admin_new_password") |
|
if st.button("Crear Usuario", key="admin_create_user"): |
|
if create_student_user(new_username, new_password): |
|
st.success(f"Usuario estudiante {new_username} creado exitosamente") |
|
else: |
|
st.error("Error al crear el usuario estudiante") |
|
|
|
|
|
|
|
if st.button("Cerrar Sesi贸n", key="admin_logout"): |
|
st.session_state.clear() |
|
st.experimental_rerun() |