diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 54005a571a..f5dd4cfe96 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -3399,7 +3399,10 @@ function get_status_color_networkmap_fictional_point($id_networkmap, $parent='') if ($agent['source_data'] == -2) { if (empty($parent) === true) { - $option = json_decode($agent, true); + if (is_array($agent) === false) { + $option = json_decode($agent, true); + } + if ($option['networkmap'] == 0) { $status = 0; } else { diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 4882ccad2b..43f9c60c49 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -1699,7 +1699,6 @@ function selected_node(d, selected_param, hold_other_selections) { ); d3.event.stopPropagation(); - d3.event.preventDefault(); } function clear_selection() { @@ -4020,8 +4019,10 @@ function draw_elements_graph() { font_size + "px !important; text-align:center; text-anchor:middle; fill:#000000" ) - .text(function(d) { - return ellipsize(get_node_name_ov(d), 30); + .html(function(d) { + d.text = ellipsize(d.text, 30); + + return get_node_name_ov(d, true, font_size); }) .classed("dragable_node fill_fff", true) //own dragable .on("click", selected_node) @@ -4030,7 +4031,7 @@ function draw_elements_graph() { }); node_temp.append("title").text(function(d) { - return get_node_name_ov(d); + return get_node_name_ov(d, false); }); node.exit().remove(); @@ -4040,9 +4041,19 @@ function is_central_node(data) { return data.type == 0 && data.id_agent == 0; } -function get_node_name_ov(data) { +function get_node_name_ov(data, generate_link, font_size) { + font_size = font_size || 20; + generate_link = generate_link || false; + + var data_text = data.text; + + if (generate_link === true && data.networkmap_id > 0) { + data_text = `${data.text}`; + } + // Node central name should be the product name - return is_central_node(data) ? $("#hidden-product_name").val() : data.text; + return is_central_node(data) ? $("#hidden-product_name").val() : data_text; } function choose_group_for_show_agents() {