waf/ip名单有变更立即发送通知

This commit is contained in:
刘祥超
2020-11-10 09:22:58 +08:00
parent c0632b2fb5
commit 2936067625
9 changed files with 74 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package ipadmin
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/components/waf/ipadmin/ipadminutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
@@ -41,7 +42,8 @@ func (this *UpdateIPPopupAction) RunGet(params struct {
}
func (this *UpdateIPPopupAction) RunPost(params struct {
ItemId int64
FirewallPolicyId int64
ItemId int64
IpFrom string
IpTo string
@@ -70,5 +72,12 @@ func (this *UpdateIPPopupAction) RunPost(params struct {
return
}
// 发送通知
err = ipadminutils.NotifyUpdateToClustersWithFirewallPolicyId(this.AdminContext(), params.FirewallPolicyId)
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}