mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-30 18:00:56 +01:00
定时任务优化: 加入启用/禁用
This commit is contained in:
@@ -21,7 +21,12 @@ const actions = {
|
||||
getScheduleList ({ state, commit }) {
|
||||
request.get('/schedules')
|
||||
.then(response => {
|
||||
commit('SET_SCHEDULE_LIST', response.data.data)
|
||||
commit('SET_SCHEDULE_LIST', response.data.data.map(d => {
|
||||
const arr = d.cron.split(' ')
|
||||
arr.splice(0, 1)
|
||||
d.cron = arr.join(' ')
|
||||
return d
|
||||
}))
|
||||
})
|
||||
},
|
||||
addSchedule ({ state }) {
|
||||
@@ -33,11 +38,11 @@ const actions = {
|
||||
removeSchedule ({ state }, id) {
|
||||
request.delete(`/schedules/${id}`)
|
||||
},
|
||||
stopSchedule ({ state, dispatch }, id) {
|
||||
return request.post(`/schedules/${id}/stop`)
|
||||
enableSchedule ({ state, dispatch }, id) {
|
||||
return request.post(`/schedules/${id}/enable`)
|
||||
},
|
||||
runSchedule ({ state, dispatch }, id) {
|
||||
return request.post(`/schedules/${id}/run`)
|
||||
disableSchedule ({ state, dispatch }, id) {
|
||||
return request.post(`/schedules/${id}/disable`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user