Files
drhider/History/ux-frontend/2026-08-19-file-time.md
T

41 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# v0.0.41 — время на конкретный файл в колонке Статус — 2026-08-19
**Дата:** 2026-08-19
**Версия:** 0.0.40 → 0.0.41
---
## Суть
В колонке «Статус» таблицы у всех файлов показывалось ~одинаковое ОБЩЕЕ время.
Причина: фронт считал время как разницу `start`→`done`, а LLM — общий для всех
файлов (в проходе 1) — попадал в интервал КАЖДОГО файла.
Теперь бэк считает время на КОНКРЕТНЫЙ файл (extract_text + regex + замена,
БЕЗ общего LLM) и передаёт его в `done`-событии.
## Изменения
### `drhider/obfuscator.py`
- `import time` добавлен.
- Заведён `file_times = [0.0] * total`.
- Проход 1: `file_times[i] += time.time() - t0` вокруг extract_text + regex.
- Проход 2: `file_times[i] += time.time() - t0` вокруг замены.
- `progress_cb` расширен до `(phase, idx, total, fname, elapsed)`; в `done`
передаётся `round(file_times[i], 2)`.
### `site/routes/api_bp.py`
- `progress(phase, idx, total_, name, elapsed)`; в SSE `done` добавлен `elapsed`.
### `site/templates/index.html`
- В `done`-обработчике: если `d.elapsed > 0` — показать `d.elapsed.toFixed(1)`
(время файла от бэка), иначе fallback на старое вычисление.
### `site/app.py`
- `VERSION = "0.0.41"`.
## Проверка
- События: `[start(0,0.0), start(1,0.0), done(0,<время>), done(1,<время>)]`.
- `py_compile`, `node --check` — OK.
- Тесты: builder 20/20, replacer 10/10, scanner 20/20, zip 28/28.