Skip to content

Commit 953c503

Browse files
author
QTom
committed
feat: add RPM types and i18n translations
1 parent 37fa980 commit 953c503

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

frontend/src/i18n/locales/en.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,12 @@ export default {
16131613
sessions: {
16141614
full: 'Active sessions full, new sessions must wait (idle timeout: {idle} min)',
16151615
normal: 'Active sessions normal (idle timeout: {idle} min)'
1616-
}
1616+
},
1617+
rpm: {
1618+
full: 'RPM limit reached',
1619+
warning: 'RPM approaching limit',
1620+
normal: 'RPM normal',
1621+
},
16171622
},
16181623
tempUnschedulable: {
16191624
title: 'Temp Unschedulable',
@@ -1828,6 +1833,17 @@ export default {
18281833
idleTimeoutPlaceholder: '5',
18291834
idleTimeoutHint: 'Sessions will be released after idle timeout'
18301835
},
1836+
rpmLimit: {
1837+
label: 'RPM Limit',
1838+
hint: 'Limit requests per minute to protect upstream accounts',
1839+
baseRpm: 'Base RPM',
1840+
baseRpmPlaceholder: '15',
1841+
baseRpmHint: 'Max requests per minute, 0 or empty means no limit',
1842+
strategy: 'RPM Strategy',
1843+
strategyTiered: 'Tiered Model',
1844+
strategyStickyExempt: 'Sticky Exempt',
1845+
strategyHint: 'Tiered: gradually restrict when exceeded; Sticky Exempt: existing sessions unrestricted',
1846+
},
18311847
tlsFingerprint: {
18321848
label: 'TLS Fingerprint Simulation',
18331849
hint: 'Simulate Node.js/Claude Code client TLS fingerprint'

frontend/src/i18n/locales/zh.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,12 @@ export default {
16641664
sessions: {
16651665
full: '活跃会话已满,新会话需等待(空闲超时:{idle}分钟)',
16661666
normal: '活跃会话正常(空闲超时:{idle}分钟)'
1667-
}
1667+
},
1668+
rpm: {
1669+
full: '已达 RPM 上限',
1670+
warning: 'RPM 接近上限',
1671+
normal: 'RPM 正常',
1672+
},
16681673
},
16691674
clearRateLimit: '清除速率限制',
16701675
testConnection: '测试连接',
@@ -1971,6 +1976,17 @@ export default {
19711976
idleTimeoutPlaceholder: '5',
19721977
idleTimeoutHint: '会话空闲超时后自动释放'
19731978
},
1979+
rpmLimit: {
1980+
label: 'RPM 限制',
1981+
hint: '限制每分钟请求数量,保护上游账号',
1982+
baseRpm: '基础 RPM',
1983+
baseRpmPlaceholder: '15',
1984+
baseRpmHint: '每分钟最大请求数,0 或留空表示不限制',
1985+
strategy: 'RPM 策略',
1986+
strategyTiered: '三区模型',
1987+
strategyStickyExempt: '粘性豁免',
1988+
strategyHint: '三区模型: 超限后逐步限制; 粘性豁免: 已有会话不受限',
1989+
},
19741990
tlsFingerprint: {
19751991
label: 'TLS 指纹模拟',
19761992
hint: '模拟 Node.js/Claude Code 客户端的 TLS 指纹'

frontend/src/types/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,11 @@ export interface Account {
661661
max_sessions?: number | null
662662
session_idle_timeout_minutes?: number | null
663663

664+
// RPM 限制(仅 Anthropic OAuth/SetupToken 账号有效)
665+
base_rpm?: number | null
666+
rpm_strategy?: string | null
667+
rpm_sticky_buffer?: number | null
668+
664669
// TLS指纹伪装(仅 Anthropic OAuth/SetupToken 账号有效)
665670
enable_tls_fingerprint?: boolean | null
666671

@@ -675,6 +680,7 @@ export interface Account {
675680
// 运行时状态(仅当启用对应限制时返回)
676681
current_window_cost?: number | null // 当前窗口费用
677682
active_sessions?: number | null // 当前活跃会话数
683+
current_rpm?: number | null // 当前分钟 RPM 计数
678684
}
679685

680686
// Account Usage types

0 commit comments

Comments
 (0)