From 9ef1af3ae14c6ada0314ace4ada011082bd5b911 Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Sat, 8 Aug 2026 12:11:07 +0300 Subject: [PATCH] feat(ui): the continuous complexity score shows next to the tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Benchmark (routing mode) and the dashboard's recent-requests list now print the router's raw 0..1 score under/next to the tier badge — people can see what different prompts actually weigh and tune the boundary sliders from real data. Tooltip explains the link to the Routing sliders (7 languages). Caught before commit: naming the field row.score collided with the answer- correctness fraction from evaluate() and dragged the benchmark's quality KPI down to the average complexity — renamed to cscore, KPI verified back at 100%. Dashboard tier badges also render translated names now, and the Russian locale calls the dashboard «Рабочий стол». --- web/js/i18n/de.js | 1 + web/js/i18n/en.js | 1 + web/js/i18n/es.js | 1 + web/js/i18n/fr.js | 1 + web/js/i18n/ru.js | 5 +++-- web/js/i18n/tr.js | 1 + web/js/i18n/zh.js | 1 + web/js/views/benchmark.js | 7 ++++++- web/js/views/dashboard.js | 6 ++++-- 9 files changed, 19 insertions(+), 5 deletions(-) diff --git a/web/js/i18n/de.js b/web/js/i18n/de.js index f3b1ecb..72f7709 100644 --- a/web/js/i18n/de.js +++ b/web/js/i18n/de.js @@ -634,4 +634,5 @@ export default { "tier.low": "leicht", "tier.medium": "mittel", "tier.high": "schwer", + "bm.scoreHint": "Der kontinuierliche Komplexitätsscore des Routers (0..1) — die Grenzregler auf der Routing-Seite teilen ihn in Stufen.", }; diff --git a/web/js/i18n/en.js b/web/js/i18n/en.js index 80c81cf..10523f9 100644 --- a/web/js/i18n/en.js +++ b/web/js/i18n/en.js @@ -627,4 +627,5 @@ export default { "tier.low": "low", "tier.medium": "medium", "tier.high": "high", + "bm.scoreHint": "The router's continuous complexity score (0..1) — the boundary sliders on the Routing page cut it into tiers.", }; diff --git a/web/js/i18n/es.js b/web/js/i18n/es.js index 72e0632..2908a5a 100644 --- a/web/js/i18n/es.js +++ b/web/js/i18n/es.js @@ -634,4 +634,5 @@ export default { "tier.low": "fácil", "tier.medium": "medio", "tier.high": "difícil", + "bm.scoreHint": "La puntuación continua de complejidad del router (0..1) — los deslizadores de límites de la página Enrutado la dividen en niveles.", }; diff --git a/web/js/i18n/fr.js b/web/js/i18n/fr.js index 887d2f7..7686893 100644 --- a/web/js/i18n/fr.js +++ b/web/js/i18n/fr.js @@ -634,4 +634,5 @@ export default { "tier.low": "facile", "tier.medium": "moyen", "tier.high": "difficile", + "bm.scoreHint": "Le score de complexité continu du routeur (0..1) — les curseurs de limites de la page Routage le découpent en niveaux.", }; diff --git a/web/js/i18n/ru.js b/web/js/i18n/ru.js index 47eb081..0002937 100644 --- a/web/js/i18n/ru.js +++ b/web/js/i18n/ru.js @@ -25,7 +25,7 @@ export default { "common.all": "все", // nav - "nav.dashboard": "Дашборд", + "nav.dashboard": "Рабочий стол", "nav.models": "Модели", "nav.import": "Импорт модели", "nav.routing": "Роутинг", @@ -56,7 +56,7 @@ export default { "login.failed": "Неверный токен администратора.", // dashboard - "dash.title": "Дашборд", + "dash.title": "Рабочий стол", "dash.subtitle": "Трафик в реальном времени, расходы и аналитика роутинга по пулу моделей.", "dash.clear": "Очистить логи", "dash.clearConfirm": "Очистить всю статистику и логи? Отменить нельзя.", @@ -626,4 +626,5 @@ export default { "tier.low": "лёгкий", "tier.medium": "средний", "tier.high": "сложный", + "bm.scoreHint": "Непрерывный коэффициент сложности роутера (0..1) — ползунки границ на вкладке Роутинг нарезают его на уровни.", }; diff --git a/web/js/i18n/tr.js b/web/js/i18n/tr.js index 5d2bb43..633fe9b 100644 --- a/web/js/i18n/tr.js +++ b/web/js/i18n/tr.js @@ -634,4 +634,5 @@ export default { "tier.low": "kolay", "tier.medium": "orta", "tier.high": "zor", + "bm.scoreHint": "Yönlendiricinin sürekli karmaşıklık puanı (0..1) — Yönlendirme sayfasındaki sınır kaydırıcıları onu katmanlara böler.", }; diff --git a/web/js/i18n/zh.js b/web/js/i18n/zh.js index 801fafb..b0e795f 100644 --- a/web/js/i18n/zh.js +++ b/web/js/i18n/zh.js @@ -634,4 +634,5 @@ export default { "tier.low": "简单", "tier.medium": "中等", "tier.high": "困难", + "bm.scoreHint": "路由器的连续复杂度得分(0..1)— 路由页面上的边界滑块将其划分为层级。", }; diff --git a/web/js/views/benchmark.js b/web/js/views/benchmark.js index 140d319..f9d67af 100644 --- a/web/js/views/benchmark.js +++ b/web/js/views/benchmark.js @@ -238,6 +238,7 @@ export async function renderBenchmark() { info.cost_usd = (info.cost_usd || 0) + (again.cost_usd || 0); if (again.tier === "high") { info.tier = again.tier; + info.score = again.score; info.selected_model = again.selected_model; info.task_label = again.task_label; info.route_source = again.route_source; @@ -269,6 +270,8 @@ export async function renderBenchmark() { || String(info.route_source || "").includes("degraded"); row.task = info.task_label || "—"; row.tier = info.tier || "—"; + row.cscore = info.score || 0; // непрерывный коэффициент сложности + // (row.score занят долей правильности ответа из evaluate()) row.chosen = info.selected_model || "—"; row.source = info.route_source || "—"; row.expected = test.label; // null = classification not judged @@ -402,7 +405,9 @@ export async function renderBenchmark() { : h("span", { class: r.taskOk ? "" : "err" }, (r.taskOk ? "✓ " : "✗ ") + r.task, r.taskOk ? "" : h("div", { class: "muted small" }, t("bm.expectedLbl") + " " + (r.expected || []).join("/")))), - h("td", {}, r.tier ? h("span", { class: "badge tier-" + r.tier }, trTier(r.tier)) : "—"), + h("td", {}, + r.tier ? h("span", { class: "badge tier-" + r.tier }, trTier(r.tier)) : "—", + r.cscore > 0 ? h("div", { class: "muted small mono", title: t("bm.scoreHint") }, r.cscore.toFixed(2)) : null), h("td", {}, h("span", { class: "mono small" }, r.chosen || "—"), r.cost > 0 ? h("div", { class: "muted small" }, moneyEl(r.cost)) : null, diff --git a/web/js/views/dashboard.js b/web/js/views/dashboard.js index 346d70a..c23a27d 100644 --- a/web/js/views/dashboard.js +++ b/web/js/views/dashboard.js @@ -1,6 +1,6 @@ // Dashboard — KPIs, time-series charts, breakdown, recent requests, health. import { h, mount, money, moneyEl, num, ms, pct, timeAgo, toast, confirmDialog } from "../ui.js"; -import { t } from "../i18n.js"; +import { t, trTier } from "../i18n.js"; import { api } from "../api.js"; import { lineChart, barList } from "../charts.js"; import { SITE_URL } from "../app.js"; @@ -271,7 +271,9 @@ function recentTable(rows) { {}, h("td", { class: "mono" }, timeAgo(r.ts)), h("td", {}, r.model_id || "—", r.failover ? h("span", { class: "badge warn", style: "margin-left:6px" }, "fo") : null), - h("td", {}, r.tier ? h("span", { class: "badge tier-" + r.tier }, r.tier) : "—"), + h("td", {}, + r.tier ? h("span", { class: "badge tier-" + r.tier }, trTier(r.tier)) : "—", + r.score > 0 ? h("span", { class: "muted small mono", style: "margin-left:6px" }, r.score.toFixed(2)) : null), h("td", {}, r.task_label || "—"), h("td", { class: "mono" }, `${r.prompt_tokens}/${r.completion_tokens}`), h("td", { class: "mono" }, money(r.cost_usd)),