mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
adapt changes to golang api
This commit is contained in:
@@ -27,27 +27,11 @@ const actions = {
|
||||
getNodeList ({ state, commit }) {
|
||||
request.get('/nodes', {})
|
||||
.then(response => {
|
||||
commit('SET_NODE_LIST', response.data.items)
|
||||
})
|
||||
},
|
||||
addNode ({ state, dispatch }) {
|
||||
request.put('/nodes', {
|
||||
name: state.nodeForm.name,
|
||||
ip: state.nodeForm.ip,
|
||||
port: state.nodeForm.port,
|
||||
description: state.nodeForm.description
|
||||
})
|
||||
.then(() => {
|
||||
dispatch('getNodeList')
|
||||
commit('SET_NODE_LIST', response.data.data)
|
||||
})
|
||||
},
|
||||
editNode ({ state, dispatch }) {
|
||||
request.post(`/nodes/${state.nodeForm._id}`, {
|
||||
name: state.nodeForm.name,
|
||||
ip: state.nodeForm.ip,
|
||||
port: state.nodeForm.port,
|
||||
description: state.nodeForm.description
|
||||
})
|
||||
request.post(`/nodes/${state.nodeForm._id}`, state.nodeForm)
|
||||
.then(() => {
|
||||
dispatch('getNodeList')
|
||||
})
|
||||
@@ -61,23 +45,14 @@ const actions = {
|
||||
getNodeData ({ state, commit }, id) {
|
||||
request.get(`/nodes/${id}`)
|
||||
.then(response => {
|
||||
commit('SET_NODE_FORM', response.data)
|
||||
})
|
||||
},
|
||||
getDeployList ({ state, commit }, id) {
|
||||
return request.get(`/nodes/${id}/get_deploys`)
|
||||
.then(response => {
|
||||
commit('deploy/SET_DEPLOY_LIST',
|
||||
response.data.items.map(d => d)
|
||||
.sort((a, b) => a.finish_ts < b.finish_ts ? 1 : -1),
|
||||
{ root: true })
|
||||
commit('SET_NODE_FORM', response.data.data)
|
||||
})
|
||||
},
|
||||
getTaskList ({ state, commit }, id) {
|
||||
return request.get(`/nodes/${id}/get_tasks`)
|
||||
return request.get(`/nodes/${id}/tasks`)
|
||||
.then(response => {
|
||||
commit('task/SET_TASK_LIST',
|
||||
response.data.items.map(d => d)
|
||||
response.data.data.map(d => d)
|
||||
.sort((a, b) => a.create_ts < b.create_ts ? 1 : -1),
|
||||
{ root: true })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user