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

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

@@ -8,7 +8,7 @@ import (
"github.com/iwind/TeaGo/maps"
)
// 源站列表
// IndexAction 源站列表
type IndexAction struct {
actionutils.ParentAction
}
@@ -27,6 +27,23 @@ func (this *IndexAction) RunGet(params struct {
}
serverType := serverTypeResp.Type
// 当前是否有分组设置
groupResp, err := this.RPC().ServerGroupRPC().FindEnabledServerGroupConfigInfo(this.AdminContext(), &pb.FindEnabledServerGroupConfigInfoRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)
return
}
this.Data["hasGroupConfig"] = false
switch serverType {
case serverconfigs.ServerTypeHTTPWeb, serverconfigs.ServerTypeHTTPProxy:
this.Data["hasGroupConfig"] = groupResp.HasHTTPReverseProxy
case serverconfigs.ServerTypeTCPProxy:
this.Data["hasGroupConfig"] = groupResp.HasTCPReverseProxy
case serverconfigs.ServerTypeUDPProxy:
this.Data["hasGroupConfig"] = groupResp.HasUDPReverseProxy
}
// 当前服务的配置
reverseProxyResp, err := this.RPC().ServerRPC().FindAndInitServerReverseProxyConfig(this.AdminContext(), &pb.FindAndInitServerReverseProxyConfigRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)