缓存策略可以使用存储类型筛选

This commit is contained in:
GoEdgeLab
2022-03-14 15:42:10 +08:00
parent f0541994bf
commit da5fbcca49
3 changed files with 29 additions and 6 deletions

View File

@@ -17,15 +17,18 @@ func (this *IndexAction) Init() {
}
func (this *IndexAction) RunGet(params struct {
ClusterId int64
Keyword string
ClusterId int64
Keyword string
StorageType string
}) {
this.Data["keyword"] = params.Keyword
this.Data["clusterId"] = params.ClusterId
this.Data["storageType"] = params.StorageType
countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{
NodeClusterId: params.ClusterId,
Keyword: params.Keyword,
Type: params.StorageType,
})
if err != nil {
this.ErrorPage(err)
@@ -38,6 +41,7 @@ func (this *IndexAction) RunGet(params struct {
listResp, err := this.RPC().HTTPCachePolicyRPC().ListEnabledHTTPCachePolicies(this.AdminContext(), &pb.ListEnabledHTTPCachePoliciesRequest{
Keyword: params.Keyword,
NodeClusterId: params.ClusterId,
Type: params.StorageType,
Offset: page.Offset,
Size: page.Size,
})
@@ -70,5 +74,8 @@ func (this *IndexAction) RunGet(params struct {
}
this.Data["infos"] = infos
// 所有的存储类型
this.Data["storageTypes"] = serverconfigs.AllCachePolicyStorageTypes
this.Show()
}