add admin page to manage private data

This commit is contained in:
Carl Zhang
2025-10-13 23:50:53 -05:00
parent c4066ed15e
commit 421d263b6b
9 changed files with 289 additions and 3 deletions

34
webpages/admin.py Normal file
View File

@@ -0,0 +1,34 @@
import streamlit as st
import pandas as pd
import streamlit_authenticator as stauth
from webpages.buffteks_authenticator import load_authenticator
from webpages.adminpages.helloween_image import camera_photo
def admin():
try:
authenticator = load_authenticator()
authenticator.login()
except Exception as e:
st.error(e)
if st.session_state.get('authentication_status') is False:
st.error('Username/password is incorrect')
elif st.session_state.get('authentication_status') is None:
st.warning('Please enter your username and password')
if st.session_state.get('authentication_status'):
authenticator.logout()
st.header(f'Welcome *{st.session_state.get("name")}*')
st.divider()
with st.expander("Check Memberships"):
new_members = pd.read_json("new_members.json")
st.dataframe(new_members)
st.divider()
camera_photo()