mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
feat: 实现基于滑动窗口的实时RPM/TPM统计
- 添加系统级分钟统计,支持1-60分钟可配置时间窗口 - 新增 getRealtimeSystemMetrics 方法计算滑动窗口内的平均值 - 前端显示实时RPM/TPM,标注时间窗口和数据来源 - 修复 EditApiKeyModal 中模型限制和客户端限制复选框状态错误 - 优化性能:使用Pipeline批量操作替代Promise.all - TPM包含所有token类型:input、output、cache_creation、cache_read - 添加降级方案:实时数据不可用时返回历史平均值 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -522,8 +522,9 @@ onMounted(async () => {
|
||||
form.restrictedModels = props.apiKey.restrictedModels || []
|
||||
form.allowedClients = props.apiKey.allowedClients || []
|
||||
form.tags = props.apiKey.tags || []
|
||||
form.enableModelRestriction = form.restrictedModels.length > 0
|
||||
form.enableClientRestriction = form.allowedClients.length > 0
|
||||
// 从后端数据中获取实际的启用状态,而不是根据数组长度推断
|
||||
form.enableModelRestriction = props.apiKey.enableModelRestriction || false
|
||||
form.enableClientRestriction = props.apiKey.enableClientRestriction || false
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user