Spaces:
Running
Running
Update pages/biolab.py
Browse files- pages/biolab.py +43 -23
pages/biolab.py
CHANGED
@@ -61,42 +61,62 @@ def LOGIN():
|
|
61 |
def APP():
|
62 |
|
63 |
tab1, tab2, tab3 = st.tabs(["BIOLAB", "OPERATIONS", "OUTPUT"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
|
|
|
|
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
70 |
-
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
# Simulate processing and append to the console
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
|
92 |
|
93 |
-
with tab3:
|
94 |
-
st.markdown("### Output")
|
95 |
|
96 |
|
97 |
|
98 |
-
#Route to appropriate page based on login status
|
99 |
if st.session_state.logged_in:
|
100 |
APP()
|
101 |
-
|
102 |
LOGIN()
|
|
|
61 |
def APP():
|
62 |
|
63 |
tab1, tab2, tab3 = st.tabs(["BIOLAB", "OPERATIONS", "OUTPUT"])
|
64 |
+
|
65 |
+
def SHOW_PROJECT_NAME():
|
66 |
+
st.set_page_config(
|
67 |
+
layout="centered"
|
68 |
+
)
|
69 |
+
st.header(f"setup your project @ {st.session_state.username}")
|
70 |
+
project_name=st.text_input("enter project name ")\
|
71 |
+
st.session_state.projectname=project_name
|
72 |
+
st.rerun()
|
73 |
+
|
74 |
|
75 |
+
|
76 |
+
def SHOWTABS():
|
77 |
+
with tab1:
|
78 |
|
79 |
+
console_container = st.container(height=150, border=True)
|
80 |
|
81 |
+
with console_container:
|
82 |
+
st.code(">>> System Online...", language="bash") # Use st.code for a console look
|
83 |
|
84 |
+
user_input = st.text_input(
|
85 |
+
"Protein Engineering Query",
|
86 |
+
placeholder="Type something lengthy here... It could be code, a story, or just a lot of thoughts."
|
87 |
+
)
|
88 |
+
if st.button("Execute", use_container_width=True):
|
89 |
+
if user_input:
|
90 |
# Simulate processing and append to the console
|
91 |
+
with console_container:
|
92 |
+
st.markdown(f"**>>> Processing input...**")
|
93 |
+
st.code(f"Input received ({len(user_input)} characters):\n{user_input[:200]}...", language="text") # Show first 200 chars
|
94 |
+
st.success("Task completed!")
|
95 |
+
else:
|
96 |
+
with console_container:
|
97 |
+
st.warning(">>> Please enter some text before processing.")
|
98 |
|
99 |
|
100 |
+
with tab2:
|
101 |
+
st.markdown("### Operations")
|
102 |
+
|
103 |
+
with tab3:
|
104 |
+
st.markdown("### Output")
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
if project_name is not "":
|
109 |
+
SHOW_TABS()
|
110 |
+
|
111 |
+
else:
|
112 |
+
SHOW_PROJECT_NAME()
|
113 |
|
114 |
|
115 |
|
|
|
|
|
116 |
|
117 |
|
118 |
|
|
|
119 |
if st.session_state.logged_in:
|
120 |
APP()
|
121 |
+
else:
|
122 |
LOGIN()
|