diff --git a/backend/models/collector.go b/backend/models/collector.go index a5df2b8..e26d0f2 100644 --- a/backend/models/collector.go +++ b/backend/models/collector.go @@ -66,6 +66,11 @@ func (c *Collector) Sanitized() map[string]interface{} { "cluster": cluster, "targetDeployment": c.TargetDeployment, "namespace": c.Namespace, + // 采集范围配置:必须一起输出,否则前端编辑框读不到(显示为空), + // 用户一保存就会把现有配置写空 —— 这是重构加 Sanitized() 时漏字段导致的回归。 + "targetNamespaces": c.TargetNamespaces, + "appLabelSource": c.AppLabelSource, + "appInclude": c.AppInclude, "logPath": c.LogPath, "labels": c.Labels, "status": c.Status,