提交 853053f5 编写于 作者: 7 710leo

fix: alert rule put

上级 dde431b4
......@@ -47,7 +47,7 @@ func alertRuleAdd(c *gin.Context) {
bind(c, &f)
me := loginUser(c).MustPerm("alert_rule_create")
var ids []int64
for _, alertRule := range f {
arg := AlertRuleGroup(alertRule.GroupId)
alertRuleWritePermCheck(arg, me)
......@@ -74,9 +74,10 @@ func alertRuleAdd(c *gin.Context) {
UpdateBy: me.Username,
}
dangerous(ar.Add())
ids = append(ids, ar.Id)
}
renderMessage(c, nil)
renderData(c, ids, nil)
}
func alertRulePut(c *gin.Context) {
......@@ -90,6 +91,7 @@ func alertRulePut(c *gin.Context) {
ar.Name = f.Name
ar.Note = f.Note
ar.Type = f.Type
ar.Status = f.Status
ar.AlertDuration = f.AlertDuration
ar.Expression = f.Expression
......@@ -111,6 +113,7 @@ func alertRulePut(c *gin.Context) {
renderMessage(c, ar.Update(
"name",
"note",
"type",
"status",
"alert_duration",
"expression",
......
......@@ -55,7 +55,7 @@ func userGroupAdd(c *gin.Context) {
// 顺便把创建者也作为团队的一员,失败了也没关系,用户会重新添加成员
models.UserGroupMemberAdd(ug.Id, me.Id)
renderMessage(c, nil)
renderData(c, ug.Id, nil)
}
func userGroupPut(c *gin.Context) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册