From a21841768869da32468558a472517728f4ef32d0 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Thu, 17 Mar 2022 10:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/actions/default/clusters/create.go | 8 ++++++++ internal/web/actions/default/clusters/index.go | 8 ++++++++ web/views/@default/clusters/@menu.html | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/web/actions/default/clusters/create.go b/internal/web/actions/default/clusters/create.go index cbf58244..0b7805cc 100644 --- a/internal/web/actions/default/clusters/create.go +++ b/internal/web/actions/default/clusters/create.go @@ -27,6 +27,14 @@ func (this *CreateAction) RunGet(params struct{}) { } this.Data["hasDomains"] = hasDomainsResp.Exist + // 集群总数 + totalResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + this.Data["totalNodeClusters"] = totalResp.Count + this.Show() } diff --git a/internal/web/actions/default/clusters/index.go b/internal/web/actions/default/clusters/index.go index 2662db04..80786d3e 100644 --- a/internal/web/actions/default/clusters/index.go +++ b/internal/web/actions/default/clusters/index.go @@ -29,6 +29,14 @@ func (this *IndexAction) RunGet(params struct { this.Data["searchType"] = params.SearchType this.Data["isSearching"] = isSearching + // 集群总数 + totalResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + this.Data["totalNodeClusters"] = totalResp.Count + // 常用的集群 latestClusterMaps := []maps.Map{} if !isSearching { diff --git a/web/views/@default/clusters/@menu.html b/web/views/@default/clusters/@menu.html index 79b08dce..739b6ac1 100644 --- a/web/views/@default/clusters/@menu.html +++ b/web/views/@default/clusters/@menu.html @@ -1,4 +1,5 @@ - 集群列表 + 集群列表({{totalNodeClusters}}) + 创建集群