diff --git a/site/app.py b/site/app.py index 1256a79..8dd5253 100644 --- a/site/app.py +++ b/site/app.py @@ -21,7 +21,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.64" +VERSION = "0.0.65" def setup_logging(): diff --git a/site/templates/index.html b/site/templates/index.html index 60570df..2efc0b0 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -138,7 +138,8 @@

Загрузите документы (.docx, .doc, .pdf, .txt, .md, .zip) — получите ZIP с обезличенными копиями.
CSV с таблицей замен скачивается отдельно.
- Ограничения: один файл не более 50 МБ, суммарно не более 500 МБ. Файлы сверх лимитов помечаются красным и не участвуют в обфускации. + Ограничения: один файл не более 50 МБ, суммарно не более 500 МБ. Файлы сверх лимитов помечаются красным и не участвуют в обфускации.
+ ⏱ Время обработки каждого файла — ориентировочное (обновляется по факту).

@@ -258,6 +259,10 @@ function fmtSec(s) { return s >= 60 ? Math.floor(s / 60) + 'м ' + (s % 60) + 'с' : s + 'с'; } +// Эмпирическая оценка времени обработки файла: сек/МБ (ориентировочно, до старта) +const EST_MB_SEC = 12; +function estForFile(f) { return f ? Math.max(1, Math.round(f.size / 1048576 * EST_MB_SEC)) : 0; } + function rr() { if (procPhase === 'processing') { renderProcTable(); return; } if (sf.length === 0) { fl.innerHTML = 'Нет выбранных файлов'; } @@ -265,14 +270,16 @@ function rr() { fl.innerHTML = sf.map((f, i) => { const over = overNames.has(f.name); const rowCls = over ? ' class="row-over"' : ''; - const stTxt = over ? '🔥 не учитывается' : ''; + const stTxt = over ? '🔥 не учитывается' + : '~' + fmtSec(estForFile(f)) + ''; return '' + f.name + '' + fs(f.size) + '' + stTxt + ''; }).join(''); } const overCount = sf.filter(f => overNames.has(f.name)).length; const totalSize = sf.reduce((s, f) => s + (overNames.has(f.name) ? 0 : f.size), 0); const cntMain = sf.length - overCount; - fc.textContent = (overCount ? cntMain + ' учитываются + ' + overCount + ' свыше лимита' : sf.length) + ' файлов · ' + fs(totalSize); + const totEst = sf.reduce((s, f) => s + (overNames.has(f.name) ? 0 : estForFile(f)), 0); + fc.textContent = (overCount ? cntMain + ' учитываются + ' + overCount + ' свыше лимита' : sf.length) + ' файлов · ' + fs(totalSize) + ' · ~' + fmtSec(totEst); ub.disabled = cntMain === 0; } @@ -329,7 +336,7 @@ function renderProcTable() { if (rate && !p.est && p.chars > 0) p.est = p.chars * rate; if (!p.est) { const szMB = (sf[i] ? sf[i].size : 0) / 1048576; - const k = procExtractRate || 3; // сек/МБ: замеренная или запасная + const k = procExtractRate || EST_MB_SEC; // сек/МБ: замеренная или эмпирическая p.est = Math.max(1, Math.round(szMB * k)); } let txt;