From 40372fe03f31b4b5e357d05c5454130a38b99e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 15 Jul 2026 15:01:35 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=92=D1=8B=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=20=D0=B0=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D1=80=D0=B0=D0=B5=D1=82=20=D1=82=D0=B0=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D1=86=D1=83=20+=20dedup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/site/app.py b/site/app.py index 75ee250..d70c0ea 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.27" +VERSION = "0.0.28" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 78d745d..cabefed 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -170,7 +170,19 @@ function rr() { function rm(i) { sf.splice(i, 1); const d = new DataTransfer(); sf.forEach(f => d.items.add(f)); fi.files = d.files; rr(); } window.addEventListener('load', () => { sf = []; fi.value = ''; rr(); /* прогрев upstream-соединения */ fetch('/health').catch(() => {}); }); -fi.addEventListener('change', () => { sf = Array.from(fi.files); rr(); }); +fi.addEventListener('change', () => { + const incoming = Array.from(fi.files); + // Добавляем к существующим, исключая дубликаты по имени+размеру + const seen = new Set(sf.map(f => f.name + '|' + f.size)); + for (const f of incoming) { + if (!seen.has(f.name + '|' + f.size)) sf.push(f); + } + // Обновить file input — все файлы из sf + const d = new DataTransfer(); + sf.forEach(f => d.items.add(f)); + fi.files = d.files; + rr(); +}); function ss(idx, h) { const e = document.getElementById('st-' + idx); if (e) e.innerHTML = h; }