import os import streamlit as st import pandas as pd # Set page layout to wide mode st.set_page_config(layout="wide") # Hardcoded credentials USERNAME = os.environ["USERNAME"] PASSWORD = os.environ["PASSWORD"] BASE_CONTENT_CODE_ASSIST_T2_MICRO = os.environ["BASE_CONTENT_CODE_ASSIST_T2_MICRO"] BASE_CONTENT_PROTEIN_T2_MICRO = os.environ["BASE_CONTENT_PROTEIN_T2_MICRO"] # Initialize session state if 'logged_in' not in st.session_state: st.session_state.logged_in = False # Sidebar for login/logout with emojis st.sidebar.title("🔒 AIXNet") if st.session_state.logged_in: st.sidebar.success("🎉 You are logged in!") if st.sidebar.button("🔓 Log out"): st.session_state.logged_in = False st.sidebar.info("You have logged out.") st.rerun() # Rerun the app to reflect the logged-out state else: with st.sidebar.form(key='login_form'): username = st.text_input("👤 Username") password = st.text_input("🔑 Password", type="password") login_button = st.form_submit_button(label="🔓 Log in") if login_button: if username == USERNAME and password == PASSWORD: st.session_state.logged_in = True st.sidebar.success("🎉 Login successful!") st.rerun() # Rerun the app to reflect the logged-in state else: st.sidebar.error("❌ Invalid username or password. Please try again.") # Main title area st.title("🚀 AIXNet 🌐") # Display table only if logged in if st.session_state.logged_in: st.subheader("📋 AIXNet Tasks") # Create the table data with hyperlink data = { "📝 Task": ["💻 Code assist", "🧠 Protein Compound"], "🖥️ Instance Type": ["t2.micro", "t2.micro"], "🚀 GPU Accelerator": ["A40, 9 vCPU 50 GB RAM", "A40, 9 vCPU 50 GB RAM"], "💰 Price": ["$0.67 / hour", "$0.78 / hour"], "🌐 IPv4": [ f"[Link]({BASE_CONTENT_CODE_ASSIST_T2_MICRO})", f"[Link]({BASE_CONTENT_PROTEIN_T2_MICRO})"] } # Convert the data to a DataFrame df = pd.DataFrame(data) # Render the DataFrame with the URL as a hyperlink st.markdown(df.to_markdown(index=False), unsafe_allow_html=True) else: st.info("👉 Please log in to view the tasks.")