From cd29e727f3955d78ad0eba52911710126ce889c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Tue, 14 Jul 2026 19:31:44 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20uploadFiles=20=D0=BD=D0=B5=20=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D1=8F=D0=B5=D1=82=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20resetAll=20=E2=80=94=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D1=8F=D0=B5=D1=82=20sf.sli?= =?UTF-8?q?ce()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/site/app.py b/site/app.py index 4abc8a8..a73e9dc 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.24" +VERSION = "0.0.25" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index f73f95e..d15b370 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -176,18 +176,21 @@ function ss(idx, h) { const e = document.getElementById('st-' + idx); if (e) e.i async function uploadFiles() { if (sf.length === 0) return; + // Сохранить список до очистки + const files = sf.slice(); // Обрубить всё что могло остаться от предыдущего раза - resetAll(); - ub.disabled = true; - sf = Array.from(fi.files); // восстановить список после resetAll - rr(); - ub.disabled = true; + if (activeES) { activeES.close(); activeES = null; } + if (activeXHR) { activeXHR.abort(); activeXHR = null; } + currentSid = ''; + st.className = ''; + st.textContent = ''; db.classList.remove('show'); - const total = sf.length; + ub.disabled = true; + const total = files.length; // Фаза 1: загрузка (XMLHttpRequest — прогресс в строке) for (let i = 0; i < total; i++) { - const f = sf[i], n = i + 1; + const f = files[i], n = i + 1; st.className = 'status progress'; st.textContent = 'Загрузка ' + n + '/' + total + ': ' + f.name; try {