加入任务导航操作按钮

This commit is contained in:
marvzhang
2020-02-23 08:45:38 +08:00
parent 259403d3e5
commit 97bf817b22
3 changed files with 64 additions and 30 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

@@ -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': '节点',