更新添加scrapy爬虫

This commit is contained in:
marvzhang
2020-02-17 14:20:42 +08:00
parent bb972e98ef
commit 93f1cf1f2e
3 changed files with 12 additions and 4 deletions

View File

@@ -189,7 +189,7 @@ export default {
this.spiderForm.site = item._id
},
onUploadSuccess () {
this.$store.dispatch('file/getFileList', this.spiderForm.src)
this.$store.dispatch('spider/getFileTree')
this.uploadLoading = false

View File

@@ -109,7 +109,7 @@
type="primary"
size="small"
icon="el-icon-plus"
@click="isAddSpiderVisible = true"
@click="onAddSpider"
>
{{$t('Add Spider')}}
</el-button>
@@ -373,13 +373,20 @@ export default {
id: this.$route.params.id,
form: this.addSpiderForm
})
console.log(res)
if (!res.data.error) {
this.$message.success('Saved successfully')
this.$message.success(this.$t('Saved successfully'))
}
this.isAddSpiderVisible = false
this.isAddSpiderLoading = false
await this.$store.dispatch('spider/getSpiderScrapySpiders', this.$route.params.id)
})
},
onAddSpider () {
this.addSpiderForm = {
name: '',
domain: ''
}
this.isAddSpiderVisible = true
}
}
}

View File

@@ -202,6 +202,7 @@ export default {
this.$store.dispatch('spider/getSpiderScrapySpiders', this.$route.params.id)
this.$store.dispatch('spider/getSpiderScrapySettings', this.$route.params.id)
} else if (this.activeTabName === 'files') {
this.$store.dispatch('spider/getFileTree')
if (this.currentPath) {
this.$store.dispatch('file/getFileContent', { path: this.currentPath })
}