This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.4 KiB
46 lines
1.4 KiB
var os = require('os'); |
|
var utils = require('./lib/utils'); |
|
|
|
// All notifiers |
|
var NotifySend = require('./notifiers/notifysend'); |
|
var NotificationCenter = require('./notifiers/notificationcenter'); |
|
var WindowsToaster = require('./notifiers/toaster'); |
|
var Growl = require('./notifiers/growl'); |
|
var WindowsBalloon = require('./notifiers/balloon'); |
|
|
|
var options = { withFallback: true }; |
|
|
|
switch (os.type()) { |
|
case 'Linux': |
|
module.exports = new NotifySend(options); |
|
module.exports.Notification = NotifySend; |
|
break; |
|
case 'Darwin': |
|
module.exports = new NotificationCenter(options); |
|
module.exports.Notification = NotificationCenter; |
|
break; |
|
case 'Windows_NT': |
|
if (utils.isLessThanWin8()) { |
|
module.exports = new WindowsBalloon(options); |
|
module.exports.Notification = WindowsBalloon; |
|
} else { |
|
module.exports = new WindowsToaster(options); |
|
module.exports.Notification = WindowsToaster; |
|
} |
|
break; |
|
default: |
|
if (os.type().match(/BSD$/)) { |
|
module.exports = new NotifySend(options); |
|
module.exports.Notification = NotifySend; |
|
} else { |
|
module.exports = new Growl(options); |
|
module.exports.Notification = Growl; |
|
} |
|
} |
|
|
|
// Expose notifiers to give full control. |
|
module.exports.NotifySend = NotifySend; |
|
module.exports.NotificationCenter = NotificationCenter; |
|
module.exports.WindowsToaster = WindowsToaster; |
|
module.exports.WindowsBalloon = WindowsBalloon; |
|
module.exports.Growl = Growl;
|
|
|