支持UDP代理

This commit is contained in:
GoEdgeLab
2021-06-07 15:43:43 +08:00
parent eb7eafe67c
commit b13f9c5dfe
11 changed files with 158 additions and 6 deletions

View File

@@ -2,6 +2,8 @@ package server
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"strconv"
)
@@ -18,5 +20,19 @@ func (this *IndexAction) RunGet(params struct {
ServerId int64
}) {
// TODO 等看板实现后,需要跳转到看板
// TCP & UDP跳转到设置
serverTypeResp, err := this.RPC().ServerRPC().FindEnabledServerType(this.AdminContext(), &pb.FindEnabledServerTypeRequest{ServerId: params.ServerId})
if err != nil {
this.ErrorPage(err)
return
}
serverType := serverTypeResp.Type
if serverType == serverconfigs.ServerTypeTCPProxy || serverType == serverconfigs.ServerTypeUDPProxy {
this.RedirectURL("/servers/server/settings?serverId=" + strconv.FormatInt(params.ServerId, 10))
return
}
// HTTP跳转到访问日志
this.RedirectURL("/servers/server/log?serverId=" + strconv.FormatInt(params.ServerId, 10))
}