Files
crawlab/frontend/src/store/modules/deploy.js
Marvin Zhang ff631e1095 updated README
2019-03-13 19:27:14 +08:00

34 lines
569 B
JavaScript

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