增加清空节点同步任务、清空DNS同步任务功能

This commit is contained in:
GoEdgeLab
2023-07-02 17:29:00 +08:00
parent 198139446d
commit 99c930bde7
8 changed files with 81 additions and 7 deletions

View File

@@ -1,10 +1,11 @@
{$layout "layout_popup"}
<h3>正在同步的节点任务<span v-if="countTasks > 0">(共{{countTasks}}个)</span>
<a href="" v-if="countCheckedTasks() > 0" @click.prevent="deleteBatch">批量删除{{countCheckedTasks()}}个任务</a>
</h3>
<p class="comment" v-if="clusters.length == 0">暂时没有同步的集群。</p>
<h3>正在同步的节点任务<span v-if="countTasks > 0">(共{{countTasks}}个)</span></h3>
<p class="comment" v-if="clusters.length == 0">暂时没有同步的任务</p>
<div v-if="clusters.length > 0">
<button class="ui button basic tiny" @click.prevent="deleteAllTasks">清空所有任务</button> &nbsp;
<button class="ui button basic tiny" v-if="countCheckedTasks() > 0" @click.prevent="deleteBatch">批量删除{{countCheckedTasks()}}个任务</button>
<table class="ui table selectable celled">
<thead>
<tr>

View File

@@ -65,7 +65,7 @@ Tea.context(function () {
}
this.deleteBatch = function () {
var taskIds = []
let taskIds = []
this.clusters.forEach(function (cluster) {
cluster.tasks.forEach(function (task) {
if (task.isChecked) {
@@ -85,4 +85,14 @@ Tea.context(function () {
})
})
}
this.deleteAllTasks = function () {
let that = this
teaweb.confirm("确定要清空所有的任务吗?", function () {
that.$post(".deleteAll")
.success(function () {
teaweb.reload()
})
})
}
})