Files
crawlab/frontend/src/components/TableView/DeployTableView.vue
yaziming c671d113c9 * 增加Docker开发环境
* 更新Dockerfile构建文件,升级NodeJS依赖版本。
 * 遵循ESLint重新格式化代码,修复部分警告
 * 登录Token失效增加登出提示
 * 网络请求问题增加错误错误提示
 * 升级UI依赖库
2020-06-19 16:57:00 +08:00

77 lines
1.9 KiB
Vue

<template>
<div class="deploy-table-view">
<el-row class="title-wrapper">
<h5 class="title">{{ title }}</h5>
<el-button type="success" plain class="small-btn" size="mini" icon="fa fa-refresh" @click="onRefresh" />
</el-row>
<el-table border height="240px" :data="deployList">
<el-table-column property="version" label="Ver" width="40" align="center" />
<el-table-column property="node" label="Node" width="220" align="center">
<template slot-scope="scope">
<a class="a-tag" @click="onClickNode(scope.row)">{{ scope.row.node_id }}</a>
</template>
</el-table-column>
<el-table-column property="spider_name" label="Spider" width="80" align="center">
<template slot-scope="scope">
<a class="a-tag" @click="onClickSpider(scope.row)">{{ scope.row.spider_name }}</a>
</template>
</el-table-column>
<el-table-column property="finish_ts" label="Finish Time" width="auto" align="center" />
</el-table>
</div>
</template>
<script>
import {
mapState
} from 'vuex'
export default {
name: 'DeployTableView',
props: {
title: {
type: String,
default: ''
}
},
computed: {
...mapState('spider', [
'spiderForm'
]),
...mapState('deploy', [
'deployList'
])
},
methods: {
onClickSpider(row) {
this.$router.push(`/spiders/${row.spider_id}`)
},
onClickNode(row) {
this.$router.push(`/nodes/${row.node_id}`)
},
onRefresh() {
this.$store.dispatch('deploy/getDeployList', this.spiderForm._id)
}
}
}
</script>
<style scoped>
.el-table .a-tag {
text-decoration: underline;
}
.title {
float: left;
margin: 10px 0 3px 0;
}
.small-btn {
float: right;
width: 24px;
margin: 0;
padding: 5px;
}
</style>