mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
added batch restart tasks
This commit is contained in:
@@ -219,25 +219,25 @@ export const constantRouterMap = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/challenges',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: 'ChallengeList',
|
||||
icon: 'fa fa-flash'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'ChallengeList',
|
||||
component: () => import('../views/challenge/ChallengeList'),
|
||||
meta: {
|
||||
title: 'Challenges',
|
||||
icon: 'fa fa-flash'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/challenges',
|
||||
// component: Layout,
|
||||
// meta: {
|
||||
// title: 'ChallengeList',
|
||||
// icon: 'fa fa-flash'
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: '',
|
||||
// name: 'ChallengeList',
|
||||
// component: () => import('../views/challenge/ChallengeList'),
|
||||
// meta: {
|
||||
// title: 'Challenges',
|
||||
// icon: 'fa fa-flash'
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/feedback',
|
||||
component: Layout,
|
||||
|
||||
@@ -56,6 +56,16 @@
|
||||
>
|
||||
{{ $t('Cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedTasks.length > 0"
|
||||
icon="el-icon-refresh"
|
||||
class="btn-restart"
|
||||
size="small"
|
||||
type="warning"
|
||||
@click="onRestartMultipleTask"
|
||||
>
|
||||
{{ $t('Restart') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedTasks.length > 0"
|
||||
icon="el-icon-delete"
|
||||
@@ -392,6 +402,31 @@
|
||||
this.$store.dispatch('task/getTaskList')
|
||||
this.$st.sendEv('任务列表', '搜索')
|
||||
},
|
||||
onRestartMultipleTask() {
|
||||
this.$confirm(this.$t('Are you sure to restart these tasks'), this.$t('Notification'), {
|
||||
confirmButtonText: this.$t('Confirm'),
|
||||
cancelButtonText: this.$t('Cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const ids = this.selectedTasks.map(item => item._id)
|
||||
this.$store.dispatch('task/restartTaskMultiple', ids).then((resp) => {
|
||||
if (resp.data.status === 'ok') {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: this.$t('Restarted successfully')
|
||||
})
|
||||
this.$store.dispatch('task/getTaskList')
|
||||
this.$refs['table'].clearSelection()
|
||||
return
|
||||
}
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: resp.data.error
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
onRemoveMultipleTask() {
|
||||
this.$confirm(this.$t('Are you sure to delete these tasks'), this.$t('Notification'), {
|
||||
confirmButtonText: this.$t('Confirm'),
|
||||
|
||||
Reference in New Issue
Block a user