Support demo users
Some checks failed
Run Tests / run-tests (push) Failing after 1m2s

This commit is contained in:
2026-05-01 17:41:42 +02:00
parent a88d1b4e79
commit 0632899f7a
11 changed files with 169 additions and 134 deletions

View File

@@ -2,19 +2,17 @@ import streamlit as st
import queries.crud as crud
import themes as th
is_login_enabled = hasattr(st, 'user') and hasattr(st.user, 'is_logged_in')
is_logged_in = is_login_enabled and st.user.is_logged_in
from user import is_logged_in, is_login_enabled
st.title("Settings")
if hasattr(st.session_state, 'user_name'):
if hasattr(st.session_state, 'user_name') and st.session_state.user_name:
st.markdown(f"Currently logged in as **{st.session_state.user_name}**")
st.header("Theme")
themes = st.session_state.themes
with st.container(horizontal=True, width="stretch"):
for theme in ["light", "dark"]:
for theme in themes.keys():
if st.button(label=themes[theme]["button_face_label"],
icon = themes[theme]["button_face_icon"],
disabled = (theme == st.session_state.current_theme),
@@ -61,8 +59,9 @@ with st.container(key="settings-color-selector"):
""", width=400)
st.header("Actions")
with st.container():
if is_logged_in:
if st.button("Logout", icon=":material/logout:", width="stretch"):
st.logout()
if is_login_enabled():
st.header("Actions")
with st.container():
if is_logged_in():
if st.button("Logout", icon=":material/logout:", width="stretch"):
st.logout()