v1.0.22: чистая загрузка — без retry, timeout 120s

This commit is contained in:
2026-06-18 19:31:22 +04:00
parent a6a1c70f41
commit de090dba58
+8 -3
View File
@@ -64,7 +64,7 @@
<body> <body>
<div class="topbar"> <div class="topbar">
<img src="/nubes-logo.svg" alt="Nubes"> <img src="/nubes-logo.svg" alt="Nubes">
<span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.21 — Lucee</span></span> <span class="title">Сверка договоров <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.22 — Lucee</span></span>
</div> </div>
<div class="content"> <div class="content">
@@ -232,8 +232,6 @@ uploadBtn.addEventListener('click', function() {
if (i >= fileQueue.length) { if (i >= fileQueue.length) {
uploadTimer.style.display = 'none'; uploadTimer.style.display = 'none';
uploadBtn.disabled = false; uploadBtn.disabled = false;
document.getElementById('actionsCard').style.display = 'block';
document.getElementById('chatCard').style.display = 'block';
return; return;
} }
var f = fileQueue[i]; var f = fileQueue[i];
@@ -249,6 +247,7 @@ uploadBtn.addEventListener('click', function() {
if (contractId) fd.append('contract_id', contractId); if (contractId) fd.append('contract_id', contractId);
xhr.open('POST', '/upload.cfm'); xhr.open('POST', '/upload.cfm');
xhr.timeout = 120000;
xhr.upload.onprogress = function(e) { xhr.upload.onprogress = function(e) {
if (e.lengthComputable) { if (e.lengthComputable) {
f.status = Math.round(e.loaded / e.total * 100) + '%'; f.status = Math.round(e.loaded / e.total * 100) + '%';
@@ -278,6 +277,12 @@ uploadBtn.addEventListener('click', function() {
renderTable(); renderTable();
uploadNext(i + 1); uploadNext(i + 1);
}; };
xhr.ontimeout = function() {
f.status = 'error';
log('❌ ' + f.name + ': таймаут');
renderTable();
uploadNext(i + 1);
};
xhr.send(fd); xhr.send(fd);
} }
uploadNext(0); uploadNext(0);