Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import streamlit.components.v1 as components | |
| import os | |
| # μ¬μ©μ μ΄λ¦κ³Ό λΉλ°λ²νΈ μ€μ (μ€μ μ ν리μΌμ΄μ μμλ 보μμ μν΄ νκ²½λ³μλ μμ ν μ μ₯μ μ¬μ© κΆμ₯) | |
| vid = os.getenv('vid') | |
| vpw = os.getenv('vpw') | |
| # Vapi.ai νμ΄μ§ URL | |
| api_url = os.getenv('api_url') | |
| # λ‘κ·ΈμΈ μν μ μ₯μ μν Session State μ¬μ© | |
| if 'login_status' not in st.session_state: | |
| st.session_state['login_status'] = False | |
| # λ‘κ·ΈμΈ ν¨μ | |
| def login(username, password): | |
| if username == vid and password == vpw: | |
| st.session_state['login_status'] = True | |
| else: | |
| st.session_state['login_status'] = False | |
| st.error("Incorrect username or password.") | |
| # λ‘κ·ΈμΈ νΌ | |
| if not st.session_state['login_status']: | |
| st.title("Login") | |
| with st.form("login_form"): | |
| username = st.text_input("Username") | |
| password = st.text_input("Password", type="password") | |
| login_button = st.form_submit_button("Login", on_click=login, args=(username, password)) | |
| if st.session_state['login_status']: | |
| st.title('νλ©΄μ ν΄λ¦νλ©΄ λνκ° μμλ©λλ€.') | |
| components.iframe(api_url, width=700, height=400, scrolling=True) | |