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 b20dc8ca89..4a0fa19d2e 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -84,7 +84,46 @@ 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('
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 0000000000..e3542c1ea3
Binary files /dev/null and b/pandora_console/images/console/signes/data_image.png differ
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 42772adf28..e2e01a21d6 100755
--- a/pandora_console/include/functions_visual_map_editor.php
+++ b/pandora_console/include/functions_visual_map_editor.php
@@ -314,8 +314,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). '
'.__("Data image").': Off - Width:
+ ';
$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 001644ac2a..4364bfda9f 100755
--- a/pandora_console/operation/visual_console/render_view.php
+++ b/pandora_console/operation/visual_console/render_view.php
@@ -280,7 +280,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','');