diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 022e705b5e..d9a56fe2ba 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2010-06-29 Sergio Martin + + * godmode/reporting/visual_console_builder.php + godmode/reporting/visual_console_builder.editor.js: + Fixed the setting of original size by javascript when you + choose 0 x 0 in the visual map background for Bug: 3020721 + 2010-06-29 Junichi Satoh * pandora_console_install: Added support for FreeBSD and RHEL/CentOS. diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 7a5570f6d6..30dca8f7b0 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -122,6 +122,7 @@ function updateAction() { case 'background': $("#background").css('width', values['width']); $("#background").css('height', values['height']); + $("#background").css('background', 'url(images/console/background/' + values['background'] + ')'); var idElement = 0; break; @@ -662,8 +663,14 @@ function updateDB(type, idElement , values) { refresh_lines(lines, 'background'); break; case 'background': - $("#background").css('width', values['width'] + 'px'); - $("#background").css('height', values['height'] + 'px'); + if(values['width'] == '0' || values['height'] == '0'){ + $("#background").css('width', $("#hidden-background_width").val() + 'px'); + $("#background").css('height', $("#hidden-background_height").val() + 'px'); + } + else { + $("#background").css('width', values['width'] + 'px'); + $("#background").css('height', values['height'] + 'px'); + } break; } } @@ -1012,4 +1019,4 @@ function showPreviewStaticGraph(staticGraph) { $("#preview").append(""); $("#preview").append(""); } -} \ No newline at end of file +} diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 596b8cd2fd..b79e1adcaf 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -95,6 +95,13 @@ switch ($activeTab) { $background = get_parameter('background'); $width = get_parameter('width'); $height = get_parameter('height'); + + if($width == 0 && $height == 0) { + $sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background); + $width = $sizeBackground[0]; + $height = $sizeBackground[1]; + } + process_sql_update('tlayout', array('background' => $background, 'width' => $width, 'height' => $height), array('id' => $idVisualConsole)); @@ -142,6 +149,13 @@ switch ($activeTab) { $range = (int) get_parameter ("range", 50); $width = (int) get_parameter ("width", 0); $height = (int) get_parameter ("height", 0); + + if($width == 0 && $height == 0) { + $sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background); + $width = $sizeBackground[0]; + $height = $sizeBackground[1]; + } + $message = ''; if ($name_modules[0] == '0') $message .= process_wizard_add ($id_agents, $image, $idVisualConsole, $range, $width, $height); diff --git a/pandora_console/include/Image/image_functions.php b/pandora_console/include/Image/image_functions.php index e1056cedec..98f10ecb66 100644 --- a/pandora_console/include/Image/image_functions.php +++ b/pandora_console/include/Image/image_functions.php @@ -37,15 +37,21 @@ if (isset($_GET['getFile'])) { $fileTemp = sys_get_temp_dir() . "/tumb_" . $newWidth . "x" . $newHeight . "_" . $fileName; + $protocol = 'http'; + if(!empty($_SERVER['HTTPS'])) + $protocol .= 's'; + $protocol .= '://'; + if (is_file($fileTemp)) { if (!is_readable($fileTemp)) { $fileTemp = sys_get_temp_dir() . "/tumb_" . $newWidth . "x" . $newHeight . "_" . uniqid() . "_" . $fileName; - createthumb( $_SERVER['DOCUMENT_ROOT'] . $file, $fileTemp,$newWidth,$newHeight); + createthumb($protocol.$_SERVER['SERVER_NAME'] . $file, $fileTemp,$newWidth,$newHeight); } } - else createthumb( $_SERVER['DOCUMENT_ROOT'] . $file, $fileTemp,$newWidth,$newHeight); + else createthumb($protocol.$_SERVER['SERVER_NAME'] . $file, $fileTemp,$newWidth,$newHeight); getFile($fileName, $fileTemp); unlink($fileTemp); + echo $protocol.$_SERVER['SERVER_NAME'] . $file; } } //END Lines of code for direct url call script