diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index dacf2c61..95406179 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -154,6 +154,7 @@ export default { saving: '保存中...', selectedCount: '(已选 {count} 个)', refresh: '刷新', + settings: '设置', notAvailable: '不可用', now: '现在', unknown: '未知', @@ -2205,13 +2206,16 @@ export default { loading: '加载中...', empty: '暂无告警规则', loadFailed: '加载告警规则失败', + saveSuccess: '警报规则保存成功', saveFailed: '保存告警规则失败', + deleteSuccess: '警报规则删除成功', deleteFailed: '删除告警规则失败', create: '新建规则', createTitle: '新建告警规则', editTitle: '编辑告警规则', deleteConfirmTitle: '确认删除该规则?', deleteConfirmMessage: '将删除该规则及其关联的告警事件,是否继续?', + manage: '预警规则', metrics: { successRate: '成功率 (%)', errorRate: '错误率 (%)', @@ -2350,6 +2354,42 @@ export default { accountHealthThresholdRange: '账号健康错误率阈值必须在 0 到 100 之间' } }, + settings: { + title: '运维监控设置', + loadFailed: '加载设置失败', + saveSuccess: '运维监控设置保存成功', + saveFailed: '保存设置失败', + dataCollection: '数据采集', + evaluationInterval: '评估间隔(秒)', + evaluationIntervalHint: '检测任务的执行频率,建议保持默认', + alertConfig: '预警配置', + enableAlert: '开启预警', + alertRecipients: '预警接收邮箱', + emailPlaceholder: '输入邮箱地址', + recipientsHint: '若为空,系统将使用第一个管理员邮箱作为默认收件人', + minSeverity: '最低级别', + reportConfig: '评估报告配置', + enableReport: '开启评估报告', + reportRecipients: '评估报告接收邮箱', + dailySummary: '每日摘要', + weeklySummary: '每周摘要', + advancedSettings: '高级设置', + dataRetention: '数据保留策略', + enableCleanup: '启用数据清理', + cleanupSchedule: '清理计划(Cron)', + cleanupScheduleHint: '例如:0 2 * * * 表示每天凌晨2点', + errorLogRetentionDays: '错误日志保留天数', + minuteMetricsRetentionDays: '分钟指标保留天数', + hourlyMetricsRetentionDays: '小时指标保留天数', + retentionDaysHint: '建议保留7-90天,过长会占用存储空间', + aggregation: '预聚合任务', + enableAggregation: '启用预聚合任务', + aggregationHint: '预聚合可提升长时间窗口查询性能', + validation: { + title: '请先修正以下问题', + retentionDaysRange: '保留天数必须在1-365天之间' + } + }, concurrency: { title: '并发 / 排队', byPlatform: '按平台', @@ -2383,10 +2423,12 @@ export default { accountError: '异常' }, tooltips: { + totalRequests: '当前时间窗口内的总请求数和Token消耗量。', throughputTrend: '当前窗口内的请求/QPS 与 token/TPS 趋势。', latencyHistogram: '成功请求的延迟分布(毫秒)。', errorTrend: '错误趋势(SLA 口径排除业务限制;上游错误率排除 429/529)。', errorDistribution: '按状态码统计的错误分布。', + upstreamErrors: '上游服务返回的错误,包括API提供商的错误响应(排除429/529限流错误)。', goroutines: 'Go 运行时的协程数量(轻量级线程)。没有绝对“安全值”,建议以历史基线为准。经验参考:<2000 常见;2000-8000 需关注;>8000 且伴随队列/延迟上升时,优先排查阻塞/泄漏。', cpu: 'CPU 使用率,显示系统处理器的负载情况。', diff --git a/frontend/src/views/admin/ops/components/OpsAlertRulesCard.vue b/frontend/src/views/admin/ops/components/OpsAlertRulesCard.vue index 6bf1dcae..edf8c40c 100644 --- a/frontend/src/views/admin/ops/components/OpsAlertRulesCard.vue +++ b/frontend/src/views/admin/ops/components/OpsAlertRulesCard.vue @@ -136,7 +136,7 @@ async function save() { draft.value = null editingId.value = null await load() - appStore.showSuccess(t('common.success')) + appStore.showSuccess(t('admin.ops.alertRules.saveSuccess')) } catch (err: any) { console.error('[OpsAlertRulesCard] Failed to save rule', err) appStore.showError(err?.response?.data?.detail || t('admin.ops.alertRules.saveFailed')) @@ -160,7 +160,7 @@ async function confirmDelete() { showDeleteConfirm.value = false pendingDelete.value = null await load() - appStore.showSuccess(t('common.success')) + appStore.showSuccess(t('admin.ops.alertRules.deleteSuccess')) } catch (err: any) { console.error('[OpsAlertRulesCard] Failed to delete rule', err) appStore.showError(err?.response?.data?.detail || t('admin.ops.alertRules.deleteFailed')) diff --git a/frontend/src/views/admin/ops/components/OpsSettingsDialog.vue b/frontend/src/views/admin/ops/components/OpsSettingsDialog.vue new file mode 100644 index 00000000..968c5081 --- /dev/null +++ b/frontend/src/views/admin/ops/components/OpsSettingsDialog.vue @@ -0,0 +1,395 @@ + + +