feat(alerts): 飞书通知支持 Web 界面配置(数据库存储+热更新)
1. 新增 notification_config 模型,飞书配置存数据库(单行id=1) 2. feishu_service 改为从数据库读配置,支持热更新,Web保存即生效 3. alerts.py 新增接口: - GET /alerts/notify/feishu/config 读配置(secret只返回是否已设) - PUT /alerts/notify/feishu/config 保存配置+热更新 (status/test 同步改为走数据库配置) 4. 前端告警中心增加「飞书通知设置」弹窗: - 开关/Webhook/签名密钥/最低级别/类型白名单 - 保存配置、发送测试按钮 5. alert_service.create_alert 推送时按数据库配置判断 配置无需改文件/重启,前端界面直接保存即生效。
This commit is contained in:
@@ -131,6 +131,19 @@ export const alertApi = {
|
||||
},
|
||||
removeFromWhitelist(id) {
|
||||
return api.delete(`/alerts/whitelist/macs/${id}`)
|
||||
},
|
||||
// 飞书通知配置
|
||||
getFeishuConfig() {
|
||||
return api.get('/alerts/notify/feishu/config')
|
||||
},
|
||||
saveFeishuConfig(data) {
|
||||
return api.put('/alerts/notify/feishu/config', {}, { params: data })
|
||||
},
|
||||
getFeishuStatus() {
|
||||
return api.get('/alerts/notify/feishu/status')
|
||||
},
|
||||
testFeishu() {
|
||||
return api.post('/alerts/notify/feishu/test')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user