' .
+ __('Any monitors aren\'t with this filter.') . '
';
+ }
+ else {
+ echo '' .
+ __('This agent doesn\'t have any active monitors.') . '
';
+ }
+ }
+ else {
+ $url = "index.php?" .
+ "sec=estado&" .
+ "sec2=operation/agentes/ver_agente&" .
+ "id_agente=" . $id_agente . "&" .
+ "refr=&filter_monitors=1&" .
+ "status_filter_monitor=" . $status_filter_monitor . "&" .
+ "status_text_monitor=" . $status_text_monitor;
+
+ if ($paginate_module) {
+ ui_pagination ($count_modules, false, 0, 0, false, 'offset',
+ true, '',
+ "pagination_list_modules(offset_param)",
+ array('count' => '', 'offset' => 'offset_param'));
+ }
+
+ html_print_table ($table);
+
+ if ($paginate_module) {
+ ui_pagination ($count_modules, false, 0, 0, false, 'offset',
+ true, '',
+ "pagination_list_modules(offset_param)",
+ array('count' => '', 'offset' => 'offset_param'));
+ }
+ }
+
+ unset ($table);
+ unset ($table_data);
+
+
+
}
?>
\ No newline at end of file
diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
old mode 100644
new mode 100755
index a9194f9908..ecc77c7e30
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -1550,7 +1550,9 @@ function ui_process_page_body ($string, $bitfield) {
*/
function ui_pagination ($count, $url = false, $offset = 0,
$pagination = 0, $return = false, $offset_name = 'offset',
- $print_total_items = true, $other_class = '') {
+ $print_total_items = true, $other_class = '',
+ $script = "",
+ $parameter_script = array('count' => '', 'offset' => 'offset_param')) {
global $config;
@@ -1624,9 +1626,24 @@ function ui_pagination ($count, $url = false, $offset = 0,
// Show GOTO FIRST PAGE button
if ($number_of_pages > $block_limit) {
- $output .= " ";
+
+ if (!empty($script)) {
+ $script_modified = $script;
+ $script_modified = str_replace(
+ $parameter_script['count'], $count, $script_modified);
+ $script_modified = str_replace(
+ $parameter_script['offset'], 0, $script_modified);
+
+ $output .= " ";
+ }
+ else {
+ $output .= " ";
+ }
}
// Show PREVIOUS PAGE GROUP OF PAGES
@@ -1637,9 +1654,24 @@ function ui_pagination ($count, $url = false, $offset = 0,
// Result << < 5 - 6 - 7 - 8 - [9] > >>
if ($ini_page >= $block_limit) {
$offset_previous_page = ($ini_page - 1) * $pagination;
- $output .= "";
+ }
+ else {
+ $output .= "";
+ }
}
@@ -1657,7 +1689,21 @@ function ui_pagination ($count, $url = false, $offset = 0,
$offset_page = $iterator * $pagination;
- $output .= "";
+ }
+ else {
+ $output .= "";
+ }
}
//Show GOTO LAST PAGE button
if ($number_of_pages > $block_limit) {
$offset_lastpage = ($number_of_pages - 1) * $pagination;
- $output .= "";
+
+ if (!empty($script)) {
+ $script_modified = $script;
+ $script_modified = str_replace(
+ $parameter_script['count'], $count, $script_modified);
+ $script_modified = str_replace(
+ $parameter_script['offset'], $offset_lastpage, $script_modified);
+
+ $output .= "";
+ }
+ else {
+ $output .= "";
+ }
}
// End div and layout
diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php
old mode 100644
new mode 100755
index f4fa515793..7c367e26c5
--- a/pandora_console/operation/agentes/alerts_status.php
+++ b/pandora_console/operation/agentes/alerts_status.php
@@ -136,22 +136,70 @@ if ($free_search != '') {
switch ($config["dbtype"]) {
case "mysql":
$whereAlertSimple = 'AND (' .
- 'id_alert_template IN (SELECT id FROM talert_templates WHERE name LIKE "%' . $free_search . '%") OR ' .
- 'id_alert_template IN (SELECT id FROM talert_templates WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE "%' . $free_search . '%")) OR ' .
- 'talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE "%' . $free_search . '%")) OR ' .
- 'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE nombre LIKE "%' . $free_search . '%") OR ' .
- 'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (SELECT id_agente FROM tagente WHERE nombre LIKE "%' . $free_search . '%"))' .
+ 'id_alert_template IN (
+ SELECT id
+ FROM talert_templates
+ WHERE name LIKE "%' . $free_search . '%") OR ' .
+ 'id_alert_template IN (
+ SELECT id
+ FROM talert_templates
+ WHERE id_alert_action IN (
+ SELECT id
+ FROM talert_actions
+ WHERE name LIKE "%' . $free_search . '%")) OR ' .
+ 'talert_template_modules.id IN (
+ SELECT id_alert_template_module
+ FROM talert_template_module_actions
+ WHERE id_alert_action IN (
+ SELECT id
+ FROM talert_actions
+ WHERE name LIKE "%' . $free_search . '%")) OR ' .
+ 'id_agent_module IN (
+ SELECT id_agente_modulo
+ FROM tagente_modulo
+ WHERE nombre LIKE "%' . $free_search . '%") OR ' .
+ 'id_agent_module IN (
+ SELECT id_agente_modulo
+ FROM tagente_modulo
+ WHERE id_agente IN (
+ SELECT id_agente
+ FROM tagente
+ WHERE nombre LIKE "%' . $free_search . '%"))' .
')';
break;
case "postgresql":
case "oracle":
$whereAlertSimple = 'AND (' .
- 'id_alert_template IN (SELECT id FROM talert_templates WHERE name LIKE \'%' . $free_search . '%\') OR ' .
- 'id_alert_template IN (SELECT id FROM talert_templates WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE \'%' . $free_search . '%\')) OR ' .
- 'talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE \'%' . $free_search . '%\')) OR ' .
- 'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE nombre LIKE \'%' . $free_search . '%\') OR ' .
- 'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (SELECT id_agente FROM tagente WHERE nombre LIKE \'%' . $free_search . '%\'))' .
+ 'id_alert_template IN (
+ SELECT id
+ FROM talert_templates
+ WHERE name LIKE \'%' . $free_search . '%\') OR ' .
+ 'id_alert_template IN (
+ SELECT id
+ FROM talert_templates
+ WHERE id_alert_action IN (
+ SELECT id
+ FROM talert_actions
+ WHERE name LIKE \'%' . $free_search . '%\')) OR ' .
+ 'talert_template_modules.id IN (
+ SELECT id_alert_template_module
+ FROM talert_template_module_actions
+ WHERE id_alert_action IN (
+ SELECT id
+ FROM talert_actions
+ WHERE name LIKE \'%' . $free_search . '%\')) OR ' .
+ 'id_agent_module IN (
+ SELECT id_agente_modulo
+ FROM tagente_modulo
+ WHERE nombre LIKE \'%' . $free_search . '%\') OR ' .
+ 'id_agent_module IN (
+ SELECT id_agente_modulo
+ FROM tagente_modulo
+ WHERE id_agente IN (
+ SELECT id_agente
+ FROM tagente
+ WHERE nombre LIKE \'%' . $free_search . '%\'))' .
')';
break;
@@ -333,7 +381,10 @@ if ($pure) {
// Filter form
if ($print_agent) {
echo '';
- }
- else {
- $data[9] = '';
- }
- $data[9] .= ui_print_timestamp ($module["utimestamp"], true, array('style' => 'font-size: 7pt'));
- $data[9] .= '';
-
- array_push ($table->data, $data);
- $rowIndex++;
-}
-
-?>
-
-";
-ui_print_help_tip(__('For to view the list modules paginated, set in setup visuals.'));
-echo __('Full list of monitors') . ' ' . reporting_tiny_stats ($agent, true, 'modules');
+
+echo ui_print_help_tip(__('For to view the list modules paginated, set in setup visuals.'), true) .
+ __('Full list of monitors') . ' ' .
+ reporting_tiny_stats ($agent, true, 'modules');
+
$modules_not_init = agents_monitor_notinit($id_agente);
if (!empty($modules_not_init)) {
echo clippy_context_help("modules_not_init");
@@ -732,45 +116,175 @@ if (!empty($modules_not_init)) {
echo "";
+ob_start();
+
print_form_filter_monitors($id_agente, $status_filter_monitor, $status_text_monitor);
-if (empty ($table->data)) {
- if ($filter_monitors) {
- echo '' .
- __('Any monitors aren\'t with this filter.') . '
';
- }
- else {
- echo '' .
- __('This agent doesn\'t have any active monitors.') . '
';
- }
-}
-else {
- $url = "index.php?" .
- "sec=estado&" .
- "sec2=operation/agentes/ver_agente&" .
- "id_agente=" . $id_agente . "&" .
- "refr=&filter_monitors=1&" .
- "status_filter_monitor=" . $status_filter_monitor . "&" .
- "status_text_monitor=" . $status_text_monitor;
-
- if ($paginate_module) {
- ui_pagination ($count_modules, $url);
- }
-
- html_print_table ($table);
-
- if ($paginate_module) {
- ui_pagination ($count_modules, $url);
- }
-}
-unset ($table);
-unset ($table_data);
+echo "" .
+ html_print_image('images/spinner.gif', true) .
+ '
';
+echo "" .
+
+ "
";
+
+
+$html_toggle = ob_get_clean();
+ui_toggle($html_toggle,
+ __('List of modules'),
+ 'status_monitor_agent',
+ false);
+
+?>
+
+";
+echo "";
ui_include_time_picker();
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
@@ -880,7 +394,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
function print_form_filter_monitors($id_agent, $status_filter_monitor = -1,
$status_text_monitor = '') {
- $form_text = '';
- $table->data[0][5] = '';
- html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"', true);
- $form_text .= html_print_table($table, true);
- $form_text .= '';
+ $table->data[0][2] = __('Free text for search (*):');
+
+ $table->data[0][3] = html_print_input_text('status_text_monitor', $status_text_monitor, '', 30, 100, true);
+
+ $table->data[0][4] = html_print_button(__('Filter'), 'filter', false, 'filter_modules();', 'class="sub search"', true);
+ $table->data[0][4] .= ' ' . html_print_button(__('Reset'), 'filter', false, 'reset_filter_modules();', 'class="sub upd"', true);
+ $form_text .= html_print_table($table, true);
$filter_hidden = false;