Skip to content

Commit

Permalink
request task list every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Zhang committed Apr 23, 2019
1 parent b7ed4ad commit ae29708
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/src/components/TableView/TaskTableView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ import {
export default {
name: 'TaskTableView',
data () {
return {
// setInterval handle
handle: undefined
}
},
props: {
title: String
},
Expand Down Expand Up @@ -71,6 +77,14 @@ export default {
this.$store.dispatch('node/getTaskList', this.$route.params.id)
}
}
},
mounted () {
this.handle = setInterval(() => {
this.onRefresh()
}, 5000)
},
destroyed () {
clearInterval(this.handle)
}
}
</script>
Expand Down

0 comments on commit ae29708

Please sign in to comment.