-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
42 lines (35 loc) · 1.29 KB
/
Copy pathapp.py
File metadata and controls
42 lines (35 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from pathlib import Path
import streamlit as st
# --- Config + masquage sidebar ---
st.set_page_config(page_title="Projet Signaux", layout="centered", initial_sidebar_state="collapsed")
st.markdown("<style>[data-testid='stSidebar'],[data-testid='stSidebarNav']{display:none;}</style>", unsafe_allow_html=True)
st.title("Projet Signaux")
# Lien clair vers la page de tests (PAS de switch_page)
st.page_link("pages/test_son.py", label="Page test")
# --- Etat global minimal ---
FLAG = Path("registered.flag")
if "logged_in" not in st.session_state:
st.session_state.logged_in = False
# --- Flux simple d'inscription/connexion ---
if not FLAG.exists():
st.subheader("Inscription")
if st.button("S'enregistrer"):
FLAG.touch()
st.session_state.logged_in = False
st.rerun()
elif not st.session_state.logged_in:
st.subheader("Connexion")
col1, col2 = st.columns(2)
if col1.button("Se connecter"):
st.session_state.logged_in = True
st.rerun()
if col2.button("Supprimer le compte"):
FLAG.unlink(missing_ok=True)
st.session_state.logged_in = False
st.rerun()
else:
st.subheader("Compte")
st.success("Vous êtes connecté")
if st.button("Se déconnecter"):
st.session_state.logged_in = False
st.rerun()