mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	优化API命名
This commit is contained in:
		@@ -79,9 +79,9 @@ func (this *CreateBatchAction) RunPost(params struct {
 | 
			
		||||
		resp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
 | 
			
		||||
			Name:          ip,
 | 
			
		||||
			NodeClusterId: params.ClusterId,
 | 
			
		||||
			GroupId:       params.GroupId,
 | 
			
		||||
			RegionId:      params.RegionId,
 | 
			
		||||
			Login:         nil,
 | 
			
		||||
			NodeGroupId:   params.GroupId,
 | 
			
		||||
			NodeRegionId:  params.RegionId,
 | 
			
		||||
			NodeLogin:     nil,
 | 
			
		||||
		})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
@@ -133,9 +133,9 @@ func (this *CreateNodeAction) RunPost(params struct {
 | 
			
		||||
	createResp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
 | 
			
		||||
		Name:          params.Name,
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
		GroupId:       params.GroupId,
 | 
			
		||||
		RegionId:      params.RegionId,
 | 
			
		||||
		Login:         loginInfo,
 | 
			
		||||
		NodeGroupId:   params.GroupId,
 | 
			
		||||
		NodeRegionId:  params.RegionId,
 | 
			
		||||
		NodeLogin:     loginInfo,
 | 
			
		||||
		DnsDomainId:   params.DnsDomainId,
 | 
			
		||||
		DnsRoutes:     dnsRouteCodes,
 | 
			
		||||
	})
 | 
			
		||||
 
 | 
			
		||||
@@ -43,12 +43,12 @@ func (this *CreatePopupAction) RunPost(params struct {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	this.Data["group"] = maps.Map{
 | 
			
		||||
		"id":   createResp.GroupId,
 | 
			
		||||
		"id":   createResp.NodeGroupId,
 | 
			
		||||
		"name": params.Name,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 创建日志
 | 
			
		||||
	defer this.CreateLog(oplogs.LevelInfo, "创建集群分组", createResp.GroupId)
 | 
			
		||||
	defer this.CreateLog(oplogs.LevelInfo, "创建节点分组", createResp.NodeGroupId)
 | 
			
		||||
 | 
			
		||||
	this.Success()
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ func (this *DeleteAction) RunPost(params struct {
 | 
			
		||||
		this.Fail("此分组正在被使用不能删除,请修改节点后再删除")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	_, err = this.RPC().NodeGroupRPC().DeleteNodeGroup(this.AdminContext(), &pb.DeleteNodeGroupRequest{GroupId: params.GroupId})
 | 
			
		||||
	_, err = this.RPC().NodeGroupRPC().DeleteNodeGroup(this.AdminContext(), &pb.DeleteNodeGroupRequest{NodeGroupId: params.GroupId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ func (this *IndexAction) Init() {
 | 
			
		||||
func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	ClusterId int64
 | 
			
		||||
}) {
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@@ -27,7 +27,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	groupMaps := []maps.Map{}
 | 
			
		||||
	for _, group := range groupsResp.Groups {
 | 
			
		||||
	for _, group := range groupsResp.NodeGroups {
 | 
			
		||||
		countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
@@ -18,13 +18,13 @@ func (this *SelectPopupAction) Init() {
 | 
			
		||||
func (this *SelectPopupAction) RunGet(params struct {
 | 
			
		||||
	ClusterId int64
 | 
			
		||||
}) {
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	groupMaps := []maps.Map{}
 | 
			
		||||
	for _, group := range groupsResp.Groups {
 | 
			
		||||
	for _, group := range groupsResp.NodeGroups {
 | 
			
		||||
		groupMaps = append(groupMaps, maps.Map{
 | 
			
		||||
			"id":   group.Id,
 | 
			
		||||
			"name": group.Name,
 | 
			
		||||
@@ -44,12 +44,12 @@ func (this *SelectPopupAction) RunPost(params struct {
 | 
			
		||||
		this.Fail("请选择要使用的分组")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{GroupId: params.GroupId})
 | 
			
		||||
	groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{NodeGroupId: params.GroupId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	group := groupResp.Group
 | 
			
		||||
	group := groupResp.NodeGroup
 | 
			
		||||
	if group == nil {
 | 
			
		||||
		this.NotFound("nodeGroup", params.GroupId)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ type SortAction struct {
 | 
			
		||||
func (this *SortAction) RunPost(params struct {
 | 
			
		||||
	GroupIds []int64
 | 
			
		||||
}) {
 | 
			
		||||
	_, err := this.RPC().NodeGroupRPC().UpdateNodeGroupOrders(this.AdminContext(), &pb.UpdateNodeGroupOrdersRequest{GroupIds: params.GroupIds})
 | 
			
		||||
	_, err := this.RPC().NodeGroupRPC().UpdateNodeGroupOrders(this.AdminContext(), &pb.UpdateNodeGroupOrdersRequest{NodeGroupIds: params.GroupIds})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -19,12 +19,12 @@ func (this *UpdatePopupAction) Init() {
 | 
			
		||||
func (this *UpdatePopupAction) RunGet(params struct {
 | 
			
		||||
	GroupId int64
 | 
			
		||||
}) {
 | 
			
		||||
	groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{GroupId: params.GroupId})
 | 
			
		||||
	groupResp, err := this.RPC().NodeGroupRPC().FindEnabledNodeGroup(this.AdminContext(), &pb.FindEnabledNodeGroupRequest{NodeGroupId: params.GroupId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	group := groupResp.Group
 | 
			
		||||
	group := groupResp.NodeGroup
 | 
			
		||||
	if group == nil {
 | 
			
		||||
		this.NotFound("nodeGroup", params.GroupId)
 | 
			
		||||
		return
 | 
			
		||||
@@ -48,8 +48,8 @@ func (this *UpdatePopupAction) RunPost(params struct {
 | 
			
		||||
		Field("name", params.Name).
 | 
			
		||||
		Require("请输入分组名称")
 | 
			
		||||
	_, err := this.RPC().NodeGroupRPC().UpdateNodeGroup(this.AdminContext(), &pb.UpdateNodeGroupRequest{
 | 
			
		||||
		GroupId: params.GroupId,
 | 
			
		||||
		Name:    params.Name,
 | 
			
		||||
		NodeGroupId: params.GroupId,
 | 
			
		||||
		Name:        params.Name,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
@@ -47,8 +47,8 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
 | 
			
		||||
	countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
		GroupId:       params.GroupId,
 | 
			
		||||
		RegionId:      params.RegionId,
 | 
			
		||||
		NodeGroupId:   params.GroupId,
 | 
			
		||||
		NodeRegionId:  params.RegionId,
 | 
			
		||||
		InstallState:  types.Int32(params.InstalledState),
 | 
			
		||||
		ActiveState:   types.Int32(params.ActiveState),
 | 
			
		||||
		Keyword:       params.Keyword,
 | 
			
		||||
@@ -65,8 +65,8 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
		Offset:        page.Offset,
 | 
			
		||||
		Size:          page.Size,
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
		GroupId:       params.GroupId,
 | 
			
		||||
		RegionId:      params.RegionId,
 | 
			
		||||
		NodeGroupId:   params.GroupId,
 | 
			
		||||
		NodeRegionId:  params.RegionId,
 | 
			
		||||
		InstallState:  types.Int32(params.InstalledState),
 | 
			
		||||
		ActiveState:   types.Int32(params.ActiveState),
 | 
			
		||||
		Keyword:       params.Keyword,
 | 
			
		||||
@@ -104,19 +104,19 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
 | 
			
		||||
		// 分组
 | 
			
		||||
		var groupMap maps.Map = nil
 | 
			
		||||
		if node.Group != nil {
 | 
			
		||||
		if node.NodeGroup != nil {
 | 
			
		||||
			groupMap = maps.Map{
 | 
			
		||||
				"id":   node.Group.Id,
 | 
			
		||||
				"name": node.Group.Name,
 | 
			
		||||
				"id":   node.NodeGroup.Id,
 | 
			
		||||
				"name": node.NodeGroup.Name,
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 区域
 | 
			
		||||
		var regionMap maps.Map = nil
 | 
			
		||||
		if node.Region != nil {
 | 
			
		||||
		if node.NodeRegion != nil {
 | 
			
		||||
			regionMap = maps.Map{
 | 
			
		||||
				"id":   node.Region.Id,
 | 
			
		||||
				"name": node.Region.Name,
 | 
			
		||||
				"id":   node.NodeRegion.Id,
 | 
			
		||||
				"name": node.NodeRegion.Name,
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -162,14 +162,14 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
 | 
			
		||||
	// 所有分组
 | 
			
		||||
	groupMaps := []maps.Map{}
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithClusterIdRequest{
 | 
			
		||||
	groupsResp, err := this.RPC().NodeGroupRPC().FindAllEnabledNodeGroupsWithNodeClusterId(this.AdminContext(), &pb.FindAllEnabledNodeGroupsWithNodeClusterIdRequest{
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	for _, group := range groupsResp.Groups {
 | 
			
		||||
	for _, group := range groupsResp.NodeGroups {
 | 
			
		||||
		countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesWithNodeGroupId(this.AdminContext(), &pb.CountAllEnabledNodesWithNodeGroupIdRequest{NodeGroupId: group.Id})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ func (this *InstallManualAction) RunGet(params struct {
 | 
			
		||||
}) {
 | 
			
		||||
	this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "manual")
 | 
			
		||||
 | 
			
		||||
	nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ func (this *InstallRemoteAction) RunGet(params struct {
 | 
			
		||||
}) {
 | 
			
		||||
	this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "install")
 | 
			
		||||
 | 
			
		||||
	nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	nodesResp, err := this.RPC().NodeRPC().FindAllNotInstalledNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -170,19 +170,19 @@ func (this *NodeAction) RunGet(params struct {
 | 
			
		||||
 | 
			
		||||
	// 分组
 | 
			
		||||
	var groupMap maps.Map = nil
 | 
			
		||||
	if node.Group != nil {
 | 
			
		||||
	if node.NodeGroup != nil {
 | 
			
		||||
		groupMap = maps.Map{
 | 
			
		||||
			"id":   node.Group.Id,
 | 
			
		||||
			"name": node.Group.Name,
 | 
			
		||||
			"id":   node.NodeGroup.Id,
 | 
			
		||||
			"name": node.NodeGroup.Name,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 区域
 | 
			
		||||
	var regionMap maps.Map = nil
 | 
			
		||||
	if node.Region != nil {
 | 
			
		||||
	if node.NodeRegion != nil {
 | 
			
		||||
		regionMap = maps.Map{
 | 
			
		||||
			"id":   node.Region.Id,
 | 
			
		||||
			"name": node.Region.Name,
 | 
			
		||||
			"id":   node.NodeRegion.Id,
 | 
			
		||||
			"name": node.NodeRegion.Name,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -141,19 +141,19 @@ func (this *UpdateAction) RunGet(params struct {
 | 
			
		||||
 | 
			
		||||
	// 分组
 | 
			
		||||
	var groupMap maps.Map = nil
 | 
			
		||||
	if node.Group != nil {
 | 
			
		||||
	if node.NodeGroup != nil {
 | 
			
		||||
		groupMap = maps.Map{
 | 
			
		||||
			"id":   node.Group.Id,
 | 
			
		||||
			"name": node.Group.Name,
 | 
			
		||||
			"id":   node.NodeGroup.Id,
 | 
			
		||||
			"name": node.NodeGroup.Name,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 区域
 | 
			
		||||
	var regionMap maps.Map = nil
 | 
			
		||||
	if node.Region != nil {
 | 
			
		||||
	if node.NodeRegion != nil {
 | 
			
		||||
		regionMap = maps.Map{
 | 
			
		||||
			"id":   node.Region.Id,
 | 
			
		||||
			"name": node.Region.Name,
 | 
			
		||||
			"id":   node.NodeRegion.Id,
 | 
			
		||||
			"name": node.NodeRegion.Name,
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -322,11 +322,11 @@ func (this *UpdateAction) RunPost(params struct {
 | 
			
		||||
	// 保存
 | 
			
		||||
	_, err := this.RPC().NodeRPC().UpdateNode(this.AdminContext(), &pb.UpdateNodeRequest{
 | 
			
		||||
		NodeId:                 params.NodeId,
 | 
			
		||||
		GroupId:                params.GroupId,
 | 
			
		||||
		RegionId:               params.RegionId,
 | 
			
		||||
		NodeGroupId:            params.GroupId,
 | 
			
		||||
		NodeRegionId:           params.RegionId,
 | 
			
		||||
		Name:                   params.Name,
 | 
			
		||||
		NodeClusterId:          params.ClusterId,
 | 
			
		||||
		Login:                  loginInfo,
 | 
			
		||||
		NodeLogin:              loginInfo,
 | 
			
		||||
		MaxCPU:                 params.MaxCPU,
 | 
			
		||||
		IsOn:                   params.IsOn,
 | 
			
		||||
		DnsDomainId:            params.DnsDomainId,
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	// 认证
 | 
			
		||||
	var grantMap interface{} = nil
 | 
			
		||||
 | 
			
		||||
	if cluster.GrantId > 0 {
 | 
			
		||||
		grantResp, err := this.RPC().NodeGrantRPC().FindEnabledNodeGrant(this.AdminContext(), &pb.FindEnabledNodeGrantRequest{NodeGrantId: cluster.GrantId})
 | 
			
		||||
	if cluster.NodeGrantId > 0 {
 | 
			
		||||
		grantResp, err := this.RPC().NodeGrantRPC().FindEnabledNodeGrant(this.AdminContext(), &pb.FindEnabledNodeGrantRequest{NodeGrantId: cluster.NodeGrantId})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
			return
 | 
			
		||||
@@ -81,7 +81,7 @@ func (this *IndexAction) RunPost(params struct {
 | 
			
		||||
	_, err := this.RPC().NodeClusterRPC().UpdateNodeCluster(this.AdminContext(), &pb.UpdateNodeClusterRequest{
 | 
			
		||||
		NodeClusterId: params.ClusterId,
 | 
			
		||||
		Name:          params.Name,
 | 
			
		||||
		GrantId:       params.GrantId,
 | 
			
		||||
		NodeGrantId:   params.GrantId,
 | 
			
		||||
		InstallDir:    params.InstallDir,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -108,8 +108,8 @@ func (this *UpdateNodeSSHAction) RunPost(params struct {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	_, err := this.RPC().NodeRPC().UpdateNodeLogin(this.AdminContext(), &pb.UpdateNodeLoginRequest{
 | 
			
		||||
		NodeId: params.NodeId,
 | 
			
		||||
		Login:  login,
 | 
			
		||||
		NodeId:    params.NodeId,
 | 
			
		||||
		NodeLogin: login,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ func (this *UpgradeRemoteAction) RunGet(params struct {
 | 
			
		||||
	this.Data["leftMenuItems"] = LeftMenuItemsForInstall(this.AdminContext(), params.ClusterId, "upgrade")
 | 
			
		||||
 | 
			
		||||
	nodes := []maps.Map{}
 | 
			
		||||
	resp, err := this.RPC().NodeRPC().FindAllUpgradeNodesWithClusterId(this.AdminContext(), &pb.FindAllUpgradeNodesWithClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	resp, err := this.RPC().NodeRPC().FindAllUpgradeNodesWithNodeClusterId(this.AdminContext(), &pb.FindAllUpgradeNodesWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
@@ -9,20 +9,20 @@ import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// 安装升级相关的左侧菜单
 | 
			
		||||
// LeftMenuItemsForInstall 安装升级相关的左侧菜单
 | 
			
		||||
func LeftMenuItemsForInstall(ctx context.Context, clusterId int64, selectedItem string) []maps.Map {
 | 
			
		||||
	rpcClient, _ := rpc.SharedRPC()
 | 
			
		||||
	countNotInstalled := int64(0)
 | 
			
		||||
	countUpgrade := int64(0)
 | 
			
		||||
	if rpcClient != nil {
 | 
			
		||||
		{
 | 
			
		||||
			resp, err := rpcClient.NodeRPC().CountAllNotInstalledNodesWithClusterId(ctx, &pb.CountAllNotInstalledNodesWithClusterIdRequest{NodeClusterId: clusterId})
 | 
			
		||||
			resp, err := rpcClient.NodeRPC().CountAllNotInstalledNodesWithNodeClusterId(ctx, &pb.CountAllNotInstalledNodesWithNodeClusterIdRequest{NodeClusterId: clusterId})
 | 
			
		||||
			if err == nil {
 | 
			
		||||
				countNotInstalled = resp.Count
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		{
 | 
			
		||||
			resp, err := rpcClient.NodeRPC().CountAllUpgradeNodesWithClusterId(ctx, &pb.CountAllUpgradeNodesWithClusterIdRequest{NodeClusterId: clusterId})
 | 
			
		||||
			resp, err := rpcClient.NodeRPC().CountAllUpgradeNodesWithNodeClusterId(ctx, &pb.CountAllUpgradeNodesWithNodeClusterIdRequest{NodeClusterId: clusterId})
 | 
			
		||||
			if err == nil {
 | 
			
		||||
				countUpgrade = resp.Count
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user