diff --git a/internal/web/actions/default/servers/components/cache/purge.go b/internal/web/actions/default/servers/components/cache/purge.go index 809d1dff..191cdbe0 100644 --- a/internal/web/actions/default/servers/components/cache/purge.go +++ b/internal/web/actions/default/servers/components/cache/purge.go @@ -12,7 +12,7 @@ import ( "github.com/iwind/TeaGo/types" "net/http" "strconv" - strings "strings" + "strings" ) type PurgeAction struct { @@ -53,6 +53,7 @@ func (this *PurgeAction) RunGet(params struct { func (this *PurgeAction) RunPost(params struct { CachePolicyId int64 ClusterId int64 + Type string Keys string Must *actions.Must }) { @@ -96,6 +97,11 @@ func (this *PurgeAction) RunPost(params struct { CachePolicyJSON: cachePolicyJSON, Keys: realKeys, } + if params.Type == "prefix" { + msg.Type = messageconfigs.PurgeCacheMessageTypeDir + } else { + msg.Type = messageconfigs.PurgeCacheMessageTypeFile + } results, err := nodeutils.SendMessageToCluster(this.AdminContext(), params.ClusterId, messageconfigs.MessageCodePurgeCache, msg, 10) if err != nil { this.ErrorPage(err) diff --git a/web/views/@default/servers/components/cache/purge.html b/web/views/@default/servers/components/cache/purge.html index cb73632f..8e81a48b 100644 --- a/web/views/@default/servers/components/cache/purge.html +++ b/web/views/@default/servers/components/cache/purge.html @@ -1,37 +1,47 @@ {$layout} +{$template "policy_menu"} - {$template "policy_menu"} +
可以批量删除一组Key。
- \ No newline at end of file +可以批量删除一组Key。
+ \ No newline at end of file diff --git a/web/views/@default/servers/components/cache/purge.js b/web/views/@default/servers/components/cache/purge.js index 45555f9e..a267998d 100644 --- a/web/views/@default/servers/components/cache/purge.js +++ b/web/views/@default/servers/components/cache/purge.js @@ -31,4 +31,9 @@ Tea.context(function () { this.done = function () { this.isRequesting = false } -}); \ No newline at end of file + + /** + * 操作类型 + */ + this.type = "key" // key | prefix +}) \ No newline at end of file