Working in the update nodes.

This commit is contained in:
mdtrooper 2016-04-06 12:53:43 +02:00
parent 2958e563c6
commit 8a6d1509f0
1 changed files with 7 additions and 5 deletions

View File

@ -376,7 +376,10 @@ NetworkmapController.prototype.update_node = function(id) {
var node = self.get_node_filter('id', id);
d3.select(self._target + "#node_" + id)
if (d3.select(self._target + " #node_" + node['graph_id']).node() == null)
return;
d3.select(self._target + " #node_" + node['graph_id'])
.attr("data-status", node['status'])
.attr("data-status_color", node['color'])
.style("fill", node['color']);
@ -1606,17 +1609,16 @@ NetworkmapController.prototype.refresh_nodes = function() {
type: "POST",
url: "ajax.php",
success: function (data) {
console.log(data);
$.each(nodes, function(i, node) {
if (node['type'] != ITEM_TYPE_AGENT_NETWORKMAP)
return true;
if (typeof(data[node['id']]) != "undefined") {
nodes[i]['status'] = data[node['id']]['status'];
nodes[i]['color'] = data[node['id']]['color'];
self.update_node(node['id']);
}
else {
console.log("refresh_nodes undefined", node['id'], data[node['id']]);
}
});
}
});