streamlit-userverwaltung/pages/users.py

34 lines
602 B
Python

import os
import json
import streamlit as st
import pandas as pd
import template
template.authenticate()
template.make_logout_section()
def read_config():
with open(os.getcwd()+"/config/users.json") as file:
return json.load(file)
config = read_config()
st.write(config['users'])
df_users = pd.DataFrame(config['users'])
st.header('Benutzerverwaltung')
col1, col2, col3 = st.columns(3)
with col1:
pass
with col2:
st.metric('Benutzer Gesamt', 10, 20)
edited_df = st.data_editor(df_users, hide_index=True, use_container_width=True, num_rows="dynamic")
st.write(edited_df)