-
-
-
+
+
+
+
+
+
+
- {{$t('Refresh')}}
+ {{$t('Search')}}
+
+
@@ -100,28 +102,42 @@ export default {
name: 'TaskList',
data () {
return {
+ // setInterval handle
+ handle: undefined,
+
+ // determine if is edit mode
isEditMode: false,
+
+ // dialog visibility
dialogVisible: false,
- filter: {
- keyword: ''
- },
- // tableData,
+
+ // table columns
columns: [
- { name: 'create_ts', label: 'Create Time', width: '150' },
- { name: 'start_ts', label: 'Start Time', width: '150' },
- { name: 'finish_ts', label: 'Finish Time', width: '150' },
- { name: 'spider_name', label: 'Spider', width: '160' },
+ { name: 'create_ts', label: 'Create Time', width: '100' },
+ { name: 'start_ts', label: 'Start Time', width: '100' },
+ { name: 'finish_ts', label: 'Finish Time', width: '100' },
+ { name: 'duration', label: 'Duration (sec)', width: '80' },
+ { name: 'spider_name', label: 'Spider', width: '120' },
{ name: 'node_id', label: 'Node', width: '160' },
- { name: 'status', label: 'Status', width: '160', sortable: true }
+ { name: 'num_results', label: 'Results Count', width: '80' },
+ { name: 'avg_num_results', label: 'Average Results Count per Second', width: '80' },
+ { name: 'status', label: 'Status', width: '80' }
]
}
},
computed: {
...mapState('task', [
+ 'filter',
'taskList',
'taskListTotalCount',
'taskForm'
]),
+ ...mapState('spider', [
+ 'spiderList'
+ ]),
+ ...mapState('node', [
+ 'nodeList'
+ ]),
pageNum: {
get () {
return this.$store.state.task.pageNum
@@ -200,6 +216,17 @@ export default {
},
created () {
this.$store.dispatch('task/getTaskList')
+ this.$store.dispatch('spider/getSpiderList')
+ this.$store.dispatch('node/getNodeList')
+ },
+ mounted () {
+ // request task list every 5 seconds
+ this.handle = setInterval(() => {
+ this.$store.dispatch('task/getTaskList')
+ }, 5000)
+ },
+ destroyed () {
+ clearInterval(this.handle)
}
}
@@ -215,6 +242,13 @@ export default {
display: flex;
justify-content: space-between;
+ .left {
+ .filter-select {
+ width: 180px;
+ margin-right: 10px;
+ }
+ }
+
.filter-search {
width: 240px;
}