2020-10-08 11:11:37 +08:00
|
|
|
package waf
|
|
|
|
|
|
|
|
|
|
import (
|
2020-11-17 15:41:43 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
2020-10-08 11:11:37 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type UpdateSetOnAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *UpdateSetOnAction) RunPost(params struct {
|
|
|
|
|
SetId int64
|
|
|
|
|
IsOn bool
|
|
|
|
|
}) {
|
2020-11-17 15:41:43 +08:00
|
|
|
// 日志
|
|
|
|
|
this.CreateLog(oplogs.LevelInfo, "修改WAF规则集 %d 开启状态", params.SetId)
|
|
|
|
|
|
2020-10-08 11:11:37 +08:00
|
|
|
_, err := this.RPC().HTTPFirewallRuleSetRPC().UpdateHTTPFirewallRuleSetIsOn(this.AdminContext(), &pb.UpdateHTTPFirewallRuleSetIsOnRequest{
|
|
|
|
|
FirewallRuleSetId: params.SetId,
|
|
|
|
|
IsOn: params.IsOn,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|