mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-16 21:50:24 +08:00
集群可以设置默认的WAF策略、缓存策略
This commit is contained in:
22
internal/web/actions/default/servers/components/cache/count.go
vendored
Normal file
22
internal/web/actions/default/servers/components/cache/count.go
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
// 计算可用缓存策略数量
|
||||
type CountAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *CountAction) RunPost(params struct{}) {
|
||||
countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
this.Data["count"] = countResp.Count
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user