File size: 2,121 Bytes
312b9eb 42a94ae 312b9eb 3ae8d99 f0662e2 9382be8 27ecc43 9382be8 55e7c55 3ae8d99 7f4ef9c 3ae8d99 7f4ef9c 3ae8d99 7f4ef9c 3ae8d99 f0662e2 0f459c2 7f4ef9c 0f459c2 7f4ef9c 0f459c2 3ae8d99 7f4ef9c 3ae8d99 7f4ef9c 3ae8d99 7f4ef9c 3ae8d99 f0662e2 0f459c2 7f4ef9c f0662e2 3ae8d99 312b9eb 3ae8d99 312b9eb 3ae8d99 |
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
import streamlit as st
import os
if "logged_in" not in st.session_state:
st.session_state.logged_in = False
def login():
st.write("# SKT AI Fellowship Team ASAP 👋")
with st.form("Login"):
st.write("### Login")
username = st.text_input("Username", type="default")
password = st.text_input("Password", type="password")
login = st.form_submit_button("Login")
if login:
# if username== st.secrets["auth"]["username"] and password == st.secrets["auth"]["password"]:
if username== os.getenv("username") and password == os.getenv("password"):
st.session_state.logged_in = True
st.rerun()
else:
st.error("Username 또는 Password가 일치하지 않습니다.")
def logout():
st.session_state.logged_in = False
st.rerun()
login_page = st.Page(login, title="Login", icon=":material/login:")
logout_page = st.Page(logout, title="Logout", icon=":material/logout:")
Home = st.Page(
"Pages/Home.py",
title="Home",
icon=":material/home:"
)
About = st.Page(
"Pages/About.py",
title="About",
icon=":material/info:"
)
Data = st.Page(
"Pages/Data.py",
title="Data",
icon=":material/data_usage:"
)
Algorithm = st.Page(
"Pages/Algorithm.py",
title="Algorithm",
icon=":material/insights:"
)
Dashboard = st.Page(
"Pages/Dashboard.py",
title="Dashboard",
icon=":material/dashboard:"
)
Recommendation_By_Time = st.Page(
"Pages/Recommendation_By_Time.py",
title="Recommendation By Time",
icon=":material/schedule:"
)
Time_Window_Recommendation = st.Page(
"Pages/Time_Window_Recommendation.py",
title="Time Window Recommendation",
icon=":material/calendar_view_day:"
)
if st.session_state.logged_in:
pg = st.navigation(
{
"": [Home, About],
# "Development": [Data, Algorithm],
"System" : [Dashboard, Recommendation_By_Time, Time_Window_Recommendation],
"Account": [logout_page]
}
)
else:
pg = st.navigation([login_page])
pg.run() |