mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
added setup.py
This commit is contained in:
34
frontend/src/store/modules/deploy.js
Normal file
34
frontend/src/store/modules/deploy.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import request from '../../api/request'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
const state = {
|
||||
deployList: []
|
||||
}
|
||||
|
||||
const getters = {}
|
||||
|
||||
const mutations = {
|
||||
SET_DEPLOY_LIST (state, value) {
|
||||
state.deployList = value
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
getDeployList ({ state, commit }) {
|
||||
request.get('/deploys')
|
||||
.then(response => {
|
||||
commit('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))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
Reference in New Issue
Block a user