Added download history

This commit is contained in:
enrilinux
2026-03-08 21:22:47 +01:00
parent 88b58090e4
commit acdb85272c
2 changed files with 61 additions and 2 deletions
+30
View File
@@ -36,6 +36,11 @@ Download
</div>
<div class="mt-6">
<h2 class="text-lg font-semibold mb-2">History</h2>
<div id="history" class="text-sm space-y-1"></div>
</div>
<script>
document.getElementById("downloadBtn").addEventListener("click", async () => {
@@ -78,6 +83,31 @@ status.innerHTML = "Error: check logs"
})
async function loadHistory(){
const res = await fetch("/history")
const data = await res.json()
const box = document.getElementById("history")
box.innerHTML = ""
data.reverse().forEach(item => {
box.innerHTML += `
<div class="bg-gray-700 p-2 rounded">
${item.time} - ${item.mode}<br>
<a href="/file?path=${item.path}" class="text-green-400 underline">
Download
</a>
</div>
`
})
}
loadHistory()
</script>
</body>