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}}) + 创建集群