From c5b0bd277ce72c3fc419b0b893a6648c076a11b6 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 18 Apr 2021 15:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9B=86=E7=BE=A4=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=8A=82=E7=82=B9=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/actions/default/clusters/cluster/index.go | 9 +++++++++ .../default/clusters/clusterutils/cluster_helper.go | 13 ++++++++----- web/public/js/components/common/not-found-box.js | 7 +++++++ web/views/@default/clusters/cluster/index.html | 9 +++++++-- 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 web/public/js/components/common/not-found-box.js diff --git a/internal/web/actions/default/clusters/cluster/index.go b/internal/web/actions/default/clusters/cluster/index.go index 679812c8..c35f91a7 100644 --- a/internal/web/actions/default/clusters/cluster/index.go +++ b/internal/web/actions/default/clusters/cluster/index.go @@ -36,6 +36,15 @@ func (this *IndexAction) RunGet(params struct { this.Data["activeState"] = params.ActiveState this.Data["keyword"] = params.Keyword + countAllResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{ + NodeClusterId: params.ClusterId, + }) + if err != nil { + this.ErrorPage(err) + return + } + this.Data["countAll"] = countAllResp.Count + countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{ NodeClusterId: params.ClusterId, GroupId: params.GroupId, diff --git a/internal/web/actions/default/clusters/clusterutils/cluster_helper.go b/internal/web/actions/default/clusters/clusterutils/cluster_helper.go index 085d8a0d..957acfec 100644 --- a/internal/web/actions/default/clusters/clusterutils/cluster_helper.go +++ b/internal/web/actions/default/clusters/clusterutils/cluster_helper.go @@ -2,6 +2,7 @@ package clusterutils import ( "encoding/json" + teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const" "github.com/TeaOSLab/EdgeAdmin/internal/rpc" "github.com/TeaOSLab/EdgeAdmin/internal/utils/numberutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" @@ -115,11 +116,13 @@ func (this *ClusterHelper) createSettingMenu(cluster *pb.NodeCluster, selectedIt "isActive": selectedItem == "dns", "isOn": cluster.DnsDomainId > 0 || len(cluster.DnsName) > 0, }) - items = append(items, maps.Map{ - "name": "消息通知", - "url": "/clusters/cluster/settings/message?clusterId=" + clusterId, - "isActive": selectedItem == "message", - }) + if teaconst.IsPlus { + items = append(items, maps.Map{ + "name": "消息通知", + "url": "/clusters/cluster/settings/message?clusterId=" + clusterId, + "isActive": selectedItem == "message", + }) + } items = append(items, maps.Map{ "name": "-", diff --git a/web/public/js/components/common/not-found-box.js b/web/public/js/components/common/not-found-box.js new file mode 100644 index 00000000..293cc353 --- /dev/null +++ b/web/public/js/components/common/not-found-box.js @@ -0,0 +1,7 @@ +Vue.component("not-found-box", { + props: ["message"], + template: `
+
+

{{message}}

+
` +}) \ No newline at end of file diff --git a/web/views/@default/clusters/cluster/index.html b/web/views/@default/clusters/cluster/index.html index 4dbb802d..1c858b74 100644 --- a/web/views/@default/clusters/cluster/index.html +++ b/web/views/@default/clusters/cluster/index.html @@ -2,7 +2,7 @@ {$template "menu"} -
+
@@ -40,7 +40,12 @@
-

暂时还没有节点。

+
+ +
+
+

暂时还没有节点。

+