diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 035cbe161b..281e4fdba4 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -721,7 +721,7 @@ function loadFieldsFromDB(item) { var moduleId = 0; fill_parent_select(idItem); - + jQuery.each(data, function(key, val) { if (key == 'background') $("#background_image").val(val); @@ -1295,6 +1295,7 @@ function setModuleValue(id_data, process_simple_value, period) { if (process_simple_value != undefined) { parameter.push ({name: "process_simple_value", value: process_simple_value}); } + jQuery.ajax({ url: get_url_ajax(), data: parameter, @@ -1302,7 +1303,7 @@ function setModuleValue(id_data, process_simple_value, period) { dataType: 'json', success: function (data) { - $("#simplevalue_" + id_data).html(data['value']); + $("#simplevalue_" + id_data).text(data.value); } }); } @@ -1605,11 +1606,11 @@ function createItem(type, values, id_data) { case 'simple_value': sizeStyle = ''; imageSize = ''; - item = $('
' + - ' ' + values['label'] + ' ' + + ' ' + values['label'] + ' ' + ''+ '
' ); + setModuleValue(id_data,values.process_simple_value,values.period); break; case 'label': item = $('
$id_element)); + echo (int)$result; break; } diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 2789f2fe80..4a6c3cbdea 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -957,20 +957,21 @@ function visual_map_print_item($mode = "read", $layoutData, $unit_text = trim(io_safe_output($unit_text)); - $value = db_get_value ('datos', - 'tagente_estado', 'id_agente_modulo', $layoutData['id_agente_modulo']); + //$value = db_get_value ('datos', + //'tagente_estado', 'id_agente_modulo', $layoutData['id_agente_modulo']); + $value = visual_map_get_simple_value($type, + $layoutData['id_agente_modulo'], $period); // If the value is a string, dont format it if (!is_string($value)) { $value = format_for_graph($value, 2); } - + /* if (!empty($unit_text)) $value .= " " . $unit_text; - - if (strstr($io_safe_output_text, "(_VALUE_)") === false) { - echo ' ' . $value . ''; - } + */ + echo ' ' . $value . ''; + //Restore db connection if ($layoutData['id_metaconsole'] != 0) {