From 59aaaf7570338db1a1840740798a1feee2ecc4d2 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 29 Aug 2021 16:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=9C=A8=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=A4=B1=E8=B4=A5=E7=A6=BB=E7=BA=BF=E6=97=B6?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=89=8B=E5=8A=A8=E4=B8=8A=E7=BA=BF=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/clusters/cluster/node/nodeutils/utils.go | 2 ++ .../@default/clusters/cluster/node/boards/index.html | 4 +++- .../@default/clusters/cluster/node/boards/index.js | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go index d5439b17..5e296181 100644 --- a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go +++ b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go @@ -24,6 +24,8 @@ func InitNodeInfo(action actionutils.ActionInterface, nodeId int64) error { action.ViewData()["node"] = maps.Map{ "id": node.Id, "name": node.Name, + "isOn": node.IsOn, + "isUp": node.IsUp, } if node.NodeCluster != nil { action.ViewData()["clusterId"] = node.NodeCluster.Id diff --git a/web/views/@default/clusters/cluster/node/boards/index.html b/web/views/@default/clusters/cluster/node/boards/index.html index 471a0b94..e4a71c6d 100644 --- a/web/views/@default/clusters/cluster/node/boards/index.html +++ b/web/views/@default/clusters/cluster/node/boards/index.html @@ -8,7 +8,9 @@

在线状态

在线 - 离线 + 离线 + 健康离线 + [上线]
diff --git a/web/views/@default/clusters/cluster/node/boards/index.js b/web/views/@default/clusters/cluster/node/boards/index.js index 288255d5..9bf60d45 100644 --- a/web/views/@default/clusters/cluster/node/boards/index.js +++ b/web/views/@default/clusters/cluster/node/boards/index.js @@ -1,4 +1,14 @@ Tea.context(function () { + this.upNode = function (nodeId) { + teaweb.confirm("确定要手动上线此节点吗?", function () { + this.$post("/clusters/cluster/node/up") + .params({ + nodeId: nodeId + }) + .refresh() + }) + } + this.formatCount = function (count) { if (count < 1000) { return count.toString()