Update app.py
Browse files
app.py
CHANGED
@@ -85,9 +85,11 @@ else:
|
|
85 |
st.write(f"{file} (expiração iminente)")
|
86 |
else:
|
87 |
st.write(file)
|
|
|
88 |
with col2:
|
89 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
90 |
-
st.download_button("⬇ Download", f_obj, file_name=file)
|
|
|
91 |
with col3:
|
92 |
if st.button("🗑 Excluir", key=f"delete_{file}"):
|
93 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
@@ -96,9 +98,13 @@ else:
|
|
96 |
json.dump(expirations, f)
|
97 |
st.success(f"Arquivo '{file}' excluído.")
|
98 |
st.rerun()
|
|
|
99 |
with col4:
|
100 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
101 |
if st.download_button("⬇ Baixar & Apagar", f_obj, file_name=file, key=f"download_delete_{file}"):
|
102 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
103 |
expirations.pop(file, None)
|
104 |
with open(EXPIRATION_FILE, "w") as f:
|
|
|
|
|
|
|
|
85 |
st.write(f"{file} (expiração iminente)")
|
86 |
else:
|
87 |
st.write(file)
|
88 |
+
|
89 |
with col2:
|
90 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
91 |
+
st.download_button("⬇ Download", f_obj, file_name=file, key=f"down_{file}")
|
92 |
+
|
93 |
with col3:
|
94 |
if st.button("🗑 Excluir", key=f"delete_{file}"):
|
95 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
|
|
98 |
json.dump(expirations, f)
|
99 |
st.success(f"Arquivo '{file}' excluído.")
|
100 |
st.rerun()
|
101 |
+
|
102 |
with col4:
|
103 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
104 |
if st.download_button("⬇ Baixar & Apagar", f_obj, file_name=file, key=f"download_delete_{file}"):
|
105 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
106 |
expirations.pop(file, None)
|
107 |
with open(EXPIRATION_FILE, "w") as f:
|
108 |
+
json.dump(expirations, f)
|
109 |
+
st.success(f"Arquivo '{file}' baixado e removido.")
|
110 |
+
st.rerun()
|