feat: v0.34 健康探针(Architecture B) + Agent v2.1 + 端口监控 + 告警联系人重构

- v0.31: AlertContact 重构(channel_type下拉+webhook_url替代三分立字段)
- v0.32: Agent ProcessTop 增强(cmdline/user/cpu_pct/mem_pct)
- v0.33: 端口监控 Tab(监听端口自动发现+down联动告警)
- v0.34: 健康探针(Agent本地执行HTTP/TCP/Exec→结果随心跳上报)
- Agent新增: ContextSwitch/FD/HealthProbe采集器
- 后端新增: health_probe handler + Agent model扩展
- HostMonitor新增Tab: 健康探针/端口监控
This commit is contained in:
attacker committed 2026-06-24 19:18:10 +08:00
1 parent e1f75f0bc4
commit d656520428
25 files changed
+1700 -619

No files matched your search

@@ -33,12 +33,11 @@ func (h *AlertHandler) CreateContact(c *gin.Context) {
return
}
contact := models.AlertContact{
Name: req.Name,
Phone: req.Phone,
Email: req.Email,
Dingtalk: req.Dingtalk,
Feishu: req.Feishu,
Wechat: req.Wechat,
Name: req.Name,
Phone: req.Phone,
Email: req.Email,
ChannelType: req.ChannelType,
WebhookURL: req.WebhookURL,
}
if err := h.db.Create(&contact).Error; err != nil {
c.JSON(http.StatusInternalServerError, models.Response{Code: 500, Message: "创建失败"})
@@ -64,9 +63,8 @@ func (h *AlertHandler) UpdateContact(c *gin.Context) {
if req.Name != "" { updates["name"] = req.Name }
if req.Phone != "" { updates["phone"] = req.Phone }
if req.Email != "" { updates["email"] = req.Email }
if req.Dingtalk != "" { updates["dingtalk"] = req.Dingtalk }
if req.Feishu != "" { updates["feishu"] = req.Feishu }
if req.Wechat != "" { updates["wechat"] = req.Wechat }
if req.ChannelType != "" { updates["channel_type"] = req.ChannelType }
if req.WebhookURL != "" { updates["webhook_url"] = req.WebhookURL }
h.db.Model(&contact).Updates(updates)
h.db.First(&contact, id)
c.JSON(http.StatusOK, models.Response{Code: 200, Message: "更新成功", Data: contact})