fix: download ZIP/CSV через fetch+Blob вместо window.location — не сбрасывает страницу
Deploy drhider / validate (push) Waiting to run
Deploy drhider / validate (push) Waiting to run
This commit is contained in:
@@ -295,12 +295,32 @@ async function uploadFiles() {
|
||||
|
||||
function downloadZip() {
|
||||
if (!currentSid) return;
|
||||
window.location = '/api/download/' + currentSid;
|
||||
fetch('/api/download/' + currentSid)
|
||||
.then(r => r.blob())
|
||||
.then(blob => {
|
||||
const a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = 'drhider.zip';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(a.href);
|
||||
});
|
||||
}
|
||||
|
||||
function downloadCsv() {
|
||||
if (!currentSid) return;
|
||||
window.location = '/api/csv/' + currentSid;
|
||||
fetch('/api/csv/' + currentSid)
|
||||
.then(r => r.blob())
|
||||
.then(blob => {
|
||||
const a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = 'mapping.csv';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(a.href);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<div id="helpModal" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);z-index:999;justify-content:center;align-items:center" onclick="this.style.display='none'">
|
||||
|
||||
Reference in New Issue
Block a user