mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-02-15 20:15:37 +08:00
实现远程卸载节点功能
This commit is contained in:
@@ -321,8 +321,12 @@
|
||||
<tr>
|
||||
<td>已安装</td>
|
||||
<td>
|
||||
<span v-if="node.isInstalled" class="green">已安装</span>
|
||||
<span v-if="node.isInstalled" class="green">已安装 <a href="" @click.prevent="showMoreOps"><span class="small">[操作]</span></a></span>
|
||||
<a v-else :href="'/clusters/cluster/installNode?clusterId=' + clusterId + '&nodeId=' + nodeId" class="underline" title="点击进入安装界面"><span class="red">未安装</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="moreOpsVisible && node.isInstalled">
|
||||
<td>操作</td>
|
||||
<td><a href="" @click.prevent="uninstallNode">[卸载]</a> </td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -36,4 +36,24 @@ Tea.context(function () {
|
||||
this.round = function (f) {
|
||||
return Math.round(f * 100) / 100
|
||||
}
|
||||
|
||||
this.moreOpsVisible = false
|
||||
this.showMoreOps = function () {
|
||||
this.moreOpsVisible = !this.moreOpsVisible
|
||||
}
|
||||
|
||||
this.uninstallNode = function () {
|
||||
let that = this
|
||||
teaweb.confirm("html:确定要卸载当前节点吗?<br/>此操作将会删除节点上除缓存以外的相关文件。", function () {
|
||||
that.$post("/clusters/cluster/node/uninstall")
|
||||
.params({
|
||||
nodeId: that.node.id
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("执行成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user