Files
crawlab/frontend/src/store/modules/deploy.js
2019-03-16 21:29:30 +08:00

33 lines
543 B
JavaScript

import request from '../../api/request'
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 => {
return d
}).sort((a, b) => a.finish_ts < b.finish_ts ? 1 : -1))
})
}
}
export default {
namespaced: true,
state,
getters,
mutations,
actions
}