mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
added system tasks
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</el-tag>
|
||||
</el-badge>
|
||||
<el-tag
|
||||
v-if="taskForm.status === 'finished' && taskForm.result_count === 0"
|
||||
v-if="taskForm.type === 'spider' && taskForm.status === 'finished' && taskForm.result_count === 0"
|
||||
type="danger"
|
||||
style="margin-left: 10px"
|
||||
>
|
||||
@@ -32,8 +32,8 @@
|
||||
{{ $t('Empty results') }}
|
||||
</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Log File Path')">
|
||||
<el-input v-model="taskForm.log_path" placeholder="Log File Path" disabled />
|
||||
<el-form-item :label="$t('Execute Command')">
|
||||
<el-input v-model="taskForm.cmd" placeholder="Execute Command" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('Parameters')">
|
||||
<el-input v-model="taskForm.param" placeholder="Parameters" disabled />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="task-overview">
|
||||
<el-row class="action-wrapper">
|
||||
<el-button
|
||||
v-if="taskForm.type === 'spider'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-position"
|
||||
@@ -28,7 +29,7 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-row class="task-info-spider-wrapper wrapper">
|
||||
<el-row v-if="taskForm.type === 'spider'" class="task-info-spider-wrapper wrapper">
|
||||
<h4 class="title spider-title" @click="onNavigateToSpider">
|
||||
<i class="fa fa-search" style="margin-right: 5px" />
|
||||
{{ $t('Spider Info') }}</h4>
|
||||
@@ -66,6 +67,9 @@
|
||||
]),
|
||||
...mapState('spider', [
|
||||
'spiderForm'
|
||||
]),
|
||||
...mapState('task', [
|
||||
'taskForm'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -104,6 +104,7 @@ export default {
|
||||
'Worker': '工作节点',
|
||||
'Installation': '安装',
|
||||
'Search Dependencies': '搜索依赖',
|
||||
'Started to install': '开始安装',
|
||||
|
||||
// 节点列表
|
||||
'IP': 'IP地址',
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user