Skip to content

Commit

Permalink
feat(ui): db click on task to run
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 28, 2018
1 parent 28558ea commit 104aba2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/@vue/cli-ui/src/components/TaskItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
selected
}
]"
@dblclick="runTask()"
>
<div class="content">
<ItemLogo
Expand All @@ -25,6 +26,8 @@
</template>

<script>
import TASK_RUN from '../graphql/taskRun.gql'
const icons = {
idle: { icon: 'assignment', class: '' },
running: { icon: 'more_horiz', class: 'info' },
Expand Down Expand Up @@ -54,6 +57,18 @@ export default {
iconData () {
return icons[this.task.status]
}
},
methods: {
runTask () {
if (this.task.status === 'running') return
this.$apollo.mutate({
mutation: TASK_RUN,
variables: {
id: this.task.id
}
})
},
}
}
</script>
Expand Down

0 comments on commit 104aba2

Please sign in to comment.