diff --git a/static/chat.html b/static/chat.html index 7187649..d432a4e 100644 --- a/static/chat.html +++ b/static/chat.html @@ -408,6 +408,13 @@ function uploadOne(file, onPct, fresh) { }); } +function uploadErrText(s) { + if (s === 400) return 'тип не поддерживается — нужны zip, xlsx, xls, xlsm, ods, pdf, doc, docx, csv, txt, xml, json, yaml, gge, esw, ges, smr, smt, rar, 7z'; + if (s === 413) return 'слишком большой (максимум 3 ГБ)'; + if (s === 507) return 'на сервере не хватает места'; + return 'ошибка загрузки (код ' + s + ')'; +} + let uploadingActive = false; async function uploadFiles() { if (typeof tus === 'undefined') return uploadFilesLegacy(); // CDN blocked → degrade @@ -437,9 +444,9 @@ async function uploadFiles() { } pendingFiles = []; renderFileList(); - const failed = results.filter(r => !r.ok); - if (failed.length && !failed.some(r => r.status === 401)) { - addMsg('error', 'Не загружены: ' + failed.map(r => r.name).join(', ')); + const failed = results.filter(r => !r.ok && r.status !== 401); + if (failed.length) { + addMsg('error', 'Не загружены — ' + failed.map(r => `${r.name} (${uploadErrText(r.status)})`).join('; ')); } return results.filter(r => r.ok).map(r => r.name); } finally {