added users administration tool

This commit is contained in:
knedlik
2025-12-15 08:21:18 +01:00
parent e2091ec677
commit 13d747827d
11 changed files with 602 additions and 76 deletions

19
app/ui/selectboxes.py Normal file
View File

@@ -0,0 +1,19 @@
from app_db.app_db import get_list
def get_roles():
sql = """
select
role_id || ' | ' || role_text as text
from
roles
"""
df = get_list(sql)
return df
def get_id(id_text: str):
id = int(id_text.split("|")[0])
if not id:
id = ""
return id

View File

@@ -7,9 +7,6 @@ from app_db.app_db import get_conn, get_list
def build_sidebar():
# if st.session_state.get("authentication_status") != True:
# return
authenticator = st.session_state.get("authenticator")
username = st.session_state.get("name")
role_text = st.session_state.get("role_text")
@@ -24,14 +21,14 @@ def build_sidebar():
st.logo("app/images/GMN_Logo_neu_rgb.png", size="small")
st.markdown(f"**{fullname}** ({role_text})")
col1, col2, col3 = st.columns([2,2,1])
col1, col2 = st.columns([2,2])
with col1:
authenticator.logout("Logout")
with col2:
if st.button("Home", use_container_width=True):
if st.button("Home", use_container_width=True, icon=":material/home:"):
st.switch_page("pages/home.py")
# --- Suchfeld ---
@@ -41,9 +38,6 @@ def build_sidebar():
# Aktive Seite ermitteln (für Expander-Status / Highlight)
current_page = st.session_state.get("_page_path")
# --- DF filtern, falls Suchbegriff gesetzt ---
if query:
mask = (