diff --git a/frontend/src/components/InfoView/TaskInfoView.vue b/frontend/src/components/InfoView/TaskInfoView.vue index 1fd32852..c3a45d96 100644 --- a/frontend/src/components/InfoView/TaskInfoView.vue +++ b/frontend/src/components/InfoView/TaskInfoView.vue @@ -24,7 +24,7 @@ @@ -32,8 +32,8 @@ {{ $t('Empty results') }} - - + + diff --git a/frontend/src/components/Overview/TaskOverview.vue b/frontend/src/components/Overview/TaskOverview.vue index 76a32c9a..1b77f717 100644 --- a/frontend/src/components/Overview/TaskOverview.vue +++ b/frontend/src/components/Overview/TaskOverview.vue @@ -2,6 +2,7 @@
- +

{{ $t('Spider Info') }}

@@ -66,6 +67,9 @@ ]), ...mapState('spider', [ 'spiderForm' + ]), + ...mapState('task', [ + 'taskForm' ]) }, created() { diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js index 6cf7900c..66480d85 100644 --- a/frontend/src/i18n/zh.js +++ b/frontend/src/i18n/zh.js @@ -104,6 +104,7 @@ export default { 'Worker': '工作节点', 'Installation': '安装', 'Search Dependencies': '搜索依赖', + 'Started to install': '开始安装', // 节点列表 'IP': 'IP地址', diff --git a/frontend/src/store/modules/task.js b/frontend/src/store/modules/task.js index 45a56977..c87c0f9f 100644 --- a/frontend/src/store/modules/task.js +++ b/frontend/src/store/modules/task.js @@ -162,7 +162,9 @@ const actions = { .then(response => { const data = response.data.data commit('SET_TASK_FORM', data) - dispatch('spider/getSpiderData', data.spider_id, { root: true }) + if (data.type === 'spider') { + dispatch('spider/getSpiderData', data.spider_id, { root: true }) + } if (data.node_id && data.node_id !== '000000000000000000000000') { dispatch('node/getNodeData', data.node_id, { root: true }) } diff --git a/frontend/src/views/task/TaskDetail.vue b/frontend/src/views/task/TaskDetail.vue index 06b861ae..6a9a4650 100644 --- a/frontend/src/views/task/TaskDetail.vue +++ b/frontend/src/views/task/TaskDetail.vue @@ -219,14 +219,21 @@ this.isLogAutoFetch = !!this.isRunning this.isLogAutoScroll = !!this.isRunning - await this.$store.dispatch('task/getTaskResults', this.$route.params.id) + if (this.taskForm.type === 'spider') { + await this.$store.dispatch('task/getTaskResults', this.$route.params.id) + } await this.getTaskLog() + this.handle = setInterval(async() => { if (this.isLogAutoFetch) { await this.$store.dispatch('task/getTaskData', this.$route.params.id) - await this.$store.dispatch('task/getTaskResults', this.$route.params.id) + await this.getTaskLog() + + if (this.taskForm.type === 'spider') { + await this.$store.dispatch('task/getTaskResults', this.$route.params.id) + } } }, 5000) @@ -241,9 +248,6 @@ onTabClick(tab) { this.$st.sendEv('任务详情', '切换标签', tab.name) }, - onSpiderChange(id) { - this.$router.push(`/spiders/${id}`) - }, onResultsPageChange(payload) { const { pageNum, pageSize } = payload this.resultsPageNum = pageNum