mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
New networkmaps in progress... (Fixed refresh holding area action in js)
This commit is contained in:
parent
038470793d
commit
249f81da7e
@ -2567,6 +2567,8 @@ function networkmap_refresh_holding_area($id_networkmap) {
|
|||||||
array('state' => $row['state']),
|
array('state' => $row['state']),
|
||||||
array('id' => $row['id']));
|
array('id' => $row['id']));
|
||||||
|
|
||||||
|
$row['style'] = json_decode($row['style'], true);
|
||||||
|
|
||||||
$node = networkmap_db_node_to_js_node($row, $count,
|
$node = networkmap_db_node_to_js_node($row, $count,
|
||||||
$count_item_holding_area);
|
$count_item_holding_area);
|
||||||
|
|
||||||
|
@ -934,7 +934,6 @@ function zoom(manual) {
|
|||||||
|
|
||||||
|
|
||||||
function set_positions_graph() {
|
function set_positions_graph() {
|
||||||
|
|
||||||
link.selectAll("path.link")
|
link.selectAll("path.link")
|
||||||
.attr("d", function(d) {
|
.attr("d", function(d) {
|
||||||
|
|
||||||
@ -949,8 +948,6 @@ function set_positions_graph() {
|
|||||||
" L " + d.source.x + " " + d.source.y;
|
" L " + d.source.x + " " + d.source.y;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
node.selectAll(".node_shape_circle")
|
node.selectAll(".node_shape_circle")
|
||||||
.attr("cx", function(d) {
|
.attr("cx", function(d) {
|
||||||
return d.x;
|
return d.x;
|
||||||
@ -1624,41 +1621,42 @@ function init_drag_and_drop() {
|
|||||||
if (d3.event.sourceEvent.button == 2)
|
if (d3.event.sourceEvent.button == 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
flag_drag_running = false;
|
flag_drag_running = false;
|
||||||
|
|
||||||
var selection = d3.selectAll('.node_selected');
|
var selection = d3.selectAll('.node_selected');
|
||||||
|
|
||||||
selection
|
if (enterprise_installed) {
|
||||||
.each(function(d) {
|
selection
|
||||||
var params = [];
|
.each(function(d) {
|
||||||
params.push("update_node=1");
|
var params = [];
|
||||||
params.push("node=" + JSON.stringify(d));
|
params.push("update_node=1");
|
||||||
params.push("page=operation/agentes/pandora_networkmap.view");
|
params.push("node=" + JSON.stringify(d));
|
||||||
jQuery.ajax ({
|
params.push("page=operation/agentes/pandora_networkmap.view");
|
||||||
data: params.join ("&"),
|
jQuery.ajax ({
|
||||||
dataType: 'json',
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
dataType: 'json',
|
||||||
url: action="ajax.php",
|
type: 'POST',
|
||||||
success: function (data) {
|
url: action="ajax.php",
|
||||||
if (d.state == 'holding_area') {
|
success: function (data) {
|
||||||
//It is out the holding area
|
if (d.state == 'holding_area') {
|
||||||
if (data['state'] == "") {
|
//It is out the holding area
|
||||||
//Remove the style of nodes and links
|
if (data['state'] == "") {
|
||||||
//in holding area
|
//Remove the style of nodes and links
|
||||||
|
//in holding area
|
||||||
|
|
||||||
d3.select("#id_node_" + d.id)
|
d3.select("#id_node_" + d.id)
|
||||||
.classed("holding_area", false);
|
.classed("holding_area", false);
|
||||||
|
|
||||||
d3.select(".source_" + d.id)
|
d3.select(".source_" + d.id)
|
||||||
.classed("holding_area_link", false);
|
.classed("holding_area_link", false);
|
||||||
d3.select(".target_" + d.id)
|
d3.select(".target_" + d.id)
|
||||||
.classed("holding_area_link", false);
|
.classed("holding_area_link", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
d3.event.sourceEvent.stopPropagation();
|
d3.event.sourceEvent.stopPropagation();
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user