From 9dce8a5388ed68c04b7769cffb9edff8f68a5289 Mon Sep 17 00:00:00 2001 From: IanShaw027 <131567472+IanShaw027@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:56:19 +0800 Subject: [PATCH] =?UTF-8?q?i18n(ops):=20=E6=B7=BB=E5=8A=A0=E8=BF=90?= =?UTF-8?q?=E7=BB=B4=E7=9B=91=E6=8E=A7=E7=9B=B8=E5=85=B3=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/i18n/locales/en.ts | 41 ++++++++++++++++++++++++++++++++- frontend/src/i18n/locales/zh.ts | 41 ++++++++++++++++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 37ef474a..52faf577 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -2067,14 +2067,49 @@ export default { editTitle: 'Edit Alert Rule', deleteConfirmTitle: 'Delete this rule?', deleteConfirmMessage: 'This will remove the rule and its related events. Continue?', + metricGroups: { + system: 'System Metrics', + group: 'Group-level Metrics (requires group_id)', + account: 'Account-level Metrics' + }, metrics: { successRate: 'Success Rate (%)', errorRate: 'Error Rate (%)', + upstreamErrorRate: 'Upstream Error Rate (%)', p95: 'P95 Latency (ms)', p99: 'P99 Latency (ms)', cpu: 'CPU Usage (%)', memory: 'Memory Usage (%)', - queueDepth: 'Concurrency Queue Depth' + queueDepth: 'Concurrency Queue Depth', + groupAvailableAccounts: 'Group Available Accounts', + groupAvailableRatio: 'Group Available Ratio (%)', + groupRateLimitRatio: 'Group Rate Limit Ratio (%)', + accountRateLimitedCount: 'Rate-limited Accounts', + accountErrorCount: 'Error Accounts (excluding temporarily unschedulable)', + accountErrorRatio: 'Error Account Ratio (%)', + overloadAccountCount: 'Overloaded Accounts' + }, + metricDescriptions: { + successRate: 'Percentage of successful requests in the window (0-100).', + errorRate: 'Percentage of failed requests in the window (0-100).', + upstreamErrorRate: 'Percentage of upstream failures in the window (0-100).', + p95: 'P95 request latency within the window (ms).', + p99: 'P99 request latency within the window (ms).', + cpu: 'Current instance CPU usage (0-100).', + memory: 'Current instance memory usage (0-100).', + queueDepth: 'Concurrency queue depth within the window (queued requests).', + groupAvailableAccounts: 'Number of available accounts in the selected group (requires group_id).', + groupAvailableRatio: 'Available account ratio in the selected group (0-100, requires group_id).', + groupRateLimitRatio: 'Rate-limited account ratio in the selected group (0-100, requires group_id).', + accountRateLimitedCount: 'Number of rate-limited accounts within the window.', + accountErrorCount: 'Number of error accounts within the window (excluding temporarily unschedulable).', + accountErrorRatio: 'Error account ratio within the window (0-100).', + overloadAccountCount: 'Number of overloaded accounts within the window.' + }, + hints: { + recommended: 'Recommended: operator {operator}, threshold {threshold}{unit}', + groupRequired: 'This is a group-level metric; selecting a group (group_id) is required.', + groupOptional: 'Optional: limit the rule to a specific group via group_id.' }, table: { name: 'Name', @@ -2088,6 +2123,9 @@ export default { description: 'Description', metric: 'Metric', operator: 'Operator', + groupId: 'Group (group_id)', + groupPlaceholder: 'Select a group', + allGroups: 'All groups', threshold: 'Threshold', severity: 'Severity', window: 'Window (minutes)', @@ -2101,6 +2139,7 @@ export default { invalid: 'Invalid rule', nameRequired: 'Name is required', metricRequired: 'Metric is required', + groupIdRequired: 'group_id is required for group-level metrics', operatorRequired: 'Operator is required', thresholdRequired: 'Threshold must be a number', windowRange: 'Window must be one of: 1, 5, 60 minutes', diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index 95406179..32f516e7 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -2216,14 +2216,49 @@ export default { deleteConfirmTitle: '确认删除该规则?', deleteConfirmMessage: '将删除该规则及其关联的告警事件,是否继续?', manage: '预警规则', + metricGroups: { + system: '系统指标', + group: '分组级别指标(需 group_id)', + account: '账号级别指标' + }, metrics: { successRate: '成功率 (%)', errorRate: '错误率 (%)', + upstreamErrorRate: '上游错误率 (%)', p95: 'P95 延迟 (ms)', p99: 'P99 延迟 (ms)', cpu: 'CPU 使用率 (%)', memory: '内存使用率 (%)', - queueDepth: '并发排队深度' + queueDepth: '并发排队深度', + groupAvailableAccounts: '分组可用账号数', + groupAvailableRatio: '分组可用比例 (%)', + groupRateLimitRatio: '分组限流比例 (%)', + accountRateLimitedCount: '限流账号数', + accountErrorCount: '错误账号数(不含临时不可调度)', + accountErrorRatio: '错误账号比例 (%)', + overloadAccountCount: '过载账号数' + }, + metricDescriptions: { + successRate: '统计窗口内成功请求占比(0~100)。', + errorRate: '统计窗口内失败请求占比(0~100)。', + upstreamErrorRate: '统计窗口内上游错误占比(0~100)。', + p95: '统计窗口内 P95 请求耗时(毫秒)。', + p99: '统计窗口内 P99 请求耗时(毫秒)。', + cpu: '当前实例 CPU 使用率(0~100)。', + memory: '当前实例内存使用率(0~100)。', + queueDepth: '统计窗口内并发队列排队深度(等待中的请求数)。', + groupAvailableAccounts: '指定分组中当前可用账号数量(需要 group_id 过滤)。', + groupAvailableRatio: '指定分组中可用账号占比(0~100,需要 group_id 过滤)。', + groupRateLimitRatio: '指定分组中账号被限流的比例(0~100,需要 group_id 过滤)。', + accountRateLimitedCount: '统计窗口内被限流的账号数量。', + accountErrorCount: '统计窗口内产生错误的账号数量(不含临时不可调度)。', + accountErrorRatio: '统计窗口内错误账号占比(0~100)。', + overloadAccountCount: '统计窗口内过载账号数量。' + }, + hints: { + recommended: '推荐:运算符 {operator},阈值 {threshold}{unit}', + groupRequired: '该指标为分组级别指标,必须选择分组(group_id)。', + groupOptional: '可选:通过 group_id 将规则限定到某个分组。' }, table: { name: '名称', @@ -2237,6 +2272,9 @@ export default { description: '描述', metric: '指标', operator: '运算符', + groupId: '分组(group_id)', + groupPlaceholder: '请选择分组', + allGroups: '全部分组', threshold: '阈值', severity: '级别', window: '统计窗口(分钟)', @@ -2250,6 +2288,7 @@ export default { invalid: '规则不合法', nameRequired: '名称不能为空', metricRequired: '指标不能为空', + groupIdRequired: '分组级别指标必须指定 group_id', operatorRequired: '运算符不能为空', thresholdRequired: '阈值必须为数字', windowRange: '统计窗口必须为 1 / 5 / 60 分钟之一',