mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-04-28 16:15:18 +08:00
[边缘节点]可以同时通过关键词搜索集群和节点
This commit is contained in:
@@ -162,12 +162,16 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dnsDomainId := int64(clusterDNS.DnsDomainId)
|
||||
|
||||
dnsDomainId := int64(0)
|
||||
domainRoutes := []*dnsclients.Route{}
|
||||
if clusterDNS.DnsDomainId > 0 {
|
||||
domainRoutes, err = models.SharedDNSDomainDAO.FindDomainRoutes(dnsDomainId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if clusterDNS != nil {
|
||||
dnsDomainId = int64(clusterDNS.DnsDomainId)
|
||||
if clusterDNS.DnsDomainId > 0 {
|
||||
domainRoutes, err = models.SharedDNSDomainDAO.FindDomainRoutes(dnsDomainId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +289,6 @@ func (this *NodeService) FindAllEnabledNodesWithClusterId(ctx context.Context, r
|
||||
// TODO 检查权限
|
||||
}
|
||||
|
||||
|
||||
nodes, err := models.SharedNodeDAO.FindAllEnabledNodesWithClusterId(req.NodeClusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -221,7 +221,7 @@ func (this *NodeClusterService) CountAllEnabledNodeClusters(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
count, err := models.SharedNodeClusterDAO.CountAllEnabledClusters()
|
||||
count, err := models.SharedNodeClusterDAO.CountAllEnabledClusters(req.Keyword)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -236,7 +236,7 @@ func (this *NodeClusterService) ListEnabledNodeClusters(ctx context.Context, req
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clusters, err := models.SharedNodeClusterDAO.ListEnabledClusters(req.Offset, req.Size)
|
||||
clusters, err := models.SharedNodeClusterDAO.ListEnabledClusters(req.Keyword, req.Offset, req.Size)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
type ServerService struct {
|
||||
@@ -454,7 +455,7 @@ func (this *ServerService) CountAllEnabledServersMatch(ctx context.Context, req
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
count, err := models.SharedServerDAO.CountAllEnabledServersMatch(req.GroupId, req.Keyword, req.UserId, req.ClusterId, req.AuditingFlag)
|
||||
count, err := models.SharedServerDAO.CountAllEnabledServersMatch(req.GroupId, req.Keyword, req.UserId, req.ClusterId, types.Int8(req.AuditingFlag))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package services
|
||||
import (
|
||||
"context"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/rpc"
|
||||
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
timeutil "github.com/iwind/TeaGo/utils/time"
|
||||
"time"
|
||||
@@ -283,7 +283,7 @@ func (this *UserService) ComposeUserDashboard(ctx context.Context, req *pb.Compo
|
||||
}
|
||||
|
||||
// 网站数量
|
||||
countServers, err := models.SharedServerDAO.CountAllEnabledServersMatch(0, "", req.UserId, 0, rpc.BoolFlagNone)
|
||||
countServers, err := models.SharedServerDAO.CountAllEnabledServersMatch(0, "", req.UserId, 0, configutils.BoolStateAll)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user