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; }