From 2ede05729856c567b05c09d5884859240478c5b7 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 13 Jun 2017 16:49:25 +0200 Subject: [PATCH] Add data image option to simple data visual console element - #412 --- .../general/check_image_module.php | 25 ++++ .../visual_console_builder.editor.js | 127 +++++++++++++++++- .../images/console/signes/data_image.png | Bin 0 -> 13215 bytes .../ajax/visual_console_builder.ajax.php | 2 + .../include/functions_visual_map.php | 56 +++++--- .../include/functions_visual_map_editor.php | 4 +- .../operation/visual_console/render_view.php | 2 +- 7 files changed, 190 insertions(+), 26 deletions(-) create mode 100644 pandora_console/general/check_image_module.php create mode 100644 pandora_console/images/console/signes/data_image.png diff --git a/pandora_console/general/check_image_module.php b/pandora_console/general/check_image_module.php new file mode 100644 index 0000000000..422b1de7ba --- /dev/null +++ b/pandora_console/general/check_image_module.php @@ -0,0 +1,25 @@ + + + diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 229ceeaa86..798d330196 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -84,6 +84,45 @@ function visual_map_main() { //Fixed to wait the load of images. $(window).load(function() { + $('#module').change(function(){ + var txt = $("#module").val(); + if(selectedItem == 'simple_value' || creationItem == 'simple_value'){ + $.ajax({ + async:false, + type: "POST", + url: "ajax.php", + data: {"page" : "general/check_image_module", + "get_image" : txt, + }, + success: function(data) { + if(data == 0){ + $("#data_image_check").html('Off'); + $('#data_image_container').css('display','none'); + $('#data_image_check').css('display','none'); + $('#data_image_check_label').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != '0'){ + $('#period_row').css('display','table-row'); + } + } + else{ + $('#data_image_container').css('display','inline'); + $('#data_image_check').css('display','inline'); + $('#data_image_check_label').css('display','inline'); + $("#data_image_check").html('On'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + $('#text-label_ifr').contents().find('#tinymce').html('_VALUE_'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + } + } + }); + } + }); + + $('#radiobtn0001').click(function(){ $("#custom_graph option[value=0]").prop("selected", true); }); @@ -338,10 +377,32 @@ function update_button_palette_callback() { setModuleGraph(idItem); break; case 'simple_value': - $("#text_" + idItem).html(values['label']); + //checkpoint + if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' || + $('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_') + && $('#data_image_check').html() != 'On'){ + alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.'); + return; + } + $("#" + idItem).html(values['label']); + if(values['label'].replace( /<.*?>/g, '' ) == '_VALUE_'){ + $("#text_" + idItem).html(''); + $("#" + idItem).html(''); + } + else{ + $("#text_" + idItem).html( + '
'+values["label"]+'
' + ) + $("#" + idItem).html( + '
'+values["label"]+'
' + ) + + } + + //$("#simplevalue_" + idItem) //.html($('').attr('src', "images/spinner.gif")); - setModuleValue(idItem,values['process_simple_value'], values['period']); + setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']); break; case 'label': $("#text_" + idItem).html(values['label']); @@ -489,6 +550,10 @@ function readFields() { values['background'] = $("#background_image").val(); values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val(); values['width'] = $("input[name=width]").val(); + values['width_data_image'] = $("#data_image_width").val(); + if(values['width_data_image'] != 0){ + values['width'] = values['width_data_image']; + } values['height'] = $("input[name=height]").val(); values['parent'] = $("select[name=parent]").val(); values['map_linked'] = $("select[name=map_linked]").val(); @@ -656,6 +721,7 @@ function create_button_palette_callback() { create_line('step_1', values); break; default: + insertDB(creationItem, values); break; } @@ -933,6 +999,14 @@ function toggle_item_palette() { $( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val()); } + + if(creationItem != 'simple_value'){ + $("#data_image_check").html('Off'); + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $("#data_image_container").css('display','none'); + $('.block_tinymce').remove(); + } } function fill_parent_select(id_item) { @@ -1655,12 +1729,13 @@ function setModuleGraph(id_data) { } -function setModuleValue(id_data, process_simple_value, period) { +function setModuleValue(id_data, process_simple_value, period,width_data_image) { var parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_value"}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "period", value: period}); + parameter.push ({name: "width", value: width_data_image}); parameter.push ({name: "id_visual_console", value: id_visual_console}); if (process_simple_value != undefined) { parameter.push ({name: "process_simple_value", value: process_simple_value}); @@ -1672,7 +1747,9 @@ function setModuleValue(id_data, process_simple_value, period) { type: "POST", dataType: 'json', success: function (data) { - var currentValue = $("#text_" + id_data).html(); + + var currentValue = $("#text_" + id_data).html(); + //currentValue = currentValue.replace(/_VALUE_/gi, data.value); $("#text_" + id_data).html(currentValue); //$("#text_" + id_data).html('Data value'); @@ -2183,10 +2260,14 @@ function createItem(type, values, id_data) { case 'simple_value': sizeStyle = ''; imageSize = ''; + if($('#data_image_check').html() == 'On'){ + values['label'] = ''; + + } item = $('
' + ' ' + values['label'] + ' ' + '
' ); - setModuleValue(id_data,values.process_simple_value,values.period); + setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image); break; case 'label': item = $('
0){ + $("#data_image_check").css('display','inline'); + $("#data_image_check_label").css('display','inline'); + $('#data_image_container').css('display','inline'); + $("#data_image_check").html('On'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + } + else{ + $("#data_image_check").html('Off'); + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $('#data_image_container').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != 0){ + $('#period_row').css('display','table-row'); + } + } + } + else{ + $("#data_image_check").css('display','none'); + $("#data_image_check_label").css('display','none'); + $('#data_image_container').css('display','none'); + } + }); //Set the limit of draggable in the div with id "background" and set drag diff --git a/pandora_console/images/console/signes/data_image.png b/pandora_console/images/console/signes/data_image.png new file mode 100644 index 0000000000000000000000000000000000000000..e3542c1ea329e5974eb533c7bb76790c6bcb567a GIT binary patch literal 13215 zcmW+-V{|3m5{+%!$;6o(+qN;WZQGdG#>93enb@{9v7H-E{OGfU|>O^U|=s_pz|3RnEQ7yuyZ3YFy2fsFkHuE!(mAvzB2vbY{EUh zyjg|9lLwGns_ZZ7ZkonM>FH(YJ(P4fY?ZX=d*Vc#Fglrm_iQnqaa=4#^KAC=Zkm)7 z4DaC<-wKPr$sxfD7%_Sd2;lTH$heV;>3aK2v}uqnOfFU)Z`>EM6wo`En^Sii+dG7Q zLYDtjVdxV|A}KFWhQ=#CjdT2_4h{y`+a1A#GhS3Cglmj5C?_2~HA;xE@BU@7X@c^u)JUzmT4aUR2hN^<^U> z;+HcVb+D_3TwVW(hLbbRTOQF&W|Av!$#Xu9_IZO@D%N665hk2Nv%#)HGh_r7Dohq8 ze3lroEq-=e-{)AO%^2WBbkenwT~WPk^TY!3`PWz1vVtw92worX>r#-i<8M4vXXN*jF)yPPap+_<}9^ZP}lb?ArhMy+PGE^`r9 z^lNjafgDbTqpREgUD=NN0sLUYI&QMUaVGtg(;u&-vwi6JtFD3Ca%$P)W;pVF5!Hoa z(~YiomyFq~RX=U-{-63>(z2wcS_cvY)8FLda}V}Z^FChKq@{)v_`m)HCDU#D1x^Jg zHHV7Gnx4>^JvmwV;n;_Gp)2|P_2yW$9ly!{Yq@h<`7bdZ{?lsw`f9Wd>NA>qVAuqG zK&0Jz;U{DM!Pc1H^x@gLQ!cB4yI1Uym+zf{w+k^=J2B8CXePsuEqy zB5(H}Q#lPJlbraiarHsl;;4e2IK(U{%1MNum4@#HQF`933DI2&v3IZS^S)tppY&mJ zyOU@{y}z@S#{o3ZHm5$`nJ?{xUxDa*cRLe1&h}|J`r|#IrZ^n z@ne;~gibsHYYQe$rvk6HU`Ln)s&YekD_O*P_t4ED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c7pVGm}uc+fr_S#e-aM)L9{%w{lxX4|4PHK*5l34lAM!-MO*~W6&yRC5k`z zRdwz$_}w6C*km&vtfacyHpep?8P0!G1F?yE-AxOot{-*1fXIr;H4)+O!c* z3bhgJm0dyC25*F?->5+wOM+A%YeqSu6#SEKP;t z&QWEqBbPjWIGA0gA(zZ9nr==dGr`2r;o+aGi{(1G5n(*Hx%nnj~v6Vh;v07dAnp{;?{|6-G<+mH}hhAXd zS01SEN3WsLd%``#s)FSkf2|V_PK6Ugyl2HO%ZO84Q4yuhST=0Zs1LG>yRq?JOn7)W zgI=c~{D%oUfj)7}u*a|o!2Xv#sl$ciGx^63*cFecDI69y3g|}*Fc}F&@j6kXkpBS| CY=8v- literal 0 HcmV?d00001 diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 2a786200ad..efc5267119 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -422,6 +422,7 @@ switch ($action) { $values['type'] = visual_map_get_simple_value_type( $process_simple_value); $values['period'] = $period; + $values['width'] = $width; } case 'percentile_bar': case 'percentile_item': @@ -897,6 +898,7 @@ switch ($action) { //This allows min, max and avg process in a simple value $values['type'] = visual_map_get_simple_value_type($process_simple_value); $values['period'] = $period; + $values['width'] = $width; break; case 'label': $values['type'] = LABEL; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 60125340ff..6967633915 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1438,17 +1438,25 @@ function visual_map_print_item($mode = "read", $layoutData, if(get_parameter('action') == 'edit'){ - - //echo 'Data value'; - - echo $io_safe_output_text; + //html_debug($layoutData); + //echo 'Data value'; + if(strip_tags($io_safe_output_text) != '_VALUE_'){ + echo $io_safe_output_text; + } + else{ + echo ""; + } } else{ - - echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); - + if(strip_tags($io_safe_output_text) != '_VALUE_'){ + echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); } + else{ + echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value); + } + + } //Restore db connection @@ -1575,6 +1583,8 @@ function visual_map_get_simple_value_type($process_simple_value) { function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) { global $config; + + $unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module); $unit_text = trim(io_safe_output($unit_text)); @@ -1583,23 +1593,35 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) case SIMPLE_VALUE: $value = db_get_value ('datos', 'tagente_estado', 'id_agente_modulo', $id_module); + + if ($value === false) { $value = __('Unknown'); + + $value = preg_replace ('/\n/i','
',$value); + $value = preg_replace ('/\s/i',' ',$value); } else { - if ( is_numeric($value) ) { - if ($config['simple_module_value']) { - $value = remove_right_zeros(number_format($value, $config['graph_precision'])); + if(strpos($value, 'data:image') !== false){ + $value = ''; + } + else{ + + if ( is_numeric($value) ) { + if ($config['simple_module_value']) { + $value = remove_right_zeros(number_format($value, $config['graph_precision'])); + } } + if (!empty($unit_text)) { + $value .= " " . $unit_text; + } + + $value = preg_replace ('/\n/i','
',$value); + $value = preg_replace ('/\s/i',' ',$value); + } - if (!empty($unit_text)) { - $value .= " " . $unit_text; - } + } - - $value = preg_replace ('/\n/i','
',$value); - $value = preg_replace ('/\s/i',' ',$value); - return $value; break; case SIMPLE_VALUE_MAX: diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 83f7c99a81..c145b08f88 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -310,8 +310,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['module_row']['html'] = '' . __('Module') . ' ' . - html_print_select(array(), 'module', '', '', __('Any'), 0, true) . - ''; + html_print_select(array(), 'module', '', '', __('Any'), 0, true). ' + '; $form_items['type_graph'] = array(); diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 79101d82ee..550be5504a 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -278,7 +278,7 @@ $ignored_params['refr'] = ''; $(".overlay").removeClass("overlay").addClass("overlaydisabled"); - $('.item:not(.icon) img').each( function() { + $('.item:not(.icon) img:not(.b64img)').each( function() { if ($(this).css('float')=='left' || $(this).css('float')=='right') { $(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px'); $(this).css('margin-left','');