Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -884,17 +884,17 @@ def file_management_sidebar():
|
|
884 |
col1, col2, col3, col4 = st.sidebar.columns(4)
|
885 |
|
886 |
with col1:
|
887 |
-
if st.button("📄
|
888 |
st.session_state.selected_file = file
|
889 |
st.session_state.view_mode = 'view'
|
890 |
|
891 |
with col2:
|
892 |
-
if st.button("✏️
|
893 |
st.session_state.selected_file = file
|
894 |
st.session_state.view_mode = 'edit'
|
895 |
|
896 |
with col3:
|
897 |
-
if st.button("🔄
|
898 |
try:
|
899 |
with open(file, 'r', encoding='utf-8') as f:
|
900 |
content = f.read()
|
@@ -918,7 +918,7 @@ def file_management_sidebar():
|
|
918 |
st.error(f"Error during rerun: {e}")
|
919 |
|
920 |
with col4:
|
921 |
-
if st.button("🗑️
|
922 |
if delete_file(file):
|
923 |
st.success(f"Deleted {file}")
|
924 |
st.rerun()
|
|
|
884 |
col1, col2, col3, col4 = st.sidebar.columns(4)
|
885 |
|
886 |
with col1:
|
887 |
+
if st.button("📄View", key=f"view_{idx}"):
|
888 |
st.session_state.selected_file = file
|
889 |
st.session_state.view_mode = 'view'
|
890 |
|
891 |
with col2:
|
892 |
+
if st.button("✏️Edit", key=f"edit_{idx}"):
|
893 |
st.session_state.selected_file = file
|
894 |
st.session_state.view_mode = 'edit'
|
895 |
|
896 |
with col3:
|
897 |
+
if st.button("🔄Run", key=f"rerun_{idx}"):
|
898 |
try:
|
899 |
with open(file, 'r', encoding='utf-8') as f:
|
900 |
content = f.read()
|
|
|
918 |
st.error(f"Error during rerun: {e}")
|
919 |
|
920 |
with col4:
|
921 |
+
if st.button("🗑️Delete", key=f"delete_{idx}"):
|
922 |
if delete_file(file):
|
923 |
st.success(f"Deleted {file}")
|
924 |
st.rerun()
|