diff --git a/internal/web/actions/default/clusters/index.go b/internal/web/actions/default/clusters/index.go index 3ac66eca..f776e8c7 100644 --- a/internal/web/actions/default/clusters/index.go +++ b/internal/web/actions/default/clusters/index.go @@ -54,6 +54,13 @@ func (this *IndexAction) RunGet(params struct{}) { return } + // 需要升级的节点 + countUpgradeNodesResp, err := this.RPC().NodeRPC().CountAllUpgradeNodesWithClusterId(this.AdminContext(), &pb.CountAllUpgradeNodesWithClusterIdRequest{ClusterId: cluster.Id}) + if err != nil { + this.ErrorPage(err) + return + } + // DNS dnsDomainName := "" if cluster.DnsDomainId > 0 { @@ -68,14 +75,15 @@ func (this *IndexAction) RunGet(params struct{}) { } clusterMaps = append(clusterMaps, maps.Map{ - "id": cluster.Id, - "name": cluster.Name, - "installDir": cluster.InstallDir, - "countAllNodes": countNodesResp.Count, - "countActiveNodes": countActiveNodesResp.Count, - "dnsDomainId": cluster.DnsDomainId, - "dnsName": cluster.DnsName, - "dnsDomainName": dnsDomainName, + "id": cluster.Id, + "name": cluster.Name, + "installDir": cluster.InstallDir, + "countAllNodes": countNodesResp.Count, + "countActiveNodes": countActiveNodesResp.Count, + "countUpgradeNodes": countUpgradeNodesResp.Count, + "dnsDomainId": cluster.DnsDomainId, + "dnsName": cluster.DnsName, + "dnsDomainName": dnsDomainName, }) } } diff --git a/web/views/@default/clusters/index.html b/web/views/@default/clusters/index.html index 3b7bb980..76832ead 100644 --- a/web/views/@default/clusters/index.html +++ b/web/views/@default/clusters/index.html @@ -7,8 +7,8 @@ 集群名称 - 节点数量 - 在线节点数量 + 节点数量 + 在线节点数量 DNS域名 操作 @@ -18,6 +18,10 @@ {{cluster.countAllNodes}} - + +
+ 有节点需要升级 +
{{cluster.countActiveNodes}}