diff --git a/site/app.py b/site/app.py index 7fa7b44..75ee250 100644 --- a/site/app.py +++ b/site/app.py @@ -20,7 +20,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.26" +VERSION = "0.0.27" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 544cfe1..78d745d 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -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); + }); }