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
+8 -2
View File
@@ -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, '<span style="color:#2563eb">⏳ ' + sec + 'с</span>');
}, 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, '<span style="color:#22c55e">✓ ' + el + 'с</span>');
ok++;
} catch (err) {
clearInterval(timer);
ss(i, '<span style="color:#ef4444">✗</span>');
fail++;
}