2010-06-29 Sergio Martin <sergio.martin@artica.es>

* 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



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2931 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-06-29 10:52:58 +00:00
parent fb9731bd76
commit 55682bc536
4 changed files with 39 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2010-06-29 Sergio Martin <sergio.martin@artica.es>
* 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 <junichi@rworks.jp>
* pandora_console_install: Added support for FreeBSD and RHEL/CentOS.

View File

@ -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("<img src='" + imgBase + "_warning.png' />");
$("#preview").append("<img src='" + imgBase + ".png' />");
}
}
}

View File

@ -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);

View File

@ -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