Merge pull request #108 from cubedro/develop

Fix bugs
This commit is contained in:
Marian OANCΞA 2015-04-28 15:56:01 +03:00
commit 50bc5068a7
2 changed files with 10 additions and 3 deletions

11
app.js
View File

@ -65,7 +65,10 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval());
var range = Nodes.getHistory().getHistoryRequestInterval();
console.log("asked " + data.id + " for history");
console.log('interval', range);
spark.emit('history', range);
askedForHistory = true;
}
@ -89,13 +92,17 @@ api.on('connection', function(spark) {
if(Nodes.getHistory().requiresUpdate() && !askedForHistory && Nodes.canNodeUpdate(data.id))
{
spark.emit('history', Nodes.getHistory().getHistoryRequestInterval());
var range = Nodes.getHistory().getHistoryRequestInterval();
console.log("asked " + data.id + " for history");
console.log('interval', range);
spark.emit('history', range);
askedForHistory = true;
}
}
});
spark.on('history', function(data){
console.log("got history from " + data.id);
client.write({action: 'charts', data: Nodes.addHistory(data.id, data.history)});
askedForHistory = false;
});

View File

@ -275,7 +275,7 @@ angular.module('netStatsApp.filters', [])
var tooltip = [];
var string = '';
if(node.info.node !== '') {
if(node.info.node !== '' && typeof node.info.node !== 'undefined') {
var eth_version = node.info.node.split('/');
if(eth_version[1][0] !== 'v' && eth_version[1][2] !== '.')