fixing issues with spaceapi compliance

This commit is contained in:
Lucas Pleß 2014-07-06 01:11:45 +02:00
parent f4630b30b0
commit 5e8249d0e4
1 changed files with 9 additions and 5 deletions

View File

@ -11,7 +11,11 @@ var routes = require("./routes");
var spaceanswer = {
api: "0.13",
space: "Chaostreff Dortmund",
logo: "http://www.chaostreff-dortmund.de/logo.jpg",
logo: "http://www.chaostreff-dortmund.de/logo/logo_ctdo.svg",
"icon":{
"open":"http://status.ctdo.de/img/green.png",
"closed":"http://status.ctdo.de/img/red.png"
},
url: "http://www.chaostreff-dortmund.de/",
location: {
address: "Braunschweiger Str 22, 44145 Dortmund, Germany",
@ -25,7 +29,7 @@ var spaceanswer = {
twitter: "@ctdo",
issue_mail: "server-admin@chaostreff-dortmund.de"
},
issue_report_channels: [ "issue_email" ],
issue_report_channels: [ "issue_mail" ],
state: {
open: null,
lastchange: 0
@ -39,18 +43,18 @@ var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.20-62 195.160.169.7
snmpMac.on('done', function (res) {
simpleanswer.names = res;
simpleanswer.lastchange = new Date();
simpleanswer.lastchange = moment().format("X");
});
ippoll.on('doneCount', function (num) {
simpleanswer.count = num;
simpleanswer.lastchange = new Date();
simpleanswer.lastchange = moment().format("X");
ippoll.pollState();
});
ippoll.on('doneState', function (state) {
spaceanswer.state.open = state;
spaceanswer.state.lastchange = new Date();
spaceanswer.state.lastchange = moment().format("X");
simpleanswer.state = state;
simpleanswer.lastchange = spaceanswer.state.lastchange;
io.sockets.emit('sdata', { data: simpleanswer });