node events notifications
This commit is contained in:
@@ -28,6 +28,18 @@ Collection.prototype.update = function(id, stats)
|
||||
return node.getStats();
|
||||
}
|
||||
|
||||
Collection.prototype.inactive = function(id)
|
||||
{
|
||||
var node = this.getNode({ spark: id });
|
||||
|
||||
if(!node)
|
||||
return false;
|
||||
|
||||
node.stats.active = false;
|
||||
|
||||
return node.getStats();
|
||||
}
|
||||
|
||||
Collection.prototype.getIndex = function(search)
|
||||
{
|
||||
return _.findIndex(this._list, search);
|
||||
|
||||
@@ -36,6 +36,9 @@ var Node = function Node(data)
|
||||
this.setGeo(data.ip);
|
||||
}
|
||||
|
||||
if(typeof data.spark !== 'undefined')
|
||||
this.spark = data.spark;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -53,6 +56,9 @@ Node.prototype.setInfo = function(data)
|
||||
this.info.ip = data.ip;
|
||||
this.setGeo(data.ip);
|
||||
}
|
||||
|
||||
if(typeof data.spark !== 'undefined')
|
||||
this.spark = data.spark;
|
||||
}
|
||||
|
||||
Node.prototype.getInfo = function()
|
||||
|
||||
Reference in New Issue
Block a user