From 78ad6526b88e89e7e1478db4044557b29b9a3cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 14 Mar 2022 15:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=AD=96=E7=95=A5=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=BD=BF=E7=94=A8=E5=AD=98=E5=82=A8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/servers/components/cache/index.go | 11 ++++++++-- .../servers/components/cache/createPopup.html | 2 +- .../servers/components/cache/index.html | 22 ++++++++++++++++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/internal/web/actions/default/servers/components/cache/index.go b/internal/web/actions/default/servers/components/cache/index.go index be7100f2..058bdee4 100644 --- a/internal/web/actions/default/servers/components/cache/index.go +++ b/internal/web/actions/default/servers/components/cache/index.go @@ -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() } diff --git a/web/views/@default/servers/components/cache/createPopup.html b/web/views/@default/servers/components/cache/createPopup.html index ecb4170d..e39f30b6 100644 --- a/web/views/@default/servers/components/cache/createPopup.html +++ b/web/views/@default/servers/components/cache/createPopup.html @@ -35,7 +35,7 @@ 内存最大容量 - +

作为一级缓存的内存最大容量,如果为0表示不使用内存作为一级缓存。

diff --git a/web/views/@default/servers/components/cache/index.html b/web/views/@default/servers/components/cache/index.html index 2a102915..4a19029d 100644 --- a/web/views/@default/servers/components/cache/index.html +++ b/web/views/@default/servers/components/cache/index.html @@ -16,10 +16,16 @@
+
+ +
  - [清除条件] + [清除条件]
@@ -38,10 +44,20 @@ - {{policy.name}} + + {{policy.name}} +   + + + {{infos[index].typeName}} ({{policy.type}}) - {{policy.capacity.count}}{{policy.capacity.unit.toUpperCase()}} + + {{policy.capacity.count}}{{policy.capacity.unit.toUpperCase()}} + + (内存:{{policy.options.memoryPolicy.capacity.count}}{{policy.options.memoryPolicy.capacity.unit.toUpperCase()}}) + + 不限 {{infos[index].countClusters}}