diff --git a/internal/web/actions/default/servers/components/cache/index.go b/internal/web/actions/default/servers/components/cache/index.go
index d0480839..7086ee06 100644
--- a/internal/web/actions/default/servers/components/cache/index.go
+++ b/internal/web/actions/default/servers/components/cache/index.go
@@ -16,8 +16,14 @@ func (this *IndexAction) Init() {
this.FirstMenu("index")
}
-func (this *IndexAction) RunGet(params struct{}) {
- countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{})
+func (this *IndexAction) RunGet(params struct {
+ Keyword string
+}) {
+ this.Data["keyword"] = params.Keyword
+
+ countResp, err := this.RPC().HTTPCachePolicyRPC().CountAllEnabledHTTPCachePolicies(this.AdminContext(), &pb.CountAllEnabledHTTPCachePoliciesRequest{
+ Keyword: params.Keyword,
+ })
if err != nil {
this.ErrorPage(err)
return
@@ -27,8 +33,9 @@ func (this *IndexAction) RunGet(params struct{}) {
this.Data["page"] = page.AsHTML()
listResp, err := this.RPC().HTTPCachePolicyRPC().ListEnabledHTTPCachePolicies(this.AdminContext(), &pb.ListEnabledHTTPCachePoliciesRequest{
- Offset: page.Offset,
- Size: page.Size,
+ Keyword: params.Keyword,
+ Offset: page.Offset,
+ Size: page.Size,
})
if err != nil {
this.ErrorPage(err)
diff --git a/web/public/js/components/common/keyword.js b/web/public/js/components/common/keyword.js
index 34a2d3b8..84fd3b81 100644
--- a/web/public/js/components/common/keyword.js
+++ b/web/public/js/components/common/keyword.js
@@ -9,7 +9,7 @@ Vue.component("keyword", {
let slot = this.$slots["default"][0]
let text = slot.text
if (word.length > 0) {
- text = text.replace(new RegExp(word, "g"), "" + word + "")
+ text = text.replace(new RegExp(word, "g"), "" + word + "")
}
return {
diff --git a/web/views/@default/servers/components/cache/index.html b/web/views/@default/servers/components/cache/index.html
index 2e80202f..9c0c06fd 100644
--- a/web/views/@default/servers/components/cache/index.html
+++ b/web/views/@default/servers/components/cache/index.html
@@ -1,36 +1,49 @@
{$layout}
-
暂时还没有缓存策略。
-| 策略名称 | -策略类型 | -容量 | -集群数 | -状态 | -操作 | -
|---|---|---|---|---|---|
| {{policy.name}} | -{{infos[index].typeName}} ({{policy.type}}) | -- {{policy.capacity.count}}{{policy.capacity.unit.toUpperCase()}} - 不限 - | -{{infos[index].countClusters}} | -- 详情 删除 - | -
暂时还没有缓存策略。
+| 策略名称 | +策略类型 | +容量 | +集群数 | +状态 | +操作 | +
|---|---|---|---|---|---|
| {{infos[index].typeName}} ({{policy.type}}) | ++ {{policy.capacity.count}}{{policy.capacity.unit.toUpperCase()}} + 不限 + | +{{infos[index].countClusters}} | ++ 详情 删除 + | +