可以在分组中设置一些全局配置选项

This commit is contained in:
GoEdgeLab
2021-09-22 19:39:38 +08:00
parent dd36ba5686
commit 765b030477
66 changed files with 1698 additions and 214 deletions

View File

@@ -21,18 +21,24 @@ type AddPopupAction struct {
func (this *AddPopupAction) RunGet(params struct {
ServerId int64
ServerType string
ReverseProxyId int64
OriginType string
}) {
this.Data["reverseProxyId"] = params.ReverseProxyId
this.Data["originType"] = params.OriginType
serverTypeResp, err := this.RPC().ServerRPC().FindEnabledServerType(this.AdminContext(), &pb.FindEnabledServerTypeRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)
return
var serverType = ""
if params.ServerId > 0 {
serverTypeResp, err := this.RPC().ServerRPC().FindEnabledServerType(this.AdminContext(), &pb.FindEnabledServerTypeRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)
return
}
serverType = serverTypeResp.Type
} else {
serverType = params.ServerType
}
serverType := serverTypeResp.Type
this.Data["serverType"] = serverType
// 是否为HTTP

View File

@@ -26,6 +26,7 @@ func (this *UpdatePopupAction) Init() {
func (this *UpdatePopupAction) RunGet(params struct {
ServerId int64
ServerType string
ReverseProxyId int64
OriginType string
OriginId int64
@@ -34,15 +35,20 @@ func (this *UpdatePopupAction) RunGet(params struct {
this.Data["reverseProxyId"] = params.ReverseProxyId
this.Data["originId"] = params.OriginId
serverTypeResp, err := this.RPC().ServerRPC().FindEnabledServerType(this.AdminContext(), &pb.FindEnabledServerTypeRequest{
ServerId: params.ServerId,
})
if err != nil {
this.ErrorPage(err)
return
var serverType = ""
if params.ServerId > 0 {
serverTypeResp, err := this.RPC().ServerRPC().FindEnabledServerType(this.AdminContext(), &pb.FindEnabledServerTypeRequest{
ServerId: params.ServerId,
})
if err != nil {
this.ErrorPage(err)
return
}
serverType = serverTypeResp.Type
} else {
serverType = params.ServerType
}
this.Data["serverType"] = serverTypeResp.Type
serverType := serverTypeResp.Type
this.Data["serverType"] = serverType
// 是否为HTTP
this.Data["isHTTP"] = serverType == "httpProxy" || serverType == "httpWeb"