mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
fix: 保持仪表盘趋势图非负并纠正小时区间
- 小时粒度请求使用用户选择的起止时间,避免近24小时被截成整天 - 修正日期展示格式化逻辑,减少时区偏移导致的窗口错位 - 趋势图 Y 轴(Token/请求数/费用等)强制最小值为 0,防止出现负刻度
This commit is contained in:
@@ -1036,6 +1036,7 @@ function createUsageTrendChart() {
|
||||
type: 'linear',
|
||||
display: true,
|
||||
position: 'left',
|
||||
min: 0,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Token数量',
|
||||
@@ -1055,6 +1056,7 @@ function createUsageTrendChart() {
|
||||
type: 'linear',
|
||||
display: true,
|
||||
position: 'right',
|
||||
min: 0,
|
||||
title: {
|
||||
display: true,
|
||||
text: '请求数',
|
||||
@@ -1073,7 +1075,8 @@ function createUsageTrendChart() {
|
||||
y2: {
|
||||
type: 'linear',
|
||||
display: false, // 隐藏费用轴,在tooltip中显示
|
||||
position: 'right'
|
||||
position: 'right',
|
||||
min: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1253,6 +1256,7 @@ function createApiKeysUsageTrendChart() {
|
||||
},
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
min: 0,
|
||||
title: {
|
||||
display: true,
|
||||
text: apiKeysTrendMetric.value === 'tokens' ? 'Token 数量' : '请求次数',
|
||||
@@ -1428,6 +1432,7 @@ function createAccountUsageTrendChart() {
|
||||
},
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
min: 0,
|
||||
title: {
|
||||
display: true,
|
||||
text: '消耗金额 (USD)',
|
||||
|
||||
Reference in New Issue
Block a user