实现缓存策略的部分功能

This commit is contained in:
刘祥超
2020-10-04 14:27:05 +08:00
parent bd51284504
commit 937b07cbf6
49 changed files with 1444 additions and 189 deletions

View File

@@ -1,15 +1,30 @@
package cache
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/components/cache/cacheutils"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
)
type PolicyAction struct {
actionutils.ParentAction
}
func (this *PolicyAction) Init() {
this.Nav("", "", "")
this.Nav("", "", "index")
}
func (this *PolicyAction) RunGet(params struct{}) {
func (this *PolicyAction) RunGet(params struct {
CachePolicyId int64
}) {
cachePolicy, err := cacheutils.FindCachePolicy(this.Parent(), params.CachePolicyId)
if err != nil {
this.ErrorPage(err)
return
}
this.Data["cachePolicy"] = cachePolicy
this.Data["typeName"] = serverconfigs.FindCachePolicyTypeName(cachePolicy.Type)
this.Show()
}