实现删除集群

This commit is contained in:
刘祥超
2020-10-25 16:22:36 +08:00
parent a6e2453aa8
commit 93b6171604
7 changed files with 56 additions and 4 deletions

View File

@@ -5,6 +5,6 @@
<form class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="clusterId" :value="clusterId"/>
<health-check-config-box :v-health-check-config="healthCheckConfig"></health-check-config-box>
<submit-btn></submit-btn> &nbsp; <a href="" @click.prevent="run()">立即检查</a>
<submit-btn></submit-btn> &nbsp; <a href="" @click.prevent="run()" v-if="healthCheckConfig != null && healthCheckConfig.isOn">立即检查</a>
</form>
</div>

View File

@@ -28,7 +28,8 @@
<span v-else class="disabled">N</span>
</td>
<td>
<a :href="'/clusters/cluster?clusterId=' + cluster.id">详情</a>
<a :href="'/clusters/cluster?clusterId=' + cluster.id">详情</a> &nbsp;
<a href="" @click.prevent="deleteCluster(cluster.id)">删除</a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,12 @@
Tea.context(function () {
this.deleteCluster = function (clusterId) {
let that = this
teaweb.confirm("确定要删除此集群吗?", function () {
that.$post("/clusters/delete")
.params({
clusterId: clusterId
})
.refresh()
})
}
})