diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 03841a342e..95b1c05725 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1178,6 +1178,7 @@ function readFields() { values["timezone"] = $("select[name=timezone]").val(); values["clock_animation"] = $("select[name=clock_animation]").val(); values["show_last_value"] = $("select[name=last_value]").val(); + values["cache_expiration"] = $("select[name=cache_expiration]").val(); // Color Cloud values if (selectedItem == "color_cloud" || creationItem == "color_cloud") { @@ -1221,7 +1222,6 @@ function readFields() { function create_button_palette_callback() { var values = readFields(); - //VALIDATE DATA var validate = true; switch (creationItem) { @@ -2209,6 +2209,10 @@ function loadFieldsFromDB(item) { }); } + if (key == "cache_expiration") { + $("select[name=cache_expiration]").val(val); + } + if (key == "value_show") { $("select[name=value_show]").val(val); } diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 82c21eae8b..0733161c61 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -176,6 +176,7 @@ $default_color = get_parameter('default_color', '#FFFFFF'); $color_range_from_values = get_parameter('color_range_from_values', []); $color_range_to_values = get_parameter('color_range_to_values', []); $color_range_colors = get_parameter('color_range_colors', []); +$cache_expiration = get_parameter('cache_expiration', 0); switch ($action) { case 'get_font': @@ -580,6 +581,7 @@ switch ($action) { $values['label_position'] = $label_position; $values['show_on_top'] = $show_on_top; + $values['cache_expiration'] = $cache_expiration; // In Graphs, background color is stored in column image (sorry) if ($type == 'module_graph') { @@ -997,6 +999,7 @@ switch ($action) { unset($values['id_layout_linked']); unset($values['element_group']); unset($values['id_layout_linked_weight']); + unset($values['cache_expiration']); // Don't change background color in graphs when move switch ($type) { case 'group_item': @@ -1406,6 +1409,7 @@ switch ($action) { $values['type_graph'] = $type_graph; $values['id_custom_graph'] = $id_custom_graph; + $values['cache_expiration'] = $cache_expiration; switch ($type) { case 'line_item': diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 5cf5121e55..eb5842d217 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1128,7 +1128,35 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) true ).''; - // Insert and modify before the buttons to create or update. + $interval = []; + $interval[0] = __('No cache'); + $interval[10] = '10 '.__('seconds'); + $interval[30] = '30 '.__('seconds'); + $interval[60] = '1 '.__('minutes'); + $interval[300] = '5 '.__('minutes'); + $interval[900] = '15 '.__('minutes'); + $interval[1800] = '30 '.__('minutes'); + $interval[3600] = '1 '.__('hour'); + + $form_items_advance['cache_expiration_row'] = []; + $form_items_advance['cache_expiration_row']['items'] = [ + 'group_item', + 'static_graph', + 'percentile_bar', + 'percentile_item', + 'module_graph', + 'simple_value', + 'label', + 'icon', + 'datos', + 'auto_sla_graph', + 'bars_graph', + 'donut_graph', + ]; + $form_items_advance['cache_expiration_row']['html'] = ''.__('Cache expiration').' + '.html_print_select($interval, 'cache_expiration', $jeje, '', '', '0', 10, false, false, false).''; + + // Insert and modify before the buttons to create or update. if (enterprise_installed()) { enterprise_visual_map_editor_modify_form_items_advance_palette($form_items_advance); }