增加删除API节点功能

This commit is contained in:
GoEdgeLab
2020-10-10 20:41:33 +08:00
parent 444ca7535e
commit 32ac0d62d3
5 changed files with 39 additions and 1 deletions

View File

@@ -26,7 +26,8 @@
<label-on :v-is-on="node.isOn"></label-on>
</td>
<td>
<a :href="'/api/node/settings?nodeId=' + node.id">设置</a>
<a :href="'/api/node/settings?nodeId=' + node.id">设置</a> &nbsp;
<a href="" @click.prevent="deleteNode(node.id)">删除</a>
</td>
</tr>
</table>

View File

@@ -1,4 +1,5 @@
Tea.context(function () {
// 创建节点
this.createNode = function () {
teaweb.popup("/api/node/createPopup", {
width: "50em",
@@ -10,4 +11,16 @@ Tea.context(function () {
}
})
}
// 删除节点
this.deleteNode = function (nodeId) {
let that = this
teaweb.confirm("确定要删除此节点吗?", function () {
that.$post("/api/delete")
.params({
nodeId: nodeId
})
.refresh()
})
}
})