diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 112e0419da..129151ca0f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -4283,6 +4283,10 @@ sub init_module ($) { $module->{'alert_template'} = undef; $module->{'filter'} = undef; $module->{'absoluteinterval'} = undef; + $module->{'each_ff'} = undef; + $module->{'min_ff_event_normal'} = undef; + $module->{'min_ff_event_warning'} = undef; + $module->{'min_ff_event_critical'} = undef; } ################################################################################ diff --git a/pandora_console/extras/mr/68.sql b/pandora_console/extras/mr/68.sql index ea4bf2a2a1..db168d5c22 100644 --- a/pandora_console/extras/mr/68.sql +++ b/pandora_console/extras/mr/68.sql @@ -43,12 +43,18 @@ ALTER TABLE `tmerge_queries` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_09 -- Update version for plugin oracle UPDATE `tdiscovery_apps` SET `version` = '1.2' WHERE `short_name` = 'pandorafms.oracle'; +ALTER TABLE `tevent_sound` MODIFY COLUMN `name` text NULL; +ALTER TABLE `tevent_sound` MODIFY COLUMN `sound` text NULL; +ALTER TABLE `treport_content` MODIFY COLUMN `use_prefix_notation` tinyint unsigned NOT NULL DEFAULT 1; +ALTER TABLE `treport_content_template` MODIFY COLUMN `use_prefix_notation` tinyint unsigned NOT NULL DEFAULT 1; +ALTER TABLE `tsesion_filter` MODIFY COLUMN `id_name` text NULL; +ALTER TABLE `tsesion_filter` MODIFY COLUMN `ip` text NULL; +ALTER TABLE `tsesion_filter` MODIFY COLUMN `type` text NULL; +ALTER TABLE `tsesion_filter` MODIFY COLUMN `user` text NULL; ALTER TABLE `tncm_agent_data` ADD COLUMN `id_agent_data` int not null default 0 AFTER `script_type`; - ALTER TABLE `tusuario` CHANGE COLUMN `metaconsole_data_section` `metaconsole_data_section` TEXT NOT NULL DEFAULT '' ; - ALTER TABLE `tmensajes` ADD COLUMN `icon_notification` VARCHAR(250) NULL DEFAULT NULL AFTER `url`; -COMMIT; +COMMIT; \ No newline at end of file diff --git a/pandora_console/include/javascript/datatablesFunction.js b/pandora_console/include/javascript/datatablesFunction.js index b517830ce9..dae44dd6b1 100644 --- a/pandora_console/include/javascript/datatablesFunction.js +++ b/pandora_console/include/javascript/datatablesFunction.js @@ -1,3 +1,5 @@ +/* global $ */ + var dt = dt; var config = config; @@ -141,6 +143,8 @@ if (dt.no_move_elements_to_action === true) { noMoveElementsToAction = true; } +var showAlwaysPagination = false; + $(document).ready(function() { function checkPages() { if (dt_table.page.info().pages > 1) { @@ -253,7 +257,11 @@ $(document).ready(function() { $("div.pagination-child-div").hide(); $("div.dataTables_info").hide(); $(`#${dt.id}_wrapper`).hide(); - $(`.action_buttons_right_content .pagination-child-div`).hide(); + if (showAlwaysPagination) { + $(`.action_buttons_right_content .pagination-child-div`).show(); + } else { + $(`.action_buttons_right_content .pagination-child-div`).hide(); + } } else { $(`.datatable-msg-info-${dt.id}`).hide(); $(`table#${dt.id}`).show(); @@ -283,6 +291,12 @@ $(document).ready(function() { $(`#${dt.form_id}_loading`).remove(); } + if (json.showAlwaysPagination) { + showAlwaysPagination = true; + } else { + showAlwaysPagination = false; + } + if (json.error) { console.error(json.error); $(`#error-${dt.id}`).html(json.error); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 0aa774ed9c..4e2582bb5a 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1229,46 +1229,51 @@ if (is_ajax() === true) { } } - $no_return = false; + $regex_validation = false; if (empty($tmp) === false && $regex !== '') { - $regex_validation = false; foreach (json_decode(json_encode($tmp), true) as $key => $field) { + if ($key === 'b64') { + continue; + } + + $field = strip_tags($field); + if (preg_match('/'.$regex.'/', $field)) { $regex_validation = true; } } - if ($regex_validation === false) { - $no_return = true; + if ($regex_validation === true) { + $carry[] = $tmp; } + } else { + $carry[] = $tmp; } - if ($no_return === false) { - $carry[] = $tmp; - return $carry; - } else { - return; - } + return $carry; } ); } - $data = array_values( - array_filter( - ($data ?? []), - function ($item) { - return (bool) (array) $item; - } - ) - ); - $count = count($data); + if ($regex !== '') { + $data = array_values( + array_filter( + ($data ?? []), + function ($item) { + return (bool) (array) $item; + } + ) + ); + } + // RecordsTotal && recordsfiltered resultados totales. echo json_encode( [ - 'data' => ($data ?? []), - 'buffers' => $buffers, - 'recordsTotal' => $count, - 'recordsFiltered' => $count, + 'data' => ($data ?? []), + 'buffers' => $buffers, + 'recordsTotal' => $count, + 'recordsFiltered' => $count, + 'showAlwaysPagination' => (empty($regex) === false) ? true : false, ] ); } catch (Exception $e) { @@ -2122,7 +2127,7 @@ $in .= $data.''; $inputs[] = $in; // REGEX search datatable. -$in = '
'; +$in = '
'; $in .= html_print_input_text('regex', $regex, '', '', 255, true); $in .= '
'; $inputs[] = $in;