feat(ui): Task notifs

This commit is contained in:
Guillaume Chau
2018-04-17 02:53:23 +02:00
parent 65019d6ce5
commit 0335d325ac
4 changed files with 14 additions and 0 deletions
+1
View File
@@ -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",
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -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
@@ -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,
@@ -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'))
}
}