实现路径规则部分功能

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

@@ -53,7 +53,7 @@ func (this *CreatePopupAction) RunPost(params struct {
}
pageConfig := &serverconfigs.HTTPPageConfig{}
err = json.Unmarshal(configResp.Config, pageConfig)
err = json.Unmarshal(configResp.PageJSON, pageConfig)
if err != nil {
this.ErrorPage(err)
return

View File

@@ -1,10 +1,9 @@
package pages
import (
"encoding/json"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/webutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/actions"
)
@@ -20,13 +19,7 @@ func (this *IndexAction) Init() {
func (this *IndexAction) RunGet(params struct {
ServerId int64
}) {
webResp, err := this.RPC().ServerRPC().FindAndInitServerWebConfig(this.AdminContext(), &pb.FindAndInitServerWebRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)
return
}
webConfig := &serverconfigs.HTTPWebConfig{}
err = json.Unmarshal(webResp.Config, webConfig)
webConfig, err := webutils.FindWebConfigWithServerId(this.Parent(), params.ServerId)
if err != nil {
this.ErrorPage(err)
return

View File

@@ -27,7 +27,7 @@ func (this *UpdatePopupAction) RunGet(params struct {
}
pageConfig := &serverconfigs.HTTPPageConfig{}
err = json.Unmarshal(configResp.Config, pageConfig)
err = json.Unmarshal(configResp.PageJSON, pageConfig)
if err != nil {
this.ErrorPage(err)
return
@@ -71,7 +71,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
}
pageConfig := &serverconfigs.HTTPPageConfig{}
err = json.Unmarshal(configResp.Config, pageConfig)
err = json.Unmarshal(configResp.PageJSON, pageConfig)
if err != nil {
this.ErrorPage(err)
return