mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 00:53:33 +00:00
fix: 修复仪表盘Keys统计展示问题
This commit is contained in:
@@ -982,7 +982,7 @@ function createApiKeysUsageTrendChart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = apiKeysTrendData.value.data || []
|
const data = apiKeysTrendData.value.data || []
|
||||||
const metric = apiKeysTrendMetric
|
const metric = apiKeysTrendMetric.value
|
||||||
|
|
||||||
// 颜色数组
|
// 颜色数组
|
||||||
const colors = [
|
const colors = [
|
||||||
@@ -1104,7 +1104,7 @@ function createApiKeysUsageTrendChart() {
|
|||||||
else if (rank === 2) rankIcon = '🥈 '
|
else if (rank === 2) rankIcon = '🥈 '
|
||||||
else if (rank === 3) rankIcon = '🥉 '
|
else if (rank === 3) rankIcon = '🥉 '
|
||||||
|
|
||||||
if (apiKeysTrendMetric === 'tokens') {
|
if (apiKeysTrendMetric.value === 'tokens') {
|
||||||
// 格式化token显示
|
// 格式化token显示
|
||||||
let formattedValue = ''
|
let formattedValue = ''
|
||||||
if (value >= 1000000) {
|
if (value >= 1000000) {
|
||||||
@@ -1148,7 +1148,7 @@ function createApiKeysUsageTrendChart() {
|
|||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
title: {
|
title: {
|
||||||
display: true,
|
display: true,
|
||||||
text: apiKeysTrendMetric === 'tokens' ? 'Token 数量' : '请求次数',
|
text: apiKeysTrendMetric.value === 'tokens' ? 'Token 数量' : '请求次数',
|
||||||
color: chartColors.value.text
|
color: chartColors.value.text
|
||||||
},
|
},
|
||||||
ticks: {
|
ticks: {
|
||||||
@@ -1168,7 +1168,7 @@ function createApiKeysUsageTrendChart() {
|
|||||||
|
|
||||||
// 更新API Keys使用趋势图
|
// 更新API Keys使用趋势图
|
||||||
async function updateApiKeysUsageTrendChart() {
|
async function updateApiKeysUsageTrendChart() {
|
||||||
await loadApiKeysTrend(apiKeysTrendMetric)
|
await loadApiKeysTrend(apiKeysTrendMetric.value)
|
||||||
await nextTick()
|
await nextTick()
|
||||||
createApiKeysUsageTrendChart()
|
createApiKeysUsageTrendChart()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user