Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -190,7 +190,7 @@ def main():
|
|
190 |
st.session_state.selected_database = selected_db
|
191 |
st.session_state.selected_container = None
|
192 |
st.session_state.selected_document_id = None
|
193 |
-
st.
|
194 |
|
195 |
if st.session_state.selected_database:
|
196 |
database = st.session_state.client.get_database_client(st.session_state.selected_database)
|
@@ -200,7 +200,7 @@ def main():
|
|
200 |
if selected_container != st.session_state.selected_container:
|
201 |
st.session_state.selected_container = selected_container
|
202 |
st.session_state.selected_document_id = None
|
203 |
-
st.
|
204 |
|
205 |
if st.session_state.selected_container:
|
206 |
container = database.get_container_client(st.session_state.selected_container)
|
@@ -252,7 +252,7 @@ def main():
|
|
252 |
if success:
|
253 |
st.success(f"Document {updated_doc['id']} saved successfully.")
|
254 |
st.session_state.selected_document_id = updated_doc['id']
|
255 |
-
st.
|
256 |
else:
|
257 |
st.error(message)
|
258 |
except json.JSONDecodeError as e:
|
@@ -264,7 +264,7 @@ def main():
|
|
264 |
|
265 |
if selected_document != st.session_state.selected_document_id:
|
266 |
st.session_state.selected_document_id = selected_document
|
267 |
-
st.
|
268 |
|
269 |
if st.session_state.selected_document_id:
|
270 |
st.subheader(f"π Document Details: {st.session_state.selected_document_id}")
|
@@ -290,7 +290,7 @@ def main():
|
|
290 |
st.success(f"Document cloned with new id: {cloned_doc['id']} π")
|
291 |
st.session_state.selected_document_id = cloned_doc['id']
|
292 |
# Switch to 'Show as Edit and Save' mode
|
293 |
-
st.
|
294 |
else:
|
295 |
st.error(message)
|
296 |
elif selected_view == 'New Record':
|
@@ -307,7 +307,7 @@ def main():
|
|
307 |
st.success(f"New document created with id: {new_doc['id']} π")
|
308 |
st.session_state.selected_document_id = new_doc['id']
|
309 |
# Switch to 'Show as Edit and Save' mode
|
310 |
-
st.
|
311 |
else:
|
312 |
st.error(message)
|
313 |
except json.JSONDecodeError as e:
|
@@ -382,7 +382,7 @@ def main():
|
|
382 |
st.session_state.selected_database = None
|
383 |
st.session_state.selected_container = None
|
384 |
st.session_state.selected_document_id = None
|
385 |
-
st.
|
386 |
|
387 |
if __name__ == "__main__":
|
388 |
main()
|
|
|
190 |
st.session_state.selected_database = selected_db
|
191 |
st.session_state.selected_container = None
|
192 |
st.session_state.selected_document_id = None
|
193 |
+
st.rerun()
|
194 |
|
195 |
if st.session_state.selected_database:
|
196 |
database = st.session_state.client.get_database_client(st.session_state.selected_database)
|
|
|
200 |
if selected_container != st.session_state.selected_container:
|
201 |
st.session_state.selected_container = selected_container
|
202 |
st.session_state.selected_document_id = None
|
203 |
+
st.rerun()
|
204 |
|
205 |
if st.session_state.selected_container:
|
206 |
container = database.get_container_client(st.session_state.selected_container)
|
|
|
252 |
if success:
|
253 |
st.success(f"Document {updated_doc['id']} saved successfully.")
|
254 |
st.session_state.selected_document_id = updated_doc['id']
|
255 |
+
st.rerun()
|
256 |
else:
|
257 |
st.error(message)
|
258 |
except json.JSONDecodeError as e:
|
|
|
264 |
|
265 |
if selected_document != st.session_state.selected_document_id:
|
266 |
st.session_state.selected_document_id = selected_document
|
267 |
+
st.rerun()
|
268 |
|
269 |
if st.session_state.selected_document_id:
|
270 |
st.subheader(f"π Document Details: {st.session_state.selected_document_id}")
|
|
|
290 |
st.success(f"Document cloned with new id: {cloned_doc['id']} π")
|
291 |
st.session_state.selected_document_id = cloned_doc['id']
|
292 |
# Switch to 'Show as Edit and Save' mode
|
293 |
+
st.rerun()
|
294 |
else:
|
295 |
st.error(message)
|
296 |
elif selected_view == 'New Record':
|
|
|
307 |
st.success(f"New document created with id: {new_doc['id']} π")
|
308 |
st.session_state.selected_document_id = new_doc['id']
|
309 |
# Switch to 'Show as Edit and Save' mode
|
310 |
+
st.rerun()
|
311 |
else:
|
312 |
st.error(message)
|
313 |
except json.JSONDecodeError as e:
|
|
|
382 |
st.session_state.selected_database = None
|
383 |
st.session_state.selected_container = None
|
384 |
st.session_state.selected_document_id = None
|
385 |
+
st.rerun()
|
386 |
|
387 |
if __name__ == "__main__":
|
388 |
main()
|