实现路径规则部分功能

This commit is contained in:
刘祥超
2020-09-21 19:51:50 +08:00
parent 47bf305df6
commit a4b806fa7e
50 changed files with 630 additions and 114 deletions

View File

@@ -2,6 +2,7 @@ package locations
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/webutils"
)
type IndexAction struct {
@@ -16,7 +17,18 @@ func (this *IndexAction) Init() {
func (this *IndexAction) RunGet(params struct {
ServerId int64
}) {
// TODO
webConfig, err := webutils.FindWebConfigWithServerId(this.Parent(), params.ServerId)
if err != nil {
this.ErrorPage(err)
return
}
this.Data["webId"] = webConfig.Id
if webConfig.Locations != nil {
this.Data["locations"] = webConfig.Locations
} else {
this.Data["locations"] = []interface{}{}
}
this.Show()
}