Removed unused stuff
This commit is contained in:
parent
f598a2b20e
commit
129fae722c
|
@ -1,47 +0,0 @@
|
||||||
var notifier = require('node-notifier');
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
var Notification = function () {
|
|
||||||
|
|
||||||
var laststate = false;
|
|
||||||
|
|
||||||
this.notificate = function (currentstate) {
|
|
||||||
|
|
||||||
notifier.on('click', function (notifierObject, options) {
|
|
||||||
// Happens if `wait: true` and user clicks notification
|
|
||||||
});
|
|
||||||
|
|
||||||
notifier.on('timeout', function (notifierObject, options) {
|
|
||||||
// Happens if `wait: true` and notification closes
|
|
||||||
});
|
|
||||||
|
|
||||||
if (currentstate === true && laststate != true) {
|
|
||||||
laststate = true;
|
|
||||||
notifier.notify({
|
|
||||||
title: 'CTDO - Status',
|
|
||||||
message: 'Der Chaostreff Dortmund ist nun offen.',
|
|
||||||
icon: path.join('public/img/green.png'), // absolute path (not balloons)
|
|
||||||
sound: true, // Only Notification Center or Windows Toasters
|
|
||||||
wait: true // wait with callback until user action is taken on notification
|
|
||||||
}, function (err, response) {
|
|
||||||
// response is response from notification
|
|
||||||
});
|
|
||||||
//console.log("State changed to Open");
|
|
||||||
} else if (currentstate == false && laststate != false) {
|
|
||||||
laststate = false;
|
|
||||||
notifier.notify({
|
|
||||||
title: 'CTDO - Status',
|
|
||||||
message: 'Der Chaostreff Dortmund ist nun geschlossen.',
|
|
||||||
icon: path.join('public/img/red.png'), // absolute path (not balloons)
|
|
||||||
sound: true, // Only Notification Center or Windows Toasters
|
|
||||||
wait: true // wait with callback until user action is taken on notification
|
|
||||||
}, function (err, response) {
|
|
||||||
// response is response from notification
|
|
||||||
});
|
|
||||||
//console.log("State changed to Close");
|
|
||||||
}
|
|
||||||
//console.log("Currentstate: " + currentstate + " Laststate: " + laststate);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Notification;
|
|
|
@ -1,13 +1,11 @@
|
||||||
var express = require('express'),
|
var express = require('express'),
|
||||||
app = express(),
|
app = express(),
|
||||||
server = require('http').createServer(app),
|
server = require('http').createServer(app),
|
||||||
io = require('socket.io').listen(server)/*,*/;
|
io = require('socket.io').listen(server);
|
||||||
//notifier = require('node-notifier');
|
|
||||||
var flash = require('connect-flash');
|
var flash = require('connect-flash');
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
var SnmpMac = require("./snmp-mac");
|
var SnmpMac = require("./snmp-mac");
|
||||||
var IpPoll = require("./ip-poll");
|
var IpPoll = require("./ip-poll");
|
||||||
var Notification = require("./notification");
|
|
||||||
var Flukso = require("./flukso");
|
var Flukso = require("./flukso");
|
||||||
var routes = require("./routes");
|
var routes = require("./routes");
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
@ -59,7 +57,6 @@ var usercountanswer = {at: 0, current_value: 0, datapoints: [
|
||||||
var snmpMac = new SnmpMac("juni.ctdo.de", "ctdo23");
|
var snmpMac = new SnmpMac("juni.ctdo.de", "ctdo23");
|
||||||
var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.30-120");
|
var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.30-120");
|
||||||
var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
|
var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
|
||||||
//var notification = new Notification();
|
|
||||||
|
|
||||||
var port = '3000';
|
var port = '3000';
|
||||||
var address = 'localhost';
|
var address = 'localhost';
|
||||||
|
@ -96,7 +93,6 @@ io.configure(function () {
|
||||||
function work() {
|
function work() {
|
||||||
snmpMac.poll();
|
snmpMac.poll();
|
||||||
ippoll.pollCount();
|
ippoll.pollCount();
|
||||||
//notification.notificate(simpleanswer.state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(work, 60000);
|
setInterval(work, 60000);
|
||||||
|
|
|
@ -60,5 +60,4 @@ block scripts
|
||||||
script(type="text/javascript",src="/js/vendor/justgage.1.0.1.min.js")
|
script(type="text/javascript",src="/js/vendor/justgage.1.0.1.min.js")
|
||||||
script(type="text/javascript",src="/js/vendor/cheet.min.js")
|
script(type="text/javascript",src="/js/vendor/cheet.min.js")
|
||||||
script(type="text/javascript",src="/js/vendor/notification.js")
|
script(type="text/javascript",src="/js/vendor/notification.js")
|
||||||
script(type="text/javascript",src="/js/state-notify.js")
|
|
||||||
script(type="text/javascript",src="/js/easter.js")
|
script(type="text/javascript",src="/js/easter.js")
|
||||||
|
|
Loading…
Reference in New Issue