added angularJS Framework

This commit is contained in:
Lucas Pleß 2013-10-21 00:47:31 +02:00
parent 2743b5f970
commit 494b509e15
2 changed files with 6 additions and 7 deletions

View File

@ -11,12 +11,11 @@ var IpPoll = function(switchaddr, hostsaddr) {
var redisClient = redis.createClient(); var redisClient = redis.createClient();
var regexp = /\(([0-9]+) hosts* up\)/; var regexp = /\(([0-9]+) hosts* up\)/;
var nmap = "nmap -n -sP -T5 --host-timeout 10ms "; // var nmap = "nmap -n -sP -T5 --host-timeout 10ms ";
var nmap = "nmap -n -sP -T5 ";
redisClient.on("connect", function () { redisClient.on("connect", function () {
//redisClient.set(redisprefix + "24:77:03:a9:f3:f4","lucas");
console.log("connected to redis"); console.log("connected to redis");
self.emit('ready'); self.emit('ready');
}); });

View File

@ -42,13 +42,13 @@ var snmpMac = new SnmpMac("juni.ctdo.de", "ctdo23");
var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.20-62 195.160.169.70-126"); var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.20-62 195.160.169.70-126");
snmpMac.on('done', function (res) { snmpMac.on('done', function (res) {
console.log(res); // console.log(res);
simpleanswer.names = res; simpleanswer.names = res;
simpleanswer.lastchange = parseInt((new Date().getTime()) / 1000); simpleanswer.lastchange = parseInt((new Date().getTime()) / 1000);
}); });
ippoll.on('doneCount', function (num) { ippoll.on('doneCount', function (num) {
console.log("there are " + num + " hosts up"); // console.log("there are " + num + " hosts up");
simpleanswer.count = num; simpleanswer.count = num;
simpleanswer.lastchange = parseInt((new Date().getTime()) / 1000); simpleanswer.lastchange = parseInt((new Date().getTime()) / 1000);
@ -56,7 +56,7 @@ ippoll.on('doneCount', function (num) {
}); });
ippoll.on('doneState', function (state) { ippoll.on('doneState', function (state) {
console.log("room state is: " + state); // console.log("room state is: " + state);
simpleanswer.state = state; simpleanswer.state = state;
spaceanswer.state.open = state; spaceanswer.state.open = state;
@ -81,7 +81,7 @@ function work() {
ippoll.pollState(); ippoll.pollState();
} }
setInterval(work, 10000); setInterval(work, 60000);
app.set('snmpMac', snmpMac); //TODO: wie kann man das schoener machen? (Modul in die Routes reintun) app.set('snmpMac', snmpMac); //TODO: wie kann man das schoener machen? (Modul in die Routes reintun)
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');