From fa92290162b67c7ce07d40530660e77fd35efb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 27 Nov 2020 10:41:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=9B=86=E7=BE=A4]=E6=98=BE=E7=A4=BA=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E6=9C=89=E8=8A=82=E7=82=B9=E9=9C=80=E8=A6=81=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/actions/default/clusters/index.go | 24 ++++++++++++------- web/views/@default/clusters/index.html | 8 +++++-- 2 files changed, 22 insertions(+), 10 deletions(-) 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}}