From defbc100047ecd0a4627db4fbc7d941baa4ffb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 19 Aug 2026 09:16:18 +0400 Subject: [PATCH] =?UTF-8?q?v0.0.37:=20=D0=BA=D1=80=D1=83=D0=BF=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=82=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D0=BA=D0=B8=20(=D0=BE=D0=B1=D1=89=D0=B5=D0=B5=20?= =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D1=8F,=20=D0=B2=D1=80=D0=B5=D0=BC?= =?UTF-8?q?=D1=8F=20=D0=98=D0=98,=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D1=8B)?= =?UTF-8?q?=20=D0=B2=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- History/2026-08-19-llm-stats-block.md | 41 ++++++++++++++++++++++ site/app.py | 2 +- site/templates/index.html | 50 +++++++++++++++++++++++---- 3 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 History/2026-08-19-llm-stats-block.md diff --git a/History/2026-08-19-llm-stats-block.md b/History/2026-08-19-llm-stats-block.md new file mode 100644 index 0000000..362ff53 --- /dev/null +++ b/History/2026-08-19-llm-stats-block.md @@ -0,0 +1,41 @@ +# v0.0.37 — крупный блок статистики LLM в UI — 2026-08-19 + +**Дата:** 2026-08-19 +**Версия:** 0.0.36 → 0.0.37 +**Файл:** `site/templates/index.html`, `site/app.py` (версия) + +--- + +## Суть + +Раньше статистика LLM («... LLM: 5.3с · 1894 токенов») была МЕЛКИМ текстом +в статус-строке под кнопкой — юзер её не замечал. Теперь после обработки +показывается **крупный заметный блок** «📊 Итоги обработки»: + +| Показатель | Значение | +|---|---| +| Общее время | крупное число, с | +| Время ИИ | крупное число, с | +| Токены ИИ | крупное число | + +Оформление: зелёная плашка (фон-градиент, рамка 2px), три белые карточки, +значения шрифтом 24px жирным. Блок скрыт до завершения и при сбросе. + +## Изменения (`index.html`) +- CSS: `.stats-block`, `.stats-title`, `.stats-row`, `.stat-item`, + `.stat-label`, `.stat-value`. +- HTML: блок `#statsBlock` с `#stTotalTime`, `#stLlmTime`, `#stLlmTokens` + (после кнопок скачивания). +- JS: + - `complete`-обработчик — заполняет и показывает блок (общее время всегда; + время ИИ и токены — если `llm_sec > 0`, иначе «—»); + - `resetAll` — скрывает блок. + +## Проверка +- `node --check` — OK. +- Визуально через браузер: блок появился полноширинным, три карточки, + значения крупно — заметно. +- Версия `app.VERSION = 0.0.37`. + +## Бэкенд +- Не менялся (метрики `tokens`/`llm_sec` в `event: complete` уже есть с v0.0.34). diff --git a/site/app.py b/site/app.py index 79ab7b3..43294b6 100644 --- a/site/app.py +++ b/site/app.py @@ -20,7 +20,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.36" +VERSION = "0.0.37" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 15fba00..6ff8bef 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -83,6 +83,20 @@ .status.error { background: #fef2f2; border: 1px solid var(--red); color: #991b1b; display: block; } .dl-btns { display: none; gap: 8px; margin-top: 8px; } .dl-btns.show { display: flex; } + .stats-block { + display: none; margin-top: 12px; padding: 16px; + background: linear-gradient(135deg, #f0fdf4, #ecfdf5); + border: 2px solid var(--green); border-radius: 12px; + } + .stats-block.show { display: block; } + .stats-title { font-size: 16px; font-weight: 700; color: #14532d; margin-bottom: 10px; } + .stats-row { display: flex; flex-wrap: wrap; gap: 10px; } + .stat-item { + flex: 1; min-width: 130px; background: #fff; border: 1px solid #bbf7d0; + border-radius: 10px; padding: 10px 12px; text-align: center; + } + .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; } + .stat-value { font-size: 24px; font-weight: 800; color: #166534; } @@ -127,6 +141,23 @@ +
+
📊 Итоги обработки
+
+
+
Общее время
+
+
+
+
Время ИИ
+
+
+
+
Токены ИИ
+
+
+
+
@@ -154,6 +185,7 @@ function resetAll() { st.className = ''; st.textContent = ''; db.classList.remove('show'); + document.getElementById('statsBlock').classList.remove('show'); ub.disabled = false; } @@ -409,13 +441,19 @@ async function uploadFiles() { clearInterval(ptimer); const d = JSON.parse(e.data); const totalSec = ((performance.now() - t0) / 1000).toFixed(1); - let msg = '✅ Обработано ' + d.total + ' файлов за ' + totalSec + 'с'; - if (d.llm_sec > 0) { - msg += ' · LLM: ' + d.llm_sec + 'с'; - if (d.tokens > 0) msg += ' · ' + d.tokens + ' токенов'; - } st.className = 'status done'; - st.textContent = msg; + st.textContent = '✅ Обработано ' + d.total + ' файлов за ' + totalSec + 'с'; + // Крупный блок статистики + const sb = document.getElementById('statsBlock'); + document.getElementById('stTotalTime').textContent = totalSec + ' с'; + if (d.llm_sec > 0) { + document.getElementById('stLlmTime').textContent = d.llm_sec + ' с'; + document.getElementById('stLlmTokens').textContent = d.tokens > 0 ? d.tokens : '—'; + } else { + document.getElementById('stLlmTime').textContent = '—'; + document.getElementById('stLlmTokens').textContent = '—'; + } + sb.classList.add('show'); db.classList.add('show'); resolve(); });