feat: add webhook notification service and refactor data management
## Backend Changes - Add WebhookService for sending alert notifications via HTTP webhooks - Implement HMAC-SHA256 signature for webhook payload authentication - Add webhook configuration API endpoints and settings - Integrate webhook calls into OpsAlertEvaluatorService - Fix routes/common.go string conversion (use strconv.Itoa) - Add comprehensive webhook service tests ## Frontend Changes - Add webhook notification configuration UI in OpsSettingsDialog - Add WebhookNotificationConfig types and API functions - Add i18n translations for webhook features (zh/en) - Refactor DataManagementView.vue into modular components: - PostgresProfilesCard.vue (356 lines) - RedisProfilesCard.vue (331 lines) - S3ProfilesCard.vue (363 lines) - BackupJobsCard.vue (216 lines) - DataManagementView.vue (94 lines) - Add OpsSettingsDialog component tests ## Testing - All backend tests pass - All frontend tests pass - Webhook service tests cover signature, HTTP, timeout, error handling
This commit is contained in:
@@ -4212,6 +4212,34 @@ export default {
|
||||
accountHealthThresholdRange: '账号健康错误率阈值必须在 0 到 100 之间'
|
||||
}
|
||||
},
|
||||
webhookNotification: {
|
||||
title: 'Webhook 通知配置',
|
||||
description: '配置告警 Webhook 通知,支持集成企业 IM(钉钉、飞书、企业微信等)。',
|
||||
loading: '加载中...',
|
||||
loadFailed: '加载 Webhook 配置失败',
|
||||
saveSuccess: 'Webhook 配置已保存',
|
||||
saveFailed: '保存 Webhook 配置失败',
|
||||
alertTitle: '告警 Webhook',
|
||||
reportTitle: '报告 Webhook',
|
||||
urls: 'Webhook URL',
|
||||
urlsHint: '每行一个 URL,支持多个 Webhook',
|
||||
secret: '签名密钥',
|
||||
secretHint: '可选,用于生成 HMAC-SHA256 签名',
|
||||
minSeverity: '最低级别',
|
||||
minSeverityAll: '全部级别',
|
||||
timeoutSeconds: '超时时间(秒)',
|
||||
includeResolved: '包含恢复通知',
|
||||
rateLimitPerHour: '每小时限额',
|
||||
dailyReport: '每日报告',
|
||||
validation: {
|
||||
title: '请先修正以下问题',
|
||||
invalid: 'Webhook 配置不合法',
|
||||
urlsRequired: '已启用 Webhook,但未配置任何 URL',
|
||||
invalidUrls: '存在不合法的 URL',
|
||||
timeoutRange: '超时时间必须在 1 到 60 秒之间',
|
||||
rateLimitRange: '每小时限额必须为 ≥ 0 的数字'
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
title: '运维监控设置',
|
||||
loadFailed: '加载设置失败',
|
||||
|
||||
Reference in New Issue
Block a user