feat(alert-center): 添加飞书Webhook通知渠道 + 告警引擎实时通知
- 后端: NotifyChannel 模型新增 feishu 类型, FeishuWebhookConfig - 后端: TestNotifyChannel 真实发送飞书测试消息(文本格式) - 后端: 告警引擎触发/恢复时自动发送飞书通知(sendFeishuAlert/sendFeishuRecovery) - 后端: AlertEngine 新增 tcp_time_wait/tcp_close_wait/service_process 指标检测 - 后端: NetworkStatModel 新增 TCPCloseWait 字段 - 后端: QuickSetupRules 一键创建6条告警规则(CPU/内存/磁盘/TIME_WAIT/CLOSE_WAIT/进程) - 后端: 注册 /alerts/quick-setup 路由 - 前端: AlertChannelDialog 新增飞书类型选项 - 前端: helpers 新增 getChannelIcon/getChannelTypeLabel 支持 feishu/dingtalk/wechat
This commit is contained in:
1 parent
7bc5169e8f
commit
5333f6f04a
30 files changed
+2406
-1001
No files matched your search
@@ -398,14 +398,36 @@ type AcknowledgeAlertRequest struct {
|
||||
// CreateNotifyChannelRequest 创建通知渠道请求
|
||||
type CreateNotifyChannelRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type string `json:"type" binding:"required,oneof=email sms webhook dingtalk wechat"`
|
||||
Type string `json:"type" binding:"required,oneof=email sms webhook dingtalk wechat feishu"`
|
||||
Config string `json:"config"`
|
||||
}
|
||||
|
||||
// UpdateNotifyChannelRequest 更新通知渠道请求
|
||||
type UpdateNotifyChannelRequest struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type" binding:"omitempty,oneof=email sms webhook dingtalk wechat"`
|
||||
Type string `json:"type" binding:"omitempty,oneof=email sms webhook dingtalk wechat feishu"`
|
||||
Config string `json:"config"`
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
|
||||
// FeishuWebhookConfig 飞书 Webhook 配置
|
||||
type FeishuWebhookConfig struct {
|
||||
URL string `json:"url"` // 飞书机器人 webhook 地址
|
||||
Secret string `json:"secret"` // 可选:签名密钥
|
||||
}
|
||||
|
||||
// FeishuCardMessage 飞书卡片消息
|
||||
type FeishuCardMessage struct {
|
||||
MsgType string `json:"msg_type"`
|
||||
Content FeishuCardContent `json:"content"`
|
||||
}
|
||||
|
||||
type FeishuCardContent struct {
|
||||
Title string `json:"title"`
|
||||
Content [][]FeishuCardElement `json:"content"`
|
||||
}
|
||||
|
||||
type FeishuCardElement struct {
|
||||
Tag string `json:"tag"`
|
||||
Text string `json:"text,omitempty"`
|
||||
}
|
||||
Reference in new issue
Block a user