mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
优化可配置爬虫前端界面
This commit is contained in:
@@ -43,12 +43,7 @@ const actions = {
|
||||
commit('SET_FILE_CONTENT', response.data.data)
|
||||
})
|
||||
},
|
||||
saveFileContent ({ state, rootState }, payload) {
|
||||
const { path } = payload
|
||||
const spiderId = rootState.spider.spiderForm._id
|
||||
const content = state.fileContent
|
||||
return request.post(`/spiders/${spiderId}/file`, { content, path })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -148,6 +148,13 @@ const actions = {
|
||||
},
|
||||
extractFields ({ state, commit }) {
|
||||
return request.post(`/spiders/${state.spiderForm._id}/extract_fields`)
|
||||
},
|
||||
postConfigSpiderConfig ({ state }) {
|
||||
return request.post(`/config_spiders/${state.spiderForm._id}/config`, state.spiderForm.config)
|
||||
},
|
||||
saveConfigSpiderSpiderfile ({ state, rootState }) {
|
||||
const content = rootState.file.fileContent
|
||||
return request.post(`/config_spiders/${state.spiderForm._id}/spiderfile`, { content })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user