diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index dbf41a648b..604bb3a3f5 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -397,55 +397,135 @@ function mainAgentsModules() 1 => __('Show module data'), ]; - $filter_type_label = ''.__('Information to be shown').''; - $filter_type = html_print_select($show_select, 'show_type', $show_type, '', '', 0, true, false, false, '', false, 'min-width: 180px;'); - - // Groups. - $filter_groups_label = ''.__('Group').''; - $filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;'); - - $filter_recursion_label = ''.__('Recursion').''; - $filter_recursion = html_print_checkbox('recursion', 1, 0, true).''; - // Groups module. - $filter_module_groups_label = ''.__('Module group').''; - $filter_module_groups = html_print_select_from_sql( - 'SELECT * FROM tmodule_group ORDER BY name', - 'modulegroup', - $modulegroup, - '', - __('All'), - 0, - true, - false, - true, - false, - 'width: auto;' + $filter_type = html_print_label_input_block( + __('Information to be shown'), + html_print_select( + $show_select, + 'show_type', + $show_type, + '', + '', + 0, + true, + false, + false, + '', + false, + 'width: 100%;' + ) + ); + + $filter_groups = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'AR', + true, + 'group_id', + $group_id, + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%;' + ) + ); + + $filter_groups .= html_print_label_input_block( + __('Recursion'), + html_print_checkbox_switch('recursion', 1, 0, true), + [ + 'div_class' => 'add-input-reverse', + 'label_class' => 'label-thin', + ] + ); + + $filter_module_groups = html_print_label_input_block( + __('Module group'), + html_print_select_from_sql( + 'SELECT * FROM tmodule_group ORDER BY name', + 'modulegroup', + $modulegroup, + '', + __('All'), + 0, + true, + false, + true, + false, + 'width: 100%;' + ) ); - // Agent. $agents = agents_get_group_agents($group_id); if ((empty($agents)) || $agents == -1) { $agents = []; } - $filter_agents_label = ''.__('Agents').''; - $filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;'); + $filter_agents = html_print_label_input_block( + __('Agents'), + html_print_select( + $agents, + 'id_agents2[]', + $agents_id, + '', + '', + 0, + true, + true, + true, + '', + false, + 'width: 100%;' + ) + ); // Type show. $selection = [ 0 => __('Show common modules'), 1 => __('Show all modules'), ]; - $filter_type_show_label = ''.__('Show common modules').''; - $filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;'); + $filter_type_show = html_print_label_input_block( + __('Show common modules'), + html_print_select( + $selection, + 'selection_agent_module', + $selection_a_m, + '', + '', + 0, + true, + false, + true, + '', + false, + 'width: 100%;' + ) + ); // Modules. $all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false); - $filter_modules_label = ''.__('Module').''; - $filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;'); - - // Update. - $filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true); + $filter_modules = html_print_label_input_block( + __('Module'), + html_print_select( + $all_modules, + 'module[]', + $modules_selected, + '', + '', + 0, + true, + true, + false, + '', + false, + 'width: 100%;' + ) + ); $onheader = [ 'updated_time' => $updated_time, @@ -566,36 +646,39 @@ function mainAgentsModules() if ($config['pure'] != 1) { $show_filters = '
'; - $show_filters .= ''; + $show_filters .= '
'; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; + $show_filters .= ''; + $show_filters .= ''; + $show_filters .= ''; $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= "'; - $show_filters .= ''; $show_filters .= '
'.$filter_type_label.''.$filter_type.''.$filter_type.''.$filter_groups.''.$filter_module_groups.'
'.$filter_groups_label.''.$filter_groups.'   '.$filter_recursion_label.$filter_recursion.''.$filter_module_groups_label.''.$filter_module_groups.'
'.$filter_agents_label.''.$filter_agents.''.$filter_type_show_label.''.$filter_type_show.''.$filter_modules_label.''.$filter_modules.'
".$filter_update.'
'; + $show_filters .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_submit_button( + __('Filter'), + 'srcbutton', + false, + [ + 'icon' => 'search', + 'mode' => 'mini', + ], + true + ), + ], + true + ); $show_filters .= '
'; ui_toggle( $show_filters, - __('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true), + ''.__('Filters ').''.ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true), 'filter_form', '', true, @@ -804,7 +887,20 @@ function mainAgentsModules() // Prepare pagination. $url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m; - ui_pagination($total_pagination, $url); + $tablePagination = ui_pagination( + $total_pagination, + $url, + 0, + 0, + true, + 'offset', + false + ); + + html_print_action_buttons( + '', + [ 'right_content' => $tablePagination ] + ); foreach ($agents as $agent) { // Get stats for this group. diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 5e0a1aadd9..8c10de81c2 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -441,17 +441,18 @@ function mainModuleGroups() [ 'right_content' => $tablePagination ] ); - echo "
"; - echo ''; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo '
".__('Legend').'
".__('Orange cell when the module group and agent have at least one alarm fired.').'
".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'
".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'
".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'
".__('Green cell when the module group and agent have all modules in OK status').'
".__('Blue cell when the module group and agent have all modules in not init status.').'
'; - echo '
'; + $show_legend = '
'; + $show_legend .= ''; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= '
".__('Orange cell when the module group and agent have at least one alarm fired.').'
".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'
".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'
".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'
".__('Green cell when the module group and agent have all modules in OK status').'
".__('Blue cell when the module group and agent have all modules in not init status.').'
'; + $show_legend .= '
'; + + ui_toggle($show_legend, __('Legend')); } else { ui_print_info_message(['no_close' => true, 'message' => __('This table shows in columns the modules group and in rows agents group. The cell shows all modules') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups or module groups') ]);