mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-02 20:00:26 +08:00
看板在健康检查失败离线时提供手动上线按钮
This commit is contained in:
@@ -24,6 +24,8 @@ func InitNodeInfo(action actionutils.ActionInterface, nodeId int64) error {
|
|||||||
action.ViewData()["node"] = maps.Map{
|
action.ViewData()["node"] = maps.Map{
|
||||||
"id": node.Id,
|
"id": node.Id,
|
||||||
"name": node.Name,
|
"name": node.Name,
|
||||||
|
"isOn": node.IsOn,
|
||||||
|
"isUp": node.IsUp,
|
||||||
}
|
}
|
||||||
if node.NodeCluster != nil {
|
if node.NodeCluster != nil {
|
||||||
action.ViewData()["clusterId"] = node.NodeCluster.Id
|
action.ViewData()["clusterId"] = node.NodeCluster.Id
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
<h4>在线状态</h4>
|
<h4>在线状态</h4>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<span class="green" v-if="board.isActive">在线</span>
|
<span class="green" v-if="board.isActive">在线</span>
|
||||||
<span class="red" v-else>离线</span>
|
<span class="red" v-else-if="node.isUp">离线</span>
|
||||||
|
<span class="red" v-else style="font-size: 1.5em" title="因健康检查失败而离线">健康离线</span>
|
||||||
|
<a href="" v-if="node.isOn && !node.isUp" @click.prevent="upNode(node.id)">[上线]</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui column">
|
<div class="ui column">
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
Tea.context(function () {
|
Tea.context(function () {
|
||||||
|
this.upNode = function (nodeId) {
|
||||||
|
teaweb.confirm("确定要手动上线此节点吗?", function () {
|
||||||
|
this.$post("/clusters/cluster/node/up")
|
||||||
|
.params({
|
||||||
|
nodeId: nodeId
|
||||||
|
})
|
||||||
|
.refresh()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.formatCount = function (count) {
|
this.formatCount = function (count) {
|
||||||
if (count < 1000) {
|
if (count < 1000) {
|
||||||
return count.toString()
|
return count.toString()
|
||||||
|
|||||||
Reference in New Issue
Block a user