diff --git a/frontend/src/components/InfoView/SpiderInfoView.vue b/frontend/src/components/InfoView/SpiderInfoView.vue index f7226bf9..b054f85d 100644 --- a/frontend/src/components/InfoView/SpiderInfoView.vue +++ b/frontend/src/components/InfoView/SpiderInfoView.vue @@ -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 diff --git a/frontend/src/components/Scrapy/SpiderScrapy.vue b/frontend/src/components/Scrapy/SpiderScrapy.vue index 823cde6c..b7d74a31 100644 --- a/frontend/src/components/Scrapy/SpiderScrapy.vue +++ b/frontend/src/components/Scrapy/SpiderScrapy.vue @@ -109,7 +109,7 @@ type="primary" size="small" icon="el-icon-plus" - @click="isAddSpiderVisible = true" + @click="onAddSpider" > {{$t('Add Spider')}} @@ -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 } } } diff --git a/frontend/src/views/spider/SpiderDetail.vue b/frontend/src/views/spider/SpiderDetail.vue index fc0e990c..d89e6504 100644 --- a/frontend/src/views/spider/SpiderDetail.vue +++ b/frontend/src/views/spider/SpiderDetail.vue @@ -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 }) }