可以隐藏CDN功能菜单

This commit is contained in:
刘祥超
2022-09-13 19:54:31 +08:00
parent 4a749ca345
commit bf94c2395f
5 changed files with 65 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
"github.com/iwind/TeaGo/actions"
"io"
)
@@ -37,6 +38,8 @@ func (this *IndexAction) RunGet(params struct{}) {
}
this.Data["timeZoneLocation"] = nodeconfigs.FindTimeZoneLocation(config.TimeZone)
this.filterConfig(config)
this.Show()
}
@@ -52,6 +55,9 @@ func (this *IndexAction) RunPost(params struct {
DefaultPageSize int
TimeZone string
SupportModuleCDN bool
SupportModuleNS bool
Must *actions.Must
CSRF *actionutils.CSRF
}) {
@@ -85,6 +91,14 @@ func (this *IndexAction) RunPost(params struct {
config.DefaultPageSize = 10
}
config.Modules = []userconfigs.UserModule{}
if params.SupportModuleCDN {
config.Modules = append(config.Modules, userconfigs.UserModuleCDN)
}
if params.SupportModuleNS {
config.Modules = append(config.Modules, userconfigs.UserModuleNS)
}
// 上传Favicon文件
if params.FaviconFile != nil {
createResp, err := this.RPC().FileRPC().CreateFile(this.AdminContext(), &pb.CreateFileRequest{