File size: 2,296 Bytes
ee27a37
 
fb254d5
ee27a37
a6a4d5c
 
 
ee27a37
 
 
c7db349
14b8e65
 
ee27a37
c7db349
 
 
ee27a37
c7db349
 
ee27a37
c7db349
 
 
 
 
520c62b
ee27a37
c7db349
 
 
 
 
 
 
 
 
520c62b
c7db349
 
 
e61bdf2
 
 
c7db349
 
e61bdf2
01d1d57
 
c7db349
14b8e65
 
320c7bb
84a63a1
14b8e65
4858029
 
c7db349
 
fb254d5
 
 
 
 
c7db349
 
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
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.")