diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2f19809fc8..b6ef0080c0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2013-05-23 Miguel de Dios <miguel.dedios@artica.es> + + * include/javascript/pandora_visual_console.js, + include/functions_visual_map.php: fixed to show the lines between + the items in the visualmap into a dashboard. + + Fixes: #2232 + + MERGED FROM THE BRANCH 4 + 2013-05-21 Ramon Novoa <rnovoa@artica.es> * include/functions_netflow.php: Added support for multiple netflow diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 5e036c7f1d..ffe873b3db 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1684,6 +1684,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line on body load, where id_div is the id of the div which holds the map */ echo '<script type="text/javascript">/* <![CDATA[ */'."\n"; + if ($resizedMap) { + echo 'var resize_map = 1;'."\n"; + } + else { + echo 'var resize_map = 0;'."\n"; + } + echo 'var lines = Array ();'."\n"; foreach ($lines as $line) { diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index 365f537d1d..86fbcc99b4 100644 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -30,30 +30,61 @@ function draw_line (line, id_div, editor) { brush.setStroke (1); brush.setColor (line['color']); + have_node_begin_img = $('#'+line['node_begin'] + " img").length; + have_node_end_img = $('#'+line['node_end'] + " img").length; + if (line['x1']) { x1 = line['x']; } else { - x1 = parseInt ($('#'+line['node_begin']).css (selector + 'left')) + ($('#'+line['node_begin']).width() / 2); + if (resize_map && have_node_begin_img) { + width = parseInt($('#'+line['node_begin'] + " img").css('width')); + } + else { + width = $('#'+line['node_begin']).width(); + } + x1 = parseInt($('#'+line['node_begin']).css (selector + 'left')) + (width / 2); } + if (line['y1']) { y1 = line['y1']; } else { - y1 = parseInt ($('#'+line['node_begin']).css (selector + 'top')) + ($('#'+line['node_begin']).height() / 2); + if (resize_map && have_node_begin_img) { + height = parseInt($('#'+line['node_begin'] + " img").css('height')); + } + else { + height = $('#'+line['node_begin']).height(); + } + y1 = parseInt($('#'+line['node_begin']).css (selector + 'top')) + (height / 2); } + if (line['x2']) { x2 = line['x2']; } else { - x2 = parseInt ($('#'+line['node_end']).css (selector + 'left')) + ($('#'+line['node_end']).width() / 2); + if (resize_map && have_node_end_img) { + width = parseInt($('#'+line['node_end'] + " img").css('width')); + } + else { + width = $('#'+line['node_end']).width(); + } + x2 = parseInt($('#'+line['node_end']).css (selector + 'left')) + (width / 2); } + if (line['y2']) { y2 = line['y2']; } else { - y2 = parseInt ($('#'+line['node_end']).css (selector + 'top')) + ($('#'+line['node_end']).height() / 2); + if (resize_map && have_node_end_img) { + height = parseInt($('#'+line['node_end'] + " img").css('height')); + } + else { + height = $('#'+line['node_end']).height(); + } + y2 = parseInt($('#'+line['node_end']).css (selector + 'top')) + (height / 2); } + brush.drawLine (x1, y1, x2, y2); brush.paint (); }