diff --git a/site/app.py b/site/app.py index 0f6a569..8bda095 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 = "4.0.1" +VERSION = "4.0.2" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 89d1d57..71c166c 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -163,10 +163,14 @@ async function uploadFiles() { for (let i = 0; i < total; i++) { const f = sf[i], n = i + 1; - ss(i, '⏳'); + const t0 = performance.now(); + // Бегущий секундомер в статусе + const timer = setInterval(() => { + const sec = Math.round((performance.now() - t0) / 1000); + ss(i, '⏳ ' + sec + 'с'); + }, 200); st.className = 'status progress'; st.textContent = 'Файл ' + n + '/' + total + ': ' + f.name; - const t0 = performance.now(); const fd = new FormData(); fd.append('files', f, f.name); try { @@ -180,6 +184,7 @@ async function uploadFiles() { x.ontimeout = () => reject(new Error('Таймаут')); x.send(fd); }); + clearInterval(timer); const el = ((performance.now() - t0) / 1000).toFixed(1); const iz = await JSZip.loadAsync(blob); const ks = Object.keys(iz.files).filter(k => !iz.files[k].dir); @@ -194,6 +199,7 @@ async function uploadFiles() { ss(i, '✓ ' + el + 'с'); ok++; } catch (err) { + clearInterval(timer); ss(i, ''); fail++; }