mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-10-19 22:17:42 +02:00
style: show only cache hit rate below dashboard token total
This commit is contained in:
1 parent
5d14daf486
commit
4badef67c1
7 files changed
+6
-9
No files matched your search
@@ -288,7 +288,7 @@
|
||||
"successRate": "Tool success rate",
|
||||
"tokenUsage": "Token usage",
|
||||
"usageCacheHitRate": "Cache hit {{rate}}",
|
||||
"tokenUsageSub": "Today {{today}} · Cache hit {{rate}}",
|
||||
"tokenUsageSub": "Cache hit {{rate}}",
|
||||
"noTokenUsageYet": "No usage yet",
|
||||
"clickToViewTasks": "Click to view tasks",
|
||||
"clickToViewChat": "Click to view conversations",
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
"successRate": "Успешность инструментов",
|
||||
"tokenUsage": "Расход токенов",
|
||||
"usageCacheHitRate": "Попадания в кэш {{rate}}",
|
||||
"tokenUsageSub": "Сегодня {{today}} · Кэш {{rate}}",
|
||||
"tokenUsageSub": "Кэш {{rate}}",
|
||||
"noTokenUsageYet": "Расхода пока нет",
|
||||
"clickToViewTasks": "Открыть задачи",
|
||||
"clickToViewChat": "Открыть диалоги",
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
"successRate": "工具执行成功率",
|
||||
"tokenUsage": "Token 用量",
|
||||
"usageCacheHitRate": "缓存命中 {{rate}}",
|
||||
"tokenUsageSub": "今日 {{today}} · 缓存命中 {{rate}}",
|
||||
"tokenUsageSub": "缓存命中 {{rate}}",
|
||||
"noTokenUsageYet": "暂无用量",
|
||||
"clickToViewTasks": "点击查看任务管理",
|
||||
"clickToViewChat": "点击查看对话",
|
||||
|
||||
@@ -717,7 +717,6 @@ function renderDashboardTokenUsage(res) {
|
||||
}
|
||||
const cacheRate = tokenUsageCacheRate(summary);
|
||||
const total = Number(summary.totalTokens || 0);
|
||||
const today = res && res.today ? Number(res.today.totalTokens || 0) : 0;
|
||||
if (!Number.isFinite(total) || total <= 0) {
|
||||
setEl('dashboard-kpi-token-usage', '0');
|
||||
setKpiSubText('dashboard-kpi-token-sub-text', dt('dashboard.noTokenUsageYet', null, '暂无用量'));
|
||||
@@ -726,9 +725,8 @@ function renderDashboardTokenUsage(res) {
|
||||
setEl('dashboard-kpi-token-usage', formatTokenUsageCompact(total));
|
||||
setKpiSubText('dashboard-kpi-token-sub-text',
|
||||
dt('dashboard.tokenUsageSub', {
|
||||
today: formatTokenUsageCompact(today),
|
||||
rate: cacheRate
|
||||
}, '今日 ' + formatTokenUsageCompact(today) + ' · 缓存命中 ' + cacheRate));
|
||||
}, '缓存命中 ' + cacheRate));
|
||||
}
|
||||
|
||||
function formatTokenUsageCompact(num) {
|
||||
|
||||
@@ -75,7 +75,6 @@ test('all supported languages expose usage labels and interpolation placeholders
|
||||
for (const key of ['usageView', 'usageScope', 'usageCacheRead', 'usageCacheWrite', 'usageTrend', 'usageCacheHitRate']) assert.ok(data.dashboard[key]);
|
||||
assert.ok(data.settings.nav.tokenUsage);
|
||||
assert.match(data.dashboard.usageCacheHitRate, /\{\{rate\}\}/);
|
||||
assert.match(data.dashboard.tokenUsageSub, /\{\{today\}\}/);
|
||||
assert.match(data.dashboard.tokenUsageSub, /\{\{rate\}\}/);
|
||||
assert.match(data.chat.turnTokenUsageTitle, /\{\{cacheWrite\}\}/);
|
||||
}
|
||||
|
||||
@@ -7016,7 +7016,7 @@
|
||||
<script src="/static/js/info-collect.js?v=20260717-1"></script>
|
||||
<script src="/static/js/assets.js?v=20260717-7"></script>
|
||||
<script src="/static/js/agents.js"></script>
|
||||
<script src="/static/js/dashboard.js?v=20261011-token-settings-compact"></script>
|
||||
<script src="/static/js/dashboard.js?v=20261011-token-settings-cache-only"></script>
|
||||
<script src="/static/js/chat-scroll.js?v=20260815-1"></script>
|
||||
<script src="/static/js/monitor.js?v=20261011-token-usage"></script>
|
||||
<script src="/static/js/chat.js?v=20261011-token-usage"></script>
|
||||
|
||||
Reference in new issue
Block a user