mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Working in the update nodes.
This commit is contained in:
parent
2958e563c6
commit
8a6d1509f0
@ -376,7 +376,10 @@ NetworkmapController.prototype.update_node = function(id) {
|
|||||||
|
|
||||||
var node = self.get_node_filter('id', 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", node['status'])
|
||||||
.attr("data-status_color", node['color'])
|
.attr("data-status_color", node['color'])
|
||||||
.style("fill", node['color']);
|
.style("fill", node['color']);
|
||||||
@ -1606,17 +1609,16 @@ NetworkmapController.prototype.refresh_nodes = function() {
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
url: "ajax.php",
|
url: "ajax.php",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log(data);
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
|
if (node['type'] != ITEM_TYPE_AGENT_NETWORKMAP)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (typeof(data[node['id']]) != "undefined") {
|
if (typeof(data[node['id']]) != "undefined") {
|
||||||
nodes[i]['status'] = data[node['id']]['status'];
|
nodes[i]['status'] = data[node['id']]['status'];
|
||||||
nodes[i]['color'] = data[node['id']]['color'];
|
nodes[i]['color'] = data[node['id']]['color'];
|
||||||
|
|
||||||
self.update_node(node['id']);
|
self.update_node(node['id']);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
console.log("refresh_nodes undefined", node['id'], data[node['id']]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user