From f8420c758a84f8caf38054f7436e223f71b8ffb2 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 29 Aug 2021 16:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=80=89=E6=8B=A9=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E6=97=B6=E5=8F=AF=E4=BB=A5=E6=A0=B9=E6=8D=AE=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/actions/default/clusters/selectPopup.go | 13 ++++++++++--- .../js/components/cluster/node-clusters-selector.js | 4 ++-- web/views/@default/clusters/selectPopup.html | 11 +++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/internal/web/actions/default/clusters/selectPopup.go b/internal/web/actions/default/clusters/selectPopup.go index 970ed9a5..8c1243ce 100644 --- a/internal/web/actions/default/clusters/selectPopup.go +++ b/internal/web/actions/default/clusters/selectPopup.go @@ -20,21 +20,28 @@ func (this *SelectPopupAction) Init() { func (this *SelectPopupAction) RunGet(params struct { SelectedClusterIds string + Keyword string }) { + this.Data["keyword"] = params.Keyword + var selectedIds = utils.SplitNumbers(params.SelectedClusterIds) - countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{}) + countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{ + Keyword: params.Keyword, + }) if err != nil { this.ErrorPage(err) return } var count = countResp.Count var page = this.NewPage(count) + page.Size = 6 this.Data["page"] = page.AsHTML() clustersResp, err := this.RPC().NodeClusterRPC().ListEnabledNodeClusters(this.AdminContext(), &pb.ListEnabledNodeClustersRequest{ - Offset: page.Offset, - Size: page.Size, + Keyword: params.Keyword, + Offset: page.Offset, + Size: page.Size, }) if err != nil { this.ErrorPage(err) diff --git a/web/public/js/components/cluster/node-clusters-selector.js b/web/public/js/components/cluster/node-clusters-selector.js index d4e4845c..6acb17f1 100644 --- a/web/public/js/components/cluster/node-clusters-selector.js +++ b/web/public/js/components/cluster/node-clusters-selector.js @@ -24,7 +24,7 @@ Vue.component("node-clusters-selector", { let that = this let selectedClusterIds = [this.primaryClusterId].concat(this.secondaryClusterIds) teaweb.popup("/clusters/selectPopup?selectedClusterIds=" + selectedClusterIds.join(",") + "&mode=single", { - height: "38em", + height: "30em", width: "50em", callback: function (resp) { if (resp.data.cluster != null) { @@ -44,7 +44,7 @@ Vue.component("node-clusters-selector", { let that = this let selectedClusterIds = [this.primaryClusterId].concat(this.secondaryClusterIds) teaweb.popup("/clusters/selectPopup?selectedClusterIds=" + selectedClusterIds.join(",") + "&mode=multiple", { - height: "38em", + height: "30em", width: "50em", callback: function (resp) { if (resp.data.cluster != null) { diff --git a/web/views/@default/clusters/selectPopup.html b/web/views/@default/clusters/selectPopup.html index 1f0c7941..ca7e6a90 100644 --- a/web/views/@default/clusters/selectPopup.html +++ b/web/views/@default/clusters/selectPopup.html @@ -2,6 +2,17 @@

选择集群

+
+
+
+ +
+
+ +
+
+
+