mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
23 lines
539 B
Go
23 lines
539 B
Go
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()
|
|
}
|