feat(frontend): 增强用户界面和使用教程

主要改进:
- 扩展 UseKeyModal 支持 Antigravity/Gemini 平台教程
- 添加 CCS (Claude Code Settings) 导入说明
- 添加混合渠道风险警告提示
- 优化登录/注册页面样式
- 更新 Antigravity 混合调度选项文案
- 完善中英文国际化文案
This commit is contained in:
ianshaw
2026-01-03 06:35:50 -08:00
parent 09da6904f5
commit ff3f514f6b
13 changed files with 440 additions and 328 deletions

View File

@@ -127,8 +127,6 @@ export default {
total: 'Total',
balance: 'Balance',
available: 'Available',
copy: 'Copy',
details: 'Details',
copiedToClipboard: 'Copied to clipboard',
copyFailed: 'Failed to copy',
contactSupport: 'Contact Support',
@@ -137,6 +135,9 @@ export default {
noOptionsFound: 'No options found',
saving: 'Saving...',
refresh: 'Refresh',
notAvailable: 'N/A',
now: 'Now',
unknown: 'Unknown',
time: {
never: 'Never',
justNow: 'Just now',
@@ -149,7 +150,6 @@ export default {
// Navigation
nav: {
dashboard: 'Dashboard',
ops: 'Ops Center',
apiKeys: 'API Keys',
usage: 'Usage',
redeem: 'Redeem',
@@ -324,6 +324,18 @@ export default {
note: 'Make sure the config directory exists. macOS/Linux users can run mkdir -p ~/.codex to create it.',
noteWindows: 'Press Win+R and enter %userprofile%\\.codex to open the config directory. Create it manually if it does not exist.',
},
antigravity: {
description: 'Configure API access for Antigravity group. Select the configuration method based on your client.',
claudeCode: 'Claude Code',
geminiCli: 'Gemini CLI',
claudeNote: 'These environment variables will be active in the current terminal session. For permanent configuration, add them to ~/.bashrc, ~/.zshrc, or the appropriate configuration file.',
geminiNote: 'These environment variables will be active in the current terminal session. For permanent configuration, add them to ~/.bashrc, ~/.zshrc, or the appropriate configuration file.',
},
gemini: {
description: 'Add the following environment variables to your terminal profile or run directly in terminal to configure Gemini CLI access.',
modelComment: 'If you have Gemini 3 access, you can use: gemini-3-pro-preview',
note: 'These environment variables will be active in the current terminal session. For permanent configuration, add them to ~/.bashrc, ~/.zshrc, or the appropriate configuration file.',
},
},
customKeyLabel: 'Custom Key',
customKeyPlaceholder: 'Enter your custom key (min 16 chars)',
@@ -331,7 +343,15 @@ export default {
customKeyTooShort: 'Custom key must be at least 16 characters',
customKeyInvalidChars: 'Custom key can only contain letters, numbers, underscores, and hyphens',
customKeyRequired: 'Please enter a custom key',
ccSwitchNotInstalled: 'CC-Switch is not installed or the protocol handler is not registered. Please install CC-Switch first or manually copy the API key.'
ccSwitchNotInstalled: 'CC-Switch is not installed or the protocol handler is not registered. Please install CC-Switch first or manually copy the API key.',
ccsClientSelect: {
title: 'Select Client',
description: 'Please select the client type to import to CC-Switch:',
claudeCode: 'Claude Code',
claudeCodeDesc: 'Import as Claude Code configuration',
geminiCli: 'Gemini CLI',
geminiCliDesc: 'Import as Gemini CLI configuration',
},
},
// Usage
@@ -549,123 +569,6 @@ export default {
recentUsage: 'Recent Usage',
failedToLoad: 'Failed to load dashboard statistics'
},
ops: {
title: 'Ops Monitoring Center 2.0',
description: 'Stability metrics, error distribution, and system health',
status: {
title: 'System Health Snapshot',
subtitle: 'Real-time metrics and error visibility',
systemNormal: 'System Normal',
systemDegraded: 'System Degraded',
systemDown: 'System Down',
noData: 'No Data',
monitoring: 'Monitoring',
lastUpdated: 'Last Updated',
live: 'Live',
waiting: 'Waiting for data',
realtime: 'Connected',
disconnected: 'Disconnected'
},
charts: {
errorTrend: 'Error Trend',
errorDistribution: 'Error Distribution',
errorRate: 'Error Rate',
requestCount: 'Request Count',
rateLimits: 'Rate Limits (429)',
serverErrors: 'Server Errors (5xx)',
clientErrors: 'Client Errors (4xx)',
otherErrors: 'Other',
latencyDist: 'Latency Distribution',
providerSla: 'Upstream SLA Comparison',
errorDist: 'Error Type Distribution',
systemStatus: 'System Resources'
},
metrics: {
successRate: 'Success Rate',
errorRate: 'Error Rate',
p95: 'P95 Latency',
p99: 'P99 Latency',
http2Errors: 'HTTP/2 Errors',
activeAlerts: 'Active Alerts',
cpuUsage: 'CPU Usage',
queueDepth: 'Queue Depth',
healthScore: 'Health Score',
sla: 'Availability (SLA)',
qps: 'Real-time QPS',
tps: 'Real-time TPS',
errorCount: 'Error Count'
},
errors: {
title: 'Recent Errors',
subtitle: 'Inspect failures across platforms and phases',
count: '{n} errors'
},
filters: {
allSeverities: 'All severities',
allPlatforms: 'All platforms',
allPhases: 'All phases',
p0: 'P0 (Critical)',
p1: 'P1 (High)',
p2: 'P2 (Medium)',
p3: 'P3 (Low)'
},
searchPlaceholder: 'Search by request ID, model, or message',
range: {
'15m': 'Last 15 minutes',
'1h': 'Last 1 hour',
'24h': 'Last 24 hours',
'7d': 'Last 7 days'
},
platform: {
anthropic: 'Anthropic',
openai: 'OpenAI',
gemini: 'Gemini',
antigravity: 'Antigravity'
},
phase: {
auth: 'Auth',
concurrency: 'Concurrency',
billing: 'Billing',
scheduling: 'Scheduling',
network: 'Network',
upstream: 'Upstream',
response: 'Response',
internal: 'Internal'
},
severity: {
p0: 'P0',
p1: 'P1',
p2: 'P2',
p3: 'P3'
},
table: {
time: 'Time',
severity: 'Severity',
phase: 'Phase',
statusCode: 'Status',
platform: 'Platform',
model: 'Model',
latency: 'Latency',
requestId: 'Request ID',
message: 'Message'
},
details: {
title: 'Error Details',
requestId: 'Request ID',
errorMessage: 'Error Message',
requestPath: 'Request path',
clientIp: 'Client IP',
userId: 'User ID',
apiKeyId: 'API Key ID',
groupId: 'Group ID',
stream: 'Stream'
},
empty: {
title: 'No ops data yet',
subtitle: 'Enable error logging and metrics to populate this view'
},
failedToLoad: 'Failed to load ops data'
},
// Users
users: {
@@ -1030,6 +933,54 @@ export default {
codeAssist: 'Code Assist',
antigravityOauth: 'Antigravity OAuth'
},
status: {
paused: 'Paused',
limited: 'Limited',
tempUnschedulable: 'Temp Unschedulable'
},
tempUnschedulable: {
title: 'Temp Unschedulable',
statusTitle: 'Temp Unschedulable Status',
hint: 'Disable accounts temporarily when error code and keyword both match.',
notice: 'Rules are evaluated in order and require both error code and keyword match.',
addRule: 'Add Rule',
ruleOrder: 'Rule Order',
ruleIndex: 'Rule #{index}',
errorCode: 'Error Code',
errorCodePlaceholder: 'e.g. 429',
durationMinutes: 'Duration (minutes)',
durationPlaceholder: 'e.g. 30',
keywords: 'Keywords',
keywordsPlaceholder: 'e.g. overloaded, too many requests',
keywordsHint: 'Separate keywords with commas; any keyword match will trigger.',
description: 'Description',
descriptionPlaceholder: 'Optional note for this rule',
rulesInvalid: 'Add at least one rule with error code, keywords, and duration.',
viewDetails: 'View temp unschedulable details',
accountName: 'Account',
triggeredAt: 'Triggered At',
until: 'Until',
remaining: 'Remaining',
matchedKeyword: 'Matched Keyword',
errorMessage: 'Error Details',
reset: 'Reset Status',
resetSuccess: 'Temp unschedulable status reset',
resetFailed: 'Failed to reset temp unschedulable status',
failedToLoad: 'Failed to load temp unschedulable status',
notActive: 'This account is not temporarily unschedulable.',
expired: 'Expired',
remainingMinutes: 'About {minutes} minutes',
remainingHours: 'About {hours} hours',
remainingHoursMinutes: 'About {hours} hours {minutes} minutes',
presets: {
overloadLabel: '529 Overloaded',
overloadDesc: 'Overloaded - pause 60 minutes',
rateLimitLabel: '429 Rate Limit',
rateLimitDesc: 'Rate limited - pause 10 minutes',
unavailableLabel: '503 Unavailable',
unavailableDesc: 'Unavailable - pause 30 minutes'
}
},
columns: {
name: 'Name',
platformType: 'Platform/Type',
@@ -1147,10 +1098,10 @@ export default {
priority: 'Priority',
priorityHint: 'Higher priority accounts are used first',
higherPriorityFirst: 'Higher value means higher priority',
mixedScheduling: 'Mixed Scheduling',
mixedScheduling: 'Use in /v1/messages',
mixedSchedulingHint: 'Enable to participate in Anthropic/Gemini group scheduling',
mixedSchedulingTooltip:
'When enabled, this account can be scheduled by /v1/messages and /v1beta endpoints. Otherwise, it will only be scheduled by /antigravity. Note: Anthropic Claude and Antigravity Claude cannot be mixed in the same context. Please manage groups carefully when enabled.',
'!! WARNING !! Antigravity Claude and Anthropic Claude cannot be used in the same context. If you have both Anthropic and Antigravity accounts, enabling this option will cause frequent 400 errors. When enabled, please use the group feature to isolate Antigravity accounts from Anthropic accounts. Make sure you understand this before enabling!!',
creating: 'Creating...',
updating: 'Updating...',
accountCreated: 'Account created successfully',
@@ -1664,6 +1615,7 @@ export default {
siteKey: 'Site Key',
secretKey: 'Secret Key',
siteKeyHint: 'Get this from your Cloudflare Dashboard',
cloudflareDashboard: 'Cloudflare Dashboard',
secretKeyHint: 'Server-side verification key (keep this secret)'
},
defaults: {
@@ -1814,6 +1766,7 @@ export default {
noActiveSubscriptions: 'No Active Subscriptions',
noActiveSubscriptionsDesc:
"You don't have any active subscriptions. Contact administrator to get one.",
failedToLoad: 'Failed to load subscriptions',
status: {
active: 'Active',
expired: 'Expired',

View File

@@ -124,8 +124,6 @@ export default {
total: '总计',
balance: '余额',
available: '可用',
copy: '复制',
details: '详情',
copiedToClipboard: '已复制到剪贴板',
copyFailed: '复制失败',
contactSupport: '联系客服',
@@ -134,6 +132,9 @@ export default {
noOptionsFound: '无匹配选项',
saving: '保存中...',
refresh: '刷新',
notAvailable: '不可用',
now: '现在',
unknown: '未知',
time: {
never: '从未',
justNow: '刚刚',
@@ -146,7 +147,6 @@ export default {
// Navigation
nav: {
dashboard: '仪表盘',
ops: '运维监控',
apiKeys: 'API 密钥',
usage: '使用记录',
redeem: '兑换',
@@ -320,6 +320,18 @@ export default {
note: '请确保配置目录存在。macOS/Linux 用户可运行 mkdir -p ~/.codex 创建目录。',
noteWindows: '按 Win+R输入 %userprofile%\\.codex 打开配置目录。如目录不存在,请先手动创建。',
},
antigravity: {
description: '为 Antigravity 分组配置 API 访问。请根据您使用的客户端选择对应的配置方式。',
claudeCode: 'Claude Code',
geminiCli: 'Gemini CLI',
claudeNote: '这些环境变量将在当前终端会话中生效。如需永久配置,请将其添加到 ~/.bashrc、~/.zshrc 或相应的配置文件中。',
geminiNote: '这些环境变量将在当前终端会话中生效。如需永久配置,请将其添加到 ~/.bashrc、~/.zshrc 或相应的配置文件中。',
},
gemini: {
description: '将以下环境变量添加到您的终端配置文件或直接在终端中运行,以配置 Gemini CLI 访问。',
modelComment: '如果你有 Gemini 3 权限可以填gemini-3-pro-preview',
note: '这些环境变量将在当前终端会话中生效。如需永久配置,请将其添加到 ~/.bashrc、~/.zshrc 或相应的配置文件中。',
},
},
customKeyLabel: '自定义密钥',
customKeyPlaceholder: '输入自定义密钥至少16个字符',
@@ -327,7 +339,15 @@ export default {
customKeyTooShort: '自定义密钥至少需要16个字符',
customKeyInvalidChars: '自定义密钥只能包含字母、数字、下划线和连字符',
customKeyRequired: '请输入自定义密钥',
ccSwitchNotInstalled: 'CC-Switch 未安装或协议处理程序未注册。请先安装 CC-Switch 或手动复制 API 密钥。'
ccSwitchNotInstalled: 'CC-Switch 未安装或协议处理程序未注册。请先安装 CC-Switch 或手动复制 API 密钥。',
ccsClientSelect: {
title: '选择客户端',
description: '请选择您要导入到 CC-Switch 的客户端类型:',
claudeCode: 'Claude Code',
claudeCodeDesc: '导入为 Claude Code 配置',
geminiCli: 'Gemini CLI',
geminiCliDesc: '导入为 Gemini CLI 配置',
},
},
// Usage
@@ -562,123 +582,6 @@ export default {
configureSystem: '配置系统设置',
failedToLoad: '加载仪表盘数据失败'
},
ops: {
title: '运维监控中心 2.0',
description: '稳定性指标、错误分布与系统健康',
status: {
title: '系统健康快照',
subtitle: '实时指标与错误可见性',
systemNormal: '系统正常',
systemDegraded: '系统降级',
systemDown: '系统异常',
noData: '无数据',
monitoring: '监控中',
lastUpdated: '最后更新',
live: '实时',
waiting: '等待数据',
realtime: '实时连接中',
disconnected: '连接已断开'
},
charts: {
errorTrend: '错误趋势',
errorDistribution: '错误分布',
errorRate: '错误率',
requestCount: '请求数',
rateLimits: '限流 (429)',
serverErrors: '服务端错误 (5xx)',
clientErrors: '客户端错误 (4xx)',
otherErrors: '其他',
latencyDist: '请求延迟分布',
providerSla: '上游供应商健康度 (SLA)',
errorDist: '错误类型分布',
systemStatus: '系统运行状态'
},
metrics: {
successRate: '成功率',
errorRate: '错误率',
p95: 'P95 延迟',
p99: 'P99 延迟',
http2Errors: 'HTTP/2 错误',
activeAlerts: '活跃告警',
cpuUsage: 'CPU 使用率',
queueDepth: '排队深度',
healthScore: '健康评分',
sla: '服务可用率 (SLA)',
qps: '实时 QPS',
tps: '实时 TPS',
errorCount: '周期错误数'
},
errors: {
title: '最近错误',
subtitle: '按平台与阶段定位失败原因',
count: '{n} 条错误'
},
filters: {
allSeverities: '全部级别',
allPlatforms: '全部平台',
allPhases: '全部阶段',
p0: 'P0致命',
p1: 'P1',
p2: 'P2',
p3: 'P3'
},
searchPlaceholder: '按请求ID、模型或错误信息搜索',
range: {
'15m': '近 15 分钟',
'1h': '近 1 小时',
'24h': '近 24 小时',
'7d': '近 7 天'
},
platform: {
anthropic: 'Anthropic',
openai: 'OpenAI',
gemini: 'Gemini',
antigravity: 'Antigravity'
},
phase: {
auth: '认证',
concurrency: '并发',
billing: '计费',
scheduling: '调度',
network: '网络',
upstream: '上游',
response: '响应',
internal: '内部'
},
severity: {
p0: 'P0',
p1: 'P1',
p2: 'P2',
p3: 'P3'
},
table: {
time: '时间',
severity: '级别',
phase: '阶段',
statusCode: '状态码',
platform: '平台',
model: '模型',
latency: '延迟',
requestId: '请求ID',
message: '错误信息'
},
details: {
title: '错误详情',
requestId: '请求ID',
errorMessage: '错误信息',
requestPath: '请求路径',
clientIp: '客户端IP',
userId: '用户ID',
apiKeyId: 'API Key ID',
groupId: '分组ID',
stream: '流式'
},
empty: {
title: '暂无运维数据',
subtitle: '启用错误日志与指标采集后将展示在此处'
},
failedToLoad: '加载运维数据失败'
},
// Users Management
users: {
@@ -1156,6 +1059,54 @@ export default {
error: '错误',
cooldown: '冷却中'
},
status: {
paused: '已暂停',
limited: '受限',
tempUnschedulable: '临时不可调度'
},
tempUnschedulable: {
title: '临时不可调度',
statusTitle: '临时不可调度状态',
hint: '当错误码与关键词同时匹配时,账号会在指定时间内被临时禁用。',
notice: '规则按顺序匹配,需同时满足错误码与关键词。',
addRule: '添加规则',
ruleOrder: '规则序号',
ruleIndex: '规则 #{index}',
errorCode: '错误码',
errorCodePlaceholder: '例如 429',
durationMinutes: '持续时间(分钟)',
durationPlaceholder: '例如 30',
keywords: '关键词',
keywordsPlaceholder: '例如 overloaded, too many requests',
keywordsHint: '多个关键词用逗号分隔,匹配时必须命中其中之一。',
description: '描述',
descriptionPlaceholder: '可选,便于记忆规则用途',
rulesInvalid: '请至少填写一条包含错误码、关键词和时长的规则。',
viewDetails: '查看临时不可调度详情',
accountName: '账号',
triggeredAt: '触发时间',
until: '解除时间',
remaining: '剩余时间',
matchedKeyword: '匹配关键词',
errorMessage: '错误详情',
reset: '重置状态',
resetSuccess: '临时不可调度已重置',
resetFailed: '重置临时不可调度失败',
failedToLoad: '加载临时不可调度状态失败',
notActive: '当前账号未处于临时不可调度状态。',
expired: '已到期',
remainingMinutes: '约 {minutes} 分钟',
remainingHours: '约 {hours} 小时',
remainingHoursMinutes: '约 {hours} 小时 {minutes} 分钟',
presets: {
overloadLabel: '529 过载',
overloadDesc: '服务过载 - 暂停 60 分钟',
rateLimitLabel: '429 限流',
rateLimitDesc: '触发限流 - 暂停 10 分钟',
unavailableLabel: '503 维护',
unavailableDesc: '服务不可用 - 暂停 30 分钟'
}
},
usageWindow: {
statsTitle: '5小时窗口用量统计',
statsTitleDaily: '每日用量统计',
@@ -1300,10 +1251,10 @@ export default {
priority: '优先级',
priorityHint: '优先级越高的账号优先使用',
higherPriorityFirst: '数值越高优先级越高',
mixedScheduling: '混合调度',
mixedScheduling: '在 /v1/messages 中使用',
mixedSchedulingHint: '启用后可参与 Anthropic/Gemini 分组的调度',
mixedSchedulingTooltip:
'开启后,该账户可被 /v1/messages 及 /v1beta 端点调度,否则只被 /antigravity 调度。注意Anthropic Claude 和 Antigravity Claude 无法在同个上下文中混合使用,开启后请自行做好分组管理。',
'!!注意!! Antigravity Claude 和 Anthropic Claude 无法在同个上下文中使用,如果你同时有 Anthropic 账号和 Antigravity 账号,开启此选项会导致经常 400 报错。开启后,请用分组功能做好 Antigravity 账号和 Anthropic 账号的隔离。一定要弄明白再开启!!',
creating: '创建中...',
updating: '更新中...',
accountCreated: '账号创建成功',
@@ -1860,6 +1811,7 @@ export default {
siteKey: '站点密钥',
secretKey: '私密密钥',
siteKeyHint: '从 Cloudflare Dashboard 获取',
cloudflareDashboard: 'Cloudflare Dashboard',
secretKeyHint: '服务端验证密钥(请保密)'
},
defaults: {
@@ -2007,6 +1959,7 @@ export default {
description: '查看您的订阅计划和用量',
noActiveSubscriptions: '暂无有效订阅',
noActiveSubscriptionsDesc: '您没有任何有效订阅。请联系管理员获取订阅。',
failedToLoad: '加载订阅失败',
status: {
active: '有效',
expired: '已过期',