v2.0.6: счётчик чанков в статусе, задержка 2.5с

This commit is contained in:
2026-06-18 07:03:10 +04:00
parent 4424d07a32
commit 5b79a697b5
+5 -5
View File
@@ -60,7 +60,7 @@
<body> <body>
<div class="topbar"> <div class="topbar">
<img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes"> <img src="{{ url_for('static', filename='nubes-logo.svg') }}" alt="Nubes">
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v2.0.5</span></span> <span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v2.0.6</span></span>
</div> </div>
<div class="content"> <div class="content">
@@ -207,8 +207,8 @@
}).then(function(data) { }).then(function(data) {
if (!data.ok) { reject(new Error(data.error)); return; } if (!data.ok) { reject(new Error(data.error)); return; }
done++; done++;
if (onProgress) onProgress(Math.round(done / totalChunks * 100)); if (onProgress) onProgress({pct: Math.round(done / totalChunks * 100), done: done, total: totalChunks});
setTimeout(function() { sendChunk(i + 1); }, 3000); // дать HTTP/2 стримам закрыться setTimeout(function() { sendChunk(i + 1); }, 2500); // дать HTTP/2 стримам закрыться
}).catch(function(e) { reject(e); }); }).catch(function(e) { reject(e); });
} }
sendChunk(0); sendChunk(0);
@@ -241,8 +241,8 @@
var startTime = Date.now(); var startTime = Date.now();
try { try {
var resp = await uploadFileChunked(f, contractId, function(pct) { var resp = await uploadFileChunked(f, contractId, function(info) {
fileQueue[rowIdx].status = '<span style="color:var(--muted);">↑ ' + pct + '%</span>'; fileQueue[rowIdx].status = '<span style="color:var(--muted);">↑ чанк ' + info.done + '/' + info.total + ' (' + info.pct + '%)</span>';
renderTable(); renderTable();
}); });
// uploadFileChunked10k: прогресс по чанкам // uploadFileChunked10k: прогресс по чанкам