Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
# Hardcoded credentials
|
5 |
+
USERNAME = os.environ["USERNAME"]
|
6 |
+
PASSWORD = os.environ["PASSWORD"]
|
7 |
+
|
8 |
+
# Sidebar for login with emojis
|
9 |
+
st.sidebar.title("π AIXNet Login")
|
10 |
+
with st.sidebar.form(key='login_form'):
|
11 |
+
username = st.text_input("π€ Username")
|
12 |
+
password = st.text_input("π Password", type="password")
|
13 |
+
login_button = st.form_submit_button(label="π Login")
|
14 |
+
|
15 |
+
if login_button:
|
16 |
+
if username == USERNAME and password == PASSWORD:
|
17 |
+
st.sidebar.success("π Login successful!")
|
18 |
+
|
19 |
+
# Display table after successful login
|
20 |
+
st.title("π AIXNet Tasks")
|
21 |
+
data = {
|
22 |
+
"π Task": ["π» Code assist"],
|
23 |
+
"π₯οΈ Instance Type": ["t2.micro"],
|
24 |
+
"π° Price": ["$0.05 / hour"],
|
25 |
+
"π IPv4": ["some_url_here"]
|
26 |
+
}
|
27 |
+
|
28 |
+
st.table(data)
|
29 |
+
else:
|
30 |
+
st.sidebar.error("β Invalid username or password. Please try again.")
|
31 |
+
else:
|
32 |
+
st.sidebar.info("π Please enter your credentials to log in.")
|