Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ if not files:
|
|
72 |
st.info("Nenhum arquivo disponível.")
|
73 |
else:
|
74 |
for file in files:
|
75 |
-
col1, col2, col3, col4 = st.columns([
|
76 |
with col1:
|
77 |
expira = expirations.get(file)
|
78 |
if expira:
|
@@ -80,18 +80,18 @@ else:
|
|
80 |
if restante > 0:
|
81 |
restante_horas = restante // 3600
|
82 |
restante_min = (restante % 3600) // 60
|
83 |
-
st.write(f"{file} (expira em {restante_horas}h {restante_min}min)")
|
84 |
else:
|
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("⬇
|
92 |
|
93 |
with col3:
|
94 |
-
if st.button("🗑
|
95 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
96 |
expirations.pop(file, None)
|
97 |
with open(EXPIRATION_FILE, "w") as f:
|
@@ -101,7 +101,7 @@ else:
|
|
101 |
|
102 |
with col4:
|
103 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
104 |
-
if st.download_button("⬇
|
105 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
106 |
expirations.pop(file, None)
|
107 |
with open(EXPIRATION_FILE, "w") as f:
|
|
|
72 |
st.info("Nenhum arquivo disponível.")
|
73 |
else:
|
74 |
for file in files:
|
75 |
+
col1, col2, col3, col4 = st.columns([5, 1, 1, 2])
|
76 |
with col1:
|
77 |
expira = expirations.get(file)
|
78 |
if expira:
|
|
|
80 |
if restante > 0:
|
81 |
restante_horas = restante // 3600
|
82 |
restante_min = (restante % 3600) // 60
|
83 |
+
st.write(f"**{file}** (expira em {restante_horas}h {restante_min}min)")
|
84 |
else:
|
85 |
+
st.write(f"**{file}** (expiração iminente)")
|
86 |
else:
|
87 |
+
st.write(f"**{file}**")
|
88 |
|
89 |
with col2:
|
90 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
91 |
+
st.download_button("⬇", f_obj, file_name=file, key=f"down_{file}")
|
92 |
|
93 |
with col3:
|
94 |
+
if st.button("🗑", key=f"delete_{file}"):
|
95 |
os.remove(os.path.join(UPLOAD_FOLDER, file))
|
96 |
expirations.pop(file, None)
|
97 |
with open(EXPIRATION_FILE, "w") as f:
|
|
|
101 |
|
102 |
with col4:
|
103 |
with open(os.path.join(UPLOAD_FOLDER, file), "rb") as f_obj:
|
104 |
+
if st.download_button("⬇ & 🗑", 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:
|