v4.0.2: бегущий секундомер в колонке статуса ( 5с, 6с...)
Deploy drhider / validate (push) Waiting to run

This commit is contained in:
2026-07-12 14:19:44 +04:00
parent df15f48ecc
commit 62c7ea0162
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
sys.path.insert(0, _sys_path_root) sys.path.insert(0, _sys_path_root)
# Версия приложения (меняется при изменениях) # Версия приложения (меняется при изменениях)
VERSION = "4.0.1" VERSION = "4.0.2"
def create_app(): def create_app():
+8 -2
View File
@@ -163,10 +163,14 @@ async function uploadFiles() {
for (let i = 0; i < total; i++) { for (let i = 0; i < total; i++) {
const f = sf[i], n = i + 1; 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, '<span style="color:#2563eb">⏳ ' + sec + 'с</span>');
}, 200);
st.className = 'status progress'; st.className = 'status progress';
st.textContent = 'Файл ' + n + '/' + total + ': ' + f.name; st.textContent = 'Файл ' + n + '/' + total + ': ' + f.name;
const t0 = performance.now();
const fd = new FormData(); const fd = new FormData();
fd.append('files', f, f.name); fd.append('files', f, f.name);
try { try {
@@ -180,6 +184,7 @@ async function uploadFiles() {
x.ontimeout = () => reject(new Error('Таймаут')); x.ontimeout = () => reject(new Error('Таймаут'));
x.send(fd); x.send(fd);
}); });
clearInterval(timer);
const el = ((performance.now() - t0) / 1000).toFixed(1); const el = ((performance.now() - t0) / 1000).toFixed(1);
const iz = await JSZip.loadAsync(blob); const iz = await JSZip.loadAsync(blob);
const ks = Object.keys(iz.files).filter(k => !iz.files[k].dir); const ks = Object.keys(iz.files).filter(k => !iz.files[k].dir);
@@ -194,6 +199,7 @@ async function uploadFiles() {
ss(i, '<span style="color:#22c55e">✓ ' + el + 'с</span>'); ss(i, '<span style="color:#22c55e">✓ ' + el + 'с</span>');
ok++; ok++;
} catch (err) { } catch (err) {
clearInterval(timer);
ss(i, '<span style="color:#ef4444">✗</span>'); ss(i, '<span style="color:#ef4444">✗</span>');
fail++; fail++;
} }