From 4c22284ca7e29bbc18c2dd6140ab0d4b25216af3 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Wed, 23 Mar 2022 14:48:28 +0800 Subject: [PATCH] add cluster field when import builtin alerts --- src/webapi/router/router_builtin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/webapi/router/router_builtin.go b/src/webapi/router/router_builtin.go index 68b184e7..7b435acf 100644 --- a/src/webapi/router/router_builtin.go +++ b/src/webapi/router/router_builtin.go @@ -38,7 +38,8 @@ func alertRuleBuiltinList(c *gin.Context) { } type alertRuleBuiltinImportForm struct { - Name string `json:"name" binding:"required"` + Name string `json:"name" binding:"required"` + Cluster string `json:"cluster" binding:"required"` } func alertRuleBuiltinImport(c *gin.Context) { @@ -70,6 +71,7 @@ func alertRuleBuiltinImport(c *gin.Context) { reterr := make(map[string]string) for i := 0; i < count; i++ { lst[i].Id = 0 + lst[i].Cluster = f.Cluster lst[i].GroupId = bgid lst[i].CreateBy = username lst[i].UpdateBy = username