Spaces:
Running
Running
Update ui.py
Browse files
ui.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
tok=os.getenv("TOK")
|
6 |
|
@@ -15,6 +22,9 @@ def InitSession():
|
|
15 |
if "projectname" not in st.session_state:
|
16 |
st.session_state.projectname=""
|
17 |
|
|
|
|
|
|
|
18 |
|
19 |
InitSession()
|
20 |
|
@@ -34,7 +44,7 @@ def APP():
|
|
34 |
|
35 |
tab1, tab2, tab3 = st.tabs(["PROTEIN ENGINEERING LAB", "EXECUTED OPERATIONS", "LAB OUTPUT"])
|
36 |
|
37 |
-
|
38 |
def SHOWTABS():
|
39 |
|
40 |
|
@@ -168,5 +178,33 @@ def APP():
|
|
168 |
ie=response.json()
|
169 |
st.json(ie)
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
import os
|
4 |
+
from login import LOGIN
|
5 |
+
from register import REGISTER
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
|
12 |
tok=os.getenv("TOK")
|
13 |
|
|
|
22 |
if "projectname" not in st.session_state:
|
23 |
st.session_state.projectname=""
|
24 |
|
25 |
+
if "loggedin" not in st.session_state:
|
26 |
+
st.session_state.loggedin=False
|
27 |
+
|
28 |
|
29 |
InitSession()
|
30 |
|
|
|
44 |
|
45 |
tab1, tab2, tab3 = st.tabs(["PROTEIN ENGINEERING LAB", "EXECUTED OPERATIONS", "LAB OUTPUT"])
|
46 |
|
47 |
+
|
48 |
def SHOWTABS():
|
49 |
|
50 |
|
|
|
178 |
ie=response.json()
|
179 |
st.json(ie)
|
180 |
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
base_option_map = {
|
185 |
+
|
186 |
+
0: ":material/login:",
|
187 |
+
1: ":material/personadd:",
|
188 |
+
|
189 |
+
}
|
190 |
+
|
191 |
+
selection = st.pills(
|
192 |
+
"ACCESS",
|
193 |
+
options=option_map.keys(),
|
194 |
+
format_func=lambda option: option_map[option],
|
195 |
+
selection_mode="single",
|
196 |
+
)
|
197 |
+
if selection==0:
|
198 |
+
logged_in_object=LOGIN()
|
199 |
|
200 |
+
if logged_in_object.get("loggedin")==True :
|
201 |
+
|
202 |
+
|
203 |
+
SHOWTABS()
|
204 |
+
|
205 |
+
elif logged_in_object.get("loggedin")==False:
|
206 |
+
st.write("login failed , try again")
|
207 |
+
|
208 |
+
if selection==1:
|
209 |
+
REGISTER()
|
210 |
+
|