From c9c9586bff6def1e44837e7a81a2d48fe0082e7c Mon Sep 17 00:00:00 2001 From: Hermes Team Date: Sun, 23 Aug 2026 23:12:46 +0700 Subject: [PATCH] =?UTF-8?q?fix(web):=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=80=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=B8=20'=D0=9D/=D0=94'=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=BE=D0=B2=20=D0=B8=20=D1=83?= =?UTF-8?q?=D0=BB=D1=83=D1=87=D1=88=D0=B8=D1=82=D1=8C=20regex=20=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=82=D0=B0=D1=80=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/antigravity_provider/router/web/server.py | 4 ++-- src/antigravity_provider/router/web/static/app.js | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/antigravity_provider/router/web/server.py b/src/antigravity_provider/router/web/server.py index 5d473e1..5321228 100644 --- a/src/antigravity_provider/router/web/server.py +++ b/src/antigravity_provider/router/web/server.py @@ -78,7 +78,7 @@ def health_check(): def sanitize_snapshot(snap_dict: Any) -> Any: import re secret_patterns = [ - re.compile(r'(access_token|refresh_token|api_key|token|password|secret|key)=([^\s&,"]+)', re.IGNORECASE), + re.compile(r'((?:access_token|refresh_token|api_key|token|password|secret|key)=)([^\s&,"]+)', re.IGNORECASE), re.compile(r'(sk-[a-zA-Z0-9_\-]{8,})'), re.compile(r'(gho_[a-zA-Z0-9_\-]{8,})'), re.compile(r'(Bearer\s+)([a-zA-Z0-9_\-\.]{8,})', re.IGNORECASE), @@ -88,7 +88,7 @@ def sanitize_snapshot(snap_dict: Any) -> Any: res = val for pat in secret_patterns: if pat.groups == 2: - res = pat.sub(r'\1=***', res) + res = pat.sub(r'\g<1>***', res) elif pat.groups == 1: res = pat.sub(r'***', res) return res diff --git a/src/antigravity_provider/router/web/static/app.js b/src/antigravity_provider/router/web/static/app.js index 0c5337f..9258cb0 100644 --- a/src/antigravity_provider/router/web/static/app.js +++ b/src/antigravity_provider/router/web/static/app.js @@ -777,15 +777,20 @@ function renderAnalyticsView() { // KPI 4: Tokens (Honesty rule: null means N/D, never 0) const tokensEl = document.getElementById('analytics-tokens-total'); const tokensSubEl = document.getElementById('analytics-tokens-sub'); + const hasTokens = global.total_tokens !== null && global.total_tokens !== undefined; if (tokensEl) { - if (global.total_tokens !== null && global.total_tokens !== undefined) { + if (hasTokens) { tokensEl.textContent = global.total_tokens.toLocaleString('ru-RU'); } else { tokensEl.textContent = 'Н/Д'; } } if (tokensSubEl) { - tokensSubEl.textContent = 'Н/Д: провайдеры не отдают данные о токенах'; + if (hasTokens) { + tokensSubEl.textContent = 'Учитывается провайдером'; + } else { + tokensSubEl.textContent = 'Н/Д: провайдеры не отдают данные о токенах'; + } } // Providers Table