Skip to content

Commit

Permalink
feat(ui): Task notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 17, 2018
1 parent 65019d6 commit 0335d32
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"lowdb": "^1.0.0",
"lru-cache": "^4.1.2",
"mkdirp": "^0.5.1",
"node-notifier": "^5.2.1",
"rimraf": "^2.6.2",
"semver": "^5.5.0",
"shortid": "^2.2.8",
Expand Down
Binary file added packages/@vue/cli-ui/src/assets/done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/@vue/cli-ui/src/assets/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions packages/@vue/cli-ui/src/graphql-api/connectors/tasks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path')
const execa = require('execa')
const terminate = require('terminate')
const notifier = require('node-notifier')
// Subs
const channels = require('../channels')
// Connectors
Expand Down Expand Up @@ -295,6 +297,11 @@ function run (id, context) {
message: `Task ${task.id} ended with error code ${code}`,
type: 'error'
}, context)
notifier.notify({
title: `Task error`,
message: `Task ${task.id} ended with error code ${code}`,
icon: path.resolve(__dirname, '../../assets/error.png')
})
} else {
updateOne({
id: task.id,
Expand All @@ -305,6 +312,12 @@ function run (id, context) {
message: `Task ${task.id} completed`,
type: 'done'
}, context)
notifier.notify({
title: `Task completed`,
message: `Task ${task.id} completed`,
icon: path.resolve(__dirname, '../../assets/done.png')
})
console.log(path.resolve(__dirname, '../../assets/done.png'))
}
}

Expand Down

0 comments on commit 0335d32

Please sign in to comment.