Merge pull request #586 from crawlab-team/develop

Develop
This commit is contained in:
Marvin Zhang
2020-02-23 08:50:55 +08:00
committed by GitHub
5 changed files with 66 additions and 33 deletions

View File

@@ -51,3 +51,10 @@ jobs:
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Deploy
run: |
if [ $VERSION == "release"]; then
apt-get install -y curl
curl ${{ secrets.JENKINS_RELEASE_URL }}
fi

View File

@@ -34,7 +34,7 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="spiderForm.is_scrapy" :label="$t('Scrapy Spider')" prop="spider" required inline-message>
<el-form-item v-if="spiderForm.is_scrapy && !multiple" :label="$t('Scrapy Spider')" prop="spider" required inline-message>
<el-select v-model="form.spider" :placeholder="$t('Scrapy Spider')" :disabled="isLoading">
<el-option
v-for="s in spiderForm.spider_names"
@@ -59,7 +59,7 @@
</el-select>
</el-form-item>
<el-form-item v-if="spiderForm.type === 'customized'" :label="$t('Parameters')" prop="param" inline-message>
<template v-if="spiderForm.is_scrapy">
<template v-if="spiderForm.is_scrapy && !multiple">
<el-input v-model="form.param" :placeholder="$t('Parameters')" class="param-input"/>
<el-button type="primary" icon="el-icon-edit" class="param-btn" @click="onOpenParameters"/>
</template>

View File

@@ -1,28 +1,48 @@
<template>
<el-row>
<el-col :span="12" style="padding-right: 20px;">
<el-row class="task-info-overview-wrapper wrapper">
<h4 class="title">{{$t('Task Info')}}</h4>
<task-info-view @click-log="() => $emit('click-log')"/>
</el-row>
<el-row style="border-bottom:1px solid #e4e7ed;margin:0 0 20px 0;padding-bottom:20px;"/>
</el-col>
<div class="task-overview">
<el-row class="action-wrapper">
<el-button
type="primary"
size="small"
icon="el-icon-position"
@click="onNavigateToSpider"
>
{{$t('Navigate to Spider')}}
</el-button>
<el-button
type="warning"
size="small"
icon="el-icon-position"
@click="onNavigateToNode"
>
{{$t('Navigate to Node')}}
</el-button>
</el-row>
<el-row class="content">
<el-col :span="12" style="padding-right: 20px;">
<el-row class="task-info-overview-wrapper wrapper">
<h4 class="title">{{$t('Task Info')}}</h4>
<task-info-view @click-log="() => $emit('click-log')"/>
</el-row>
<el-row style="border-bottom:1px solid #e4e7ed;margin:0 0 20px 0;padding-bottom:20px;"/>
</el-col>
<el-col :span="12">
<el-row class="task-info-spider-wrapper wrapper">
<h4 class="title spider-title" @click="onClickSpiderTitle">
<i class="fa fa-search" style="margin-right: 5px"></i>
{{$t('Spider Info')}}</h4>
<spider-info-view :is-view="true"/>
</el-row>
<el-row class="task-info-node-wrapper wrapper">
<h4 class="title node-title" @click="onClickNodeTitle">
<i class="fa fa-search" style="margin-right: 5px"></i>
{{$t('Node Info')}}</h4>
<node-info-view :is-view="true"/>
</el-row>
</el-col>
</el-row>
<el-col :span="12">
<el-row class="task-info-spider-wrapper wrapper">
<h4 class="title spider-title" @click="onNavigateToSpider">
<i class="fa fa-search" style="margin-right: 5px"></i>
{{$t('Spider Info')}}</h4>
<spider-info-view :is-view="true"/>
</el-row>
<el-row class="task-info-node-wrapper wrapper">
<h4 class="title node-title" @click="onNavigateToNode">
<i class="fa fa-search" style="margin-right: 5px"></i>
{{$t('Node Info')}}</h4>
<node-info-view :is-view="true"/>
</el-row>
</el-col>
</el-row>
</div>
</template>
<script>
@@ -40,11 +60,6 @@ export default {
SpiderInfoView,
TaskInfoView
},
data () {
return {
// spiderForm: {}
}
},
computed: {
...mapState('node', [
'nodeForm'
@@ -54,11 +69,11 @@ export default {
])
},
methods: {
onClickNodeTitle () {
onNavigateToSpider () {
this.$router.push(`/nodes/${this.nodeForm._id}`)
this.$st.sendEv('任务详情', '概览', '点击节点详情')
},
onClickSpiderTitle () {
onNavigateToNode () {
this.$router.push(`/spiders/${this.spiderForm._id}`)
this.$st.sendEv('任务详情', '概览', '点击爬虫详情')
}
@@ -102,4 +117,14 @@ export default {
.title > i {
color: grey;
}
.content {
margin-top: 10px;
}
.action-wrapper {
text-align: right;
padding-bottom: 10px;
border-bottom: 1px solid #DCDFE6;
}
</style>

View File

@@ -252,6 +252,8 @@ export default {
'Error Count': '错误数',
'Log with errors': '日志错误',
'Empty results': '空结果',
'Navigate to Spider': '导航到爬虫',
'Navigate to Node': '导航到节点',
// 任务列表
'Node': '节点',

View File

@@ -1163,7 +1163,6 @@ export default {
})
if (!res.data.error) {
this.$message.success('Sent signals to cancel selected tasks')
this.$refs['table'].clearSelection()
await this.getList()
}
} finally {