🐛 Server > Fix alert

This commit is contained in:
brunosimon
2017-12-24 13:25:10 +01:00
parent 034f6910fb
commit 0ba869f0eb
4 changed files with 20 additions and 9 deletions
+13
View File
@@ -4,6 +4,8 @@ const fs = require('fs')
const mime = require('mime')
const socketIoClient = require('socket.io-client')
const opener = require('opener')
const nodeNotifier = require('node-notifier')
const path = require('path')
/**
* Watcher class
@@ -64,6 +66,17 @@ class Watcher
opener(url)
}
})
// Alert event
this.socket.on('alert', () =>
{
nodeNotifier.notify({
title: 'Keppler',
message: 'Alert!',
icon: path.join(__dirname, 'assets/images/notification-icon-200x200.png'),
wait: true
})
})
}
setExcludeRegex()