Junaidb commited on
Commit
5bd7198
·
verified ·
1 Parent(s): fcfbdc8

Update ui.py

Browse files
Files changed (1) hide show
  1. ui.py +15 -6
ui.py CHANGED
@@ -136,14 +136,23 @@ def APP():
136
 
137
  with tab2:
138
  st.markdown("### newMATTER Bio Lab Operations")
139
- response=requests.get(f"https://thexforce-combat-backend.hf.space/user/operations/{st.session_state.get('username')}",headers={
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
- "Content-Type":"application/json",
142
- "Authorization":f"Bearer {tok}"
143
- })
144
- useroperations_json=response.json()
145
  with st.expander("operations"):
146
- st.json(useroperations_json)
147
 
148
 
149
  with tab3:
 
136
 
137
  with tab2:
138
  st.markdown("### newMATTER Bio Lab Operations")
139
+
140
+ @st.cache_data(ttl=10)
141
+ def fetch_ops():
142
+ response=requests.get(f"https://thexforce-combat-backend.hf.space/user/operations/{st.session_state.get('username')}",headers={
143
+
144
+ "Content-Type":"application/json",
145
+ "Authorization":f"Bearer {tok}"
146
+ })
147
+ useroperations_json=response.json()
148
+ return useroperations_json
149
+
150
+
151
+
152
+ userops=fetch_ops()
153
 
 
 
 
 
154
  with st.expander("operations"):
155
+ st.json(userops)
156
 
157
 
158
  with tab3: