refactor(dashboard): collapse usage section into a single row

Merge the two "by Model" pies (Token Usage + API Requests) into one
dual-pie card with a shared right-side vertical legend and per-donut
center totals, drop the standalone API-Key Top 10 chart, and put the
combined chart side-by-side with the User Top 10 ranking in one row
with the same 16/8 column ratio used by the System Load section above.

* New component usage-charts/usage-by-model.tsx owns both metric queries
  (group_by=['date','route']), aggregates a shared route→color map so
  the legend toggles both donuts together, and renders two pies at
  centers ('20%','50%') and ('60%','50%') with radius ['50%','70%'].
* new-usage.tsx no longer mounts ApiRequestsByModel / TokenUsageByModel
  / TopTokenUsageByApiKey; layout collapses to two columns sized
  (lg=24 xl=16) and (lg=24 xl=8).
* Delete unused token-usage-by-model.tsx, api-requests-by-model.tsx,
  top-token-usage-by-api-key.tsx, and the use-top-token-usage-by-api-key
  hook.
* Strip the now-unreferenced dashboard.tokenUsageByModel /
  apiRequestsByModel / topTokenUsageByApiKey locale keys across 5
  locales, add the new dashboard.usageByModel title; locale parity
  check passes.
This commit is contained in:
Yuxing Deng
2026-05-20 11:29:43 +08:00
committed by jialin
parent 44e5b78d29
commit c38fcc494a
11 changed files with 317 additions and 280 deletions
+1 -3
View File
@@ -14,10 +14,8 @@ export default {
'dashboard.tokens': 'Token Usage',
'dashboard.topusers': 'Top Users',
'dashboard.activeDeployments': 'Active Deployments',
'dashboard.tokenUsageByModel': 'Token Usage by Model',
'dashboard.apiRequestsByModel': 'API Requests by Model',
'dashboard.usageByModel': 'Usage by Model',
'dashboard.topTokenUsageByUser': 'Top 10 Token Usage by User',
'dashboard.topTokenUsageByApiKey': 'Top 10 Token Usage by API Key',
'dashboard.allocatevram': 'Allocated VRAM / RAM',
'dashboard.usage.selectuser': 'Select users',
'dashboard.usage.selectmodel': 'Select models',
+1 -3
View File
@@ -13,10 +13,8 @@ export default {
'dashboard.tokens': 'トークン使用量',
'dashboard.topusers': 'トップユーザー',
'dashboard.activeDeployments': 'Active Deployments',
'dashboard.tokenUsageByModel': 'モデル別トークン使用量',
'dashboard.apiRequestsByModel': 'モデル別APIリクエスト',
'dashboard.usageByModel': 'モデル別使用量',
'dashboard.topTokenUsageByUser': 'ユーザー別トークン使用量トップ10',
'dashboard.topTokenUsageByApiKey': 'APIキー別トークン使用量トップ10',
'dashboard.allocatevram': '割り当て済みVRAM / メモリ',
'dashboard.usage.selectuser': 'Select users',
'dashboard.usage.selectmodel': 'Select models',
+1 -3
View File
@@ -13,10 +13,8 @@ export default {
'dashboard.tokens': 'Использование токенов',
'dashboard.topusers': 'Топ пользователей',
'dashboard.activeDeployments': 'Active Deployments',
'dashboard.tokenUsageByModel': 'Использование токенов по моделям',
'dashboard.apiRequestsByModel': 'API-запросы по моделям',
'dashboard.usageByModel': 'Использование по моделям',
'dashboard.topTokenUsageByUser': 'Топ-10 пользователей по токенам',
'dashboard.topTokenUsageByApiKey': 'Топ-10 API-ключей по токенам',
'dashboard.allocatevram': 'Выделено VRAM / ОЗУ',
'dashboard.usage.selectuser': 'Выбрать пользователей',
'dashboard.usage.selectmodel': 'Выбрать модели',
+1 -4
View File
@@ -14,11 +14,8 @@ export default {
'dashboard.tokens': 'Token Kullanımı',
'dashboard.topusers': 'En Aktif Kullanıcılar',
'dashboard.activeDeployments': 'Active Deployments',
'dashboard.tokenUsageByModel': 'Modele Göre Token Kullanımı',
'dashboard.apiRequestsByModel': 'Modele Göre API İstekleri',
'dashboard.usageByModel': 'Modele Göre Kullanım',
'dashboard.topTokenUsageByUser': 'Kullanıcıya Göre İlk 10 Token Kullanımı',
'dashboard.topTokenUsageByApiKey':
'API Anahtarına Göre İlk 10 Token Kullanımı',
'dashboard.allocatevram': 'Ayrılan VRAM / RAM',
'dashboard.usage.selectuser': 'Kullanıcı seçin',
'dashboard.usage.selectmodel': 'Model seçin',
+1 -3
View File
@@ -14,10 +14,8 @@ export default {
'dashboard.tokens': 'Token 使用量',
'dashboard.topusers': '用户排行',
'dashboard.activeDeployments': '活跃部署',
'dashboard.tokenUsageByModel': '按模型统计 Token 使用量',
'dashboard.apiRequestsByModel': '按模型统计 API 请求数',
'dashboard.usageByModel': '按模型统计使用量',
'dashboard.topTokenUsageByUser': '用户 Token 使用量 Top 10',
'dashboard.topTokenUsageByApiKey': 'API 密钥 Token 使用量 Top 10',
'dashboard.allocatevram': '已分配显存 / 内存',
'dashboard.usage.selectuser': '选择用户',
'dashboard.usage.selectmodel': '选择模型',