mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
changed the way how task is saved to database
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import request from '../../api/request'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
const state = {
|
||||
// NodeList
|
||||
@@ -69,10 +68,8 @@ const actions = {
|
||||
return request.get(`/nodes/${id}/get_deploys`)
|
||||
.then(response => {
|
||||
commit('deploy/SET_DEPLOY_LIST',
|
||||
response.data.items.map(d => {
|
||||
if (d.finish_ts) d.finish_ts = dayjs(d.finish_ts.$date).format('YYYY-MM-DD HH:mm:ss')
|
||||
return d
|
||||
}).sort((a, b) => a.finish_ts < b.finish_ts ? 1 : -1),
|
||||
response.data.items.map(d => d)
|
||||
.sort((a, b) => a.finish_ts < b.finish_ts ? 1 : -1),
|
||||
{ root: true })
|
||||
})
|
||||
},
|
||||
@@ -80,11 +77,8 @@ const actions = {
|
||||
return request.get(`/nodes/${id}/get_tasks`)
|
||||
.then(response => {
|
||||
commit('task/SET_TASK_LIST',
|
||||
response.data.items.map(d => {
|
||||
if (d.create_ts) d.create_ts = dayjs(d.create_ts.$date).format('YYYY-MM-DD HH:mm:ss')
|
||||
if (d.finish_ts) d.finish_ts = dayjs(d.finish_ts.$date).format('YYYY-MM-DD HH:mm:ss')
|
||||
return d
|
||||
}).sort((a, b) => a.create_ts < b.create_ts ? 1 : -1),
|
||||
response.data.items.map(d => d)
|
||||
.sort((a, b) => a.create_ts < b.create_ts ? 1 : -1),
|
||||
{ root: true })
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user