-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_page.py
53 lines (41 loc) · 1.74 KB
/
main_page.py
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
43
44
45
46
47
48
49
50
51
52
53
import streamlit as st
from streamlit_auth import add_auth, get_logged_in_user, require_auth
user_info=get_logged_in_user()
if "logged_in" not in st.session_state or user_info is None:
st.session_state.logged_in = False
if user_info is not None:
st.session_state.logged_in = True
# def login():
# # if st.button("Log in"):
# # st.session_state.logged_in = True
# # st.rerun()
# require_auth()
# st.rerun()
# def logout():
# if st.button("Log out"):
# st.session_state.logged_in = False
# st.rerun()
login_page = st.Page("user/login.py", title="Log in", icon=":material/login:")
#login_page = st.Page(login, title="Log in", icon=":material/login:")
# logout_page = st.Page(logout, title="Log out", icon=":material/logout:")
page_ili=st.Page("pathogens/Influenza_Like.py", title="Influenza Like Illness", icon=":material/dashboard:")
page_mpox=st.Page("pathogens/MPOX_Example.py", title="MPOX", icon=":material/dashboard:")
dashboards= [page_ili, page_mpox]
dashboard_page=st.Page("pages/dashboards.py", title="Pathogens", icon=":material/dashboard:")
catalog_page=st.Page("other/RSDataCatalog.py", title="Catalog", icon=":material/dataset:")
ai_page=st.Page("other/z_generativeAI.py", title="AI", icon=":material/school:")
network_page=st.Page("pages/network.py", title="Network", icon=":material/school:")
if st.session_state.logged_in:
pg = st.navigation({
#"Account": [logout_page],
"Resilent": [network_page],
"Dashboards": dashboards,
#"Dashboards_bad": [dashboard_page],
"Tools": [catalog_page, ai_page],
}
#, position="hidden",
)
else:
pg = st.navigation([login_page])
pg.run()
add_auth(required=False, show_sidebar=True )