15 lines
521 B
JavaScript
Raw Normal View History

2025-06-23 12:01:06 +08:00
async function deleteFile(filename) {
if (confirm('Are you sure you want to delete ' + filename + '?')) {
const response = await fetch(`/delete_file/${filename}`, { method: 'DELETE' });
const data = await response.json();
alert(data.message);
if (response.ok) {
location.reload(); // Reload the page to update the file list
}
}
}
// Initial check when page loads
document.addEventListener('DOMContentLoaded', () => {
// No archive functions needed now
});