maint: changes

This commit is contained in:
vxclutch
2026-06-02 07:52:52 -04:00
parent 9ced6600e3
commit ec19585e9b
12 changed files with 147 additions and 61 deletions

View File

@@ -24,11 +24,10 @@
<script>
const tokenInput = document.getElementById('tokenInput');
const submitBtn = document.getElementById('submitBtn');
const status = document.getElementById('status');
const status = document.getElementById('status');
submitBtn.addEventListener('click', async () => {
const token = tokenInput.value.trim();
if (!token) {
status.textContent = 'Please enter a token.';
return;
@@ -42,7 +41,6 @@
},
body: JSON.stringify({ token })
});
if (!response.ok) {
status.textContent = 'Download failed.';
return;
@@ -50,19 +48,19 @@
const blob = await response.blob();
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
const a = document.createElement('a');
const disposition = response.headers.get('Content-Disposition');
let filename = 'download.bin';
if (disposition && disposition.includes('filename=')) {
filename = disposition
.split('filename=')[1]
.replace(/"/g, '');
}
a.download = filename;
document.body.appendChild(a);
a.click();
a.remove();