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




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8201 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-05-23 16:59:08 +00:00
parent 127ec26d4a
commit 29d35e41ba
3 changed files with 52 additions and 4 deletions

View File

@ -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> 2013-05-21 Ramon Novoa <rnovoa@artica.es>
* include/functions_netflow.php: Added support for multiple netflow * include/functions_netflow.php: Added support for multiple netflow

View File

@ -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 */ on body load, where id_div is the id of the div which holds the map */
echo '<script type="text/javascript">/* <![CDATA[ */'."\n"; 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"; echo 'var lines = Array ();'."\n";
foreach ($lines as $line) { foreach ($lines as $line) {

View File

@ -30,30 +30,61 @@ function draw_line (line, id_div, editor) {
brush.setStroke (1); brush.setStroke (1);
brush.setColor (line['color']); 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']) { if (line['x1']) {
x1 = line['x']; x1 = line['x'];
} }
else { 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']) { if (line['y1']) {
y1 = line['y1']; y1 = line['y1'];
} }
else { 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']) { if (line['x2']) {
x2 = line['x2']; x2 = line['x2'];
} }
else { 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']) { if (line['y2']) {
y2 = line['y2']; y2 = line['y2'];
} }
else { 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.drawLine (x1, y1, x2, y2);
brush.paint (); brush.paint ();
} }