diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php
index 3fc747d266..deecb29ab7 100644
--- a/pandora_console/godmode/reporting/visual_console_builder.data.php
+++ b/pandora_console/godmode/reporting/visual_console_builder.data.php
@@ -107,12 +107,16 @@ $table->data[0][1] = html_print_input_text('name', $visualConsoleName,
$table->rowspan[0][2] = 6;
if ($action == 'new') {
- $table->data[0][2] = '
data[0][2] = '
';
+ $table->data[0][2] .= '
';
}
else {
- $table->data[0][2] = '
data[0][2] = '
';
+ $table->data[0][2] .= '
';
}
$table->data[1][0] = __('Group:');
@@ -161,7 +165,7 @@ $table->data[5][1] .= '' .
$table->data[5][1] .= '
';
if ($action == 'new') {
@@ -189,6 +193,9 @@ echo "";
$(document).ready (function () {
+ $('#imagen').attr('src','images/console/background/'+$('#background').val());
+ $('#imagen2').attr('src','images/console/background/'+$('#background').val());
+
$("#modsize").click(function(event){
event.preventDefault();
@@ -197,31 +204,69 @@ $(document).ready (function () {
}
if ($('#imagen').attr('src') != '') {
- $('input[name=width]').val($('#imagen').width());
- $('input[name=height]').val($('#imagen').height());
+
+ if (parseInt($('#imagen').width()) < 1024){
+ alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
+ $('input[name=width]').val('1024');
+ }
+ else{
+ $('input[name=width]').val($('#imagen').width());
+ }
+ if (parseInt($('#imagen').height()) < 768){
+ alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
+ $('input[name=height]').val('768');
+ }
+ else{
+ $('input[name=height]').val($('#imagen').height());
+ }
+
}
});
$("#getsize").click(function(event){
event.preventDefault();
- $('input[name=width]').val($('#imagen').width());
- $('input[name=height]').val($('#imagen').height());
+
+ if (parseInt($('#imagen').width()) < 1024){
+ alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
+ $('input[name=width]').val('1024');
+ }
+ else{
+ $('input[name=width]').val($('#imagen').width());
+ }
+ if (parseInt($('#imagen').height()) < 768){
+ alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
+ $('input[name=height]').val('768');
+ }
+ else{
+ $('input[name=height]').val($('#imagen').height());
+ }
+
+ });
+
+ $( "input[type=submit]" ).click(function( event ) {
+ if($( "#getsize" ).css('visibility')=='hidden'){
+ if (parseInt($('#imagen').width()) < 1024){
+ $('input[name=width]').val('1024');
+ }
+ else{
+ $('input[name=width]').val($('#imagen').width());
+ }
+ if (parseInt($('#imagen').height()) < 768){
+ $('input[name=height]').val('768');
+ }
+ else{
+ $('input[name=height]').val($('#imagen').height());
+ }
+ }
});
$("#background").change(function() {
$('#imagen').attr('src','images/console/background/'+$('#background').val());
- $('#imagen').width(230);
- $('#imagen').show();
+ $('#imagen2').attr('src','images/console/background/'+$('#background').val());
+ $('#imagen2').width(230);
+ $('#imagen2').show();
});
- $( "input[type=submit]" ).click(function( event ) {
- if($( "#getsize" ).css('visibility')=='hidden'){
- $('input[name=width]').val($('#imagen').width());
- $('input[name=height]').val($('#imagen').height());
- }
- });
-
-
$("#file-background_image").change(function(){
readURL(this);
});
@@ -231,8 +276,9 @@ $(document).ready (function () {
var reader = new FileReader();
reader.onload = function (e) {
$('#imagen').attr('src', e.target.result);
- $('#imagen').width(230);
- $('#imagen').show();
+ $('#imagen2').attr('src', e.target.result);
+ $('#imagen2').width(230);
+ $('#imagen2').show();
}
reader.readAsDataURL(input.files[0]);
}
diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index 44a047d42a..448815f9da 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -174,6 +174,12 @@ function update_button_palette_callback() {
// TODO VALIDATE DATA
switch (selectedItem) {
case 'background':
+
+ if(values['width'] < 1024 || values['height'] < 768){
+ alert('Please min size recommend is 1024x768');
+ return false;
+ }
+
if(values['width'] == 0 && values['height'] == 0) {
values['width'] =
$("#hidden-background_original_width").val();
@@ -972,8 +978,8 @@ function loadFieldsFromDB(item) {
}
if (key == 'type_graph') {
- $("select[name=type_graph]").val(val);
- }
+ $("select[name=type_graph]").val(val);
+ }
if (key == 'label_position') {
$('#labelposup'+" img").attr('src','images/label_up.png');
@@ -3023,6 +3029,9 @@ function eventsBackground() {
$('#background_grid').css('width', width);
$('#background_grid').css('height', height);
}
+ else{
+ updateDB('background', 0, values, 'resizestop');
+ }
if (launch_message)
alert($('#hidden-message_size').val());
}