import streamlit as st from st_pages import Page, Section, show_pages from streamlit_authenticator import Authenticate from utils.os_utils import read_yaml_file, dump_dict_to_yaml config = read_yaml_file("credentials.yml") if "authenticator" not in st.session_state: st.session_state.authenticator = Authenticate( config['credentials'], config['cookie']['name'], config['cookie']['key'], config['cookie']['expiry_days'], config['preauthorized'] ) if st.session_state["authentication_status"]: config["credentials"] = st.session_state.authenticator.credentials dump_dict_to_yaml(config, "credentials.yml") with st.sidebar: st.session_state.authenticator.logout('Logout', 'sidebar') st.write(f'Welcome *{st.session_state["name"]}*') show_pages( [ Page("main.py", "Hummingbot Dashboard", "๐Ÿ“Š"), Section("Bot Orchestration", "๐Ÿ™"), Page("pages/master_conf/app.py", "Credentials", "๐Ÿ—๏ธ"), Page("pages/launch_bot/app.py", "Launch Bot", "๐Ÿ™Œ"), Page("pages/bot_orchestration/app.py", "Instances", "๐Ÿฆ…"), Page("pages/file_manager/app.py", "Strategy Configs", "๐Ÿ—‚"), Section("Backtest Manager", "โš™๏ธ"), Page("pages/candles_downloader/app.py", "Get Data", "๐Ÿ’พ"), Page("pages/backtest_manager/create.py", "Create", "โš”๏ธ"), Page("pages/backtest_manager/optimize.py", "Optimize", "๐Ÿงช"), Page("pages/backtest_manager/analyze.py", "Analyze", "๐Ÿ”ฌ"), Page("pages/backtest_manager/analyze_v2.py", "Analyze v2", "๐Ÿ”ฌ"), Page("pages/backtest_manager/simulate.py", "Simulate", "๐Ÿ“ˆ"), Section("Community Pages", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"), Page("pages/strategy_performance/app.py", "Strategy Performance", "๐Ÿš€"), Page("pages/db_inspector/app.py", "DB Inspector", "๐Ÿ”"), Page("pages/token_spreads/app.py", "Token Spreads", "๐Ÿง™"), Page("pages/tvl_vs_mcap/app.py", "TVL vs Market Cap", "๐Ÿฆ‰"), ] ) # initialize_st_page(title="Hummingbot Dashboard", icon="๐Ÿ“Š", initial_sidebar_state="expanded") st.write("Watch this video to understand how the dashboard works! ๐Ÿฆ…") c1, c2, c3 = st.columns([1, 6, 1]) st.write("---") with c2: st.video("https://youtu.be/2q9HSyIPuf4") st.write( "Please give us feedback in the **#dashboard** channel of the [Hummingbot Discord](https://discord.gg/hummingbot)! ๐Ÿ™") else: show_pages([ Page("main.py", "Hummingbot Dashboard", "๐Ÿ“Š"), ]) name, authentication_status, username = st.session_state.authenticator.login('Login', 'main') if st.session_state["authentication_status"] == False: st.error('Username/password is incorrect') elif st.session_state["authentication_status"] == None: st.warning('Please enter your username and password') st.write("---") st.write("If you are pre-authorized, you can login with your pre-authorized mail!") st.session_state.authenticator.register_user('Register', 'main')