Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files27 unmodified lines282930313233344 unmodified lines394041424344454647484950515253545527 unmodified linesst.title("๐ DS Gaming - CS 1.6 Admin Dashboard")uploaded_file = st.file_uploader("Upload a server log file (*.log) or an **admins.txt** file containing the admin names, with one name per line.", type=["log", "txt"])# --- Globals -----------------------------------------------------------------DATA_DIR = Path(__file__).resolve().parent / "data"4 unmodified lines# --- CASE 1: Admin list (.txt) uploaded ---if uploaded_file.name.endswith(".txt"):# --- Grab Admin Names from File ------------------------------------------content = uploaded_file.getvalue().decode("utf-8")admins = [line.strip() for line in content.splitlines() if line.strip()]# --- GameTracker Section -------------------------------------------------st.subheader("๐ฎ GameTracker Playtime")with st.spinner("โณ Fetching GameTracker Data..."):gt_results = fetch_playtimes(admins)# gt_results = fetch_playtimes(ADMIN_FILE)# --- Leaderboard ---------------------------------------------------------st.subheader("๐ Leaderboard (Minutes Played)")if gt_results:leaderboard = pd.DataFrame({27 unmodified lines282930313233344 unmodified lines3940414243444546474849505152535455565758596061626327 unmodified linesst.title("๐ DS Gaming - CS 1.6 Admin Dashboard")uploaded_file = st.file_uploader("Upload a server log file (*.log) or an **admins_type.txt** file containing the admin names, with one name per line. The type can be either **public** or **afk**.", type=["log", "txt"])# --- Globals -----------------------------------------------------------------DATA_DIR = Path(__file__).resolve().parent / "data"4 unmodified lines# --- CASE 1: Admin list (.txt) uploaded ---if uploaded_file.name.endswith(".txt"):# --- Grab Admin Names from File --------------------------------------content = uploaded_file.getvalue().decode("utf-8")admins = [line.strip() for line in content.splitlines() if line.strip()]# --- Check if AFK or PUBLIC ------------------------------------------if "afk" in uploaded_file.name:server = "afk"else:server = "public"st.info(f"Grabbing data from DS GAMING {server.upper()} SERVER.")# --- GameTracker Section ---------------------------------------------st.subheader("๐ฎ GameTracker Playtime")with st.spinner("โณ Fetching GameTracker Data..."):gt_results = fetch_playtimes(admins, server)# gt_results = fetch_playtimes(ADMIN_FILE)# --- Leaderboard -----------------------------------------------------st.subheader("๐ Leaderboard (Minutes Played)")if gt_results:leaderboard = pd.DataFrame({
src/streamlit_app.py+13-5