"".html_print_image( 'images/tag@svg.svg', true, [ 'title' => __('Tags'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'tag'), ]; $tabs['os'] = [ 'text' => "".html_print_image( 'images/workstation@groups.svg', true, [ 'title' => __('OS'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'os'), ]; $tabs['group'] = [ 'text' => "".html_print_image( 'images/groups@svg.svg', true, [ 'title' => __('Groups'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'group'), ]; $tabs['module_group'] = [ 'text' => "".html_print_image( 'images/modules-group@svg.svg', true, [ 'title' => __('Module groups'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'module_group'), ]; $tabs['module'] = [ 'text' => "".html_print_image( 'images/modules@svg.svg', true, [ 'title' => __('Modules'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'module'), ]; if ($enterpriseEnable) { $tabs['policies'] = [ 'text' => "".html_print_image( 'images/policy@svg.svg', true, [ 'title' => __('Policies'), 'class' => 'invert_filter', ] ).'', 'active' => ($tab == 'policies'), ]; } } $header_title = __('Tree view'); $header_sub_title = __('Sort the agents by %s'); switch ($tab) { case 'tag': $header_sub_title = sprintf($header_sub_title, __('Tags')); break; case 'os': $header_sub_title = sprintf($header_sub_title, __('OS')); break; case 'group': $header_sub_title = sprintf($header_sub_title, __('Groups')); break; case 'module_group': $header_sub_title = sprintf($header_sub_title, __('Module groups')); break; case 'module': $header_sub_title = sprintf($header_sub_title, __('Modules')); break; case 'policies': if ($enterpriseEnable) { $header_sub_title = sprintf($header_sub_title, __('Policies')); } break; } if (!$strict_acl) { $header_title = $header_title.' » '.$header_sub_title; } if (is_metaconsole() === true) { $tabs = []; } ui_print_standard_header( $header_title, 'images/extensions.png', false, '', false, $tabs, [ [ 'link' => '', 'label' => __('Monitoring'), ], [ 'link' => '', 'label' => __('View'), ], ] ); // ---------------------Tabs ------------------------------------------- // --------------------- form filter ----------------------------------- $table = new StdClass(); $table->width = '100%'; $table->class = 'filter-table-adv'; $table->data = []; $table->rowspan = []; $table->size = []; // Agent filter. $agent_status_arr = []; $agent_status_arr[AGENT_STATUS_ALL] = __('All'); // Default. $agent_status_arr[AGENT_STATUS_NORMAL] = __('Normal'); $agent_status_arr[AGENT_STATUS_WARNING] = __('Warning'); $agent_status_arr[AGENT_STATUS_CRITICAL] = __('Critical'); $agent_status_arr[AGENT_STATUS_UNKNOWN] = __('Unknown'); $agent_status_arr[AGENT_STATUS_NOT_INIT] = __('Not init'); $agent_status_arr[AGENT_STATUS_ALERT_FIRED] = __('Fired alerts'); $table->data['group_row'][] = html_print_label_input_block( __('Search group'), html_print_input_text('search_group', $search_group, '', 25, 30, true) ); if (is_metaconsole() === true) { $table->data['group_row'][] = html_print_label_input_block( __('Show not init modules'), html_print_checkbox( 'show_not_init_modules', $show_not_init_modules, true, true ) ); } $table->data['agent_row'][] = html_print_label_input_block( __('Search agent'), html_print_input_text( 'search_agent', $search_agent, '', 25, 30, true ) ); $table->data['agent_row'][] = html_print_label_input_block( __('Show not init agents'), html_print_checkbox_switch( 'show_not_init_agents', $show_not_init_agents, true, true ) ); $table->data['agent_row'][] = html_print_label_input_block( __('Show full hirearchy'), html_print_checkbox_switch( 'serach_hirearchy', $serach_hirearchy, false, true ) ); $table->data['agent_row'][] = html_print_label_input_block( __('Agent status'), html_print_select( $agent_status_arr, 'status_agent', $status_agent, '', '', 0, true, false, false, '', false, 'width:100%' ).html_print_input_hidden( 'show_not_init_modules_hidden', $show_not_init_modules, true ) ); // Button. if (is_metaconsole() === true) { $table->data['captions_disabled_row'][] = html_print_label_input_block( __('Show only disabled'), html_print_checkbox('show_disabled', $show_disabled, false, true) ); } if (is_metaconsole() === false) { // Module filter. $module_status_arr = []; $module_status_arr[-1] = __('All'); // Default. $module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal'); $module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning'); $module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical'); $module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown'); $module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init'); $module_status_arr['fired'] = __('Fired alerts'); $table->data['last_row'][] = html_print_label_input_block( __('Search module'), html_print_input_text('search_module', $search_module, '', 25, 30, true) ); $table->data['last_row'][] = html_print_label_input_block( __('Show not init modules'), html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true) ); $table->data['last_row'][] = html_print_label_input_block( __('Module status'), html_print_select( $module_status_arr, 'status_module', $status_module, '', '', 0, true, false, false, '', false, 'width:100%' ) ); } $form_html = ''; ui_toggle( $form_html, ''.__('Tree search').'', 'tree_search', false, true, false, '', 'white-box-content', 'box-flat white_table_graph fixed_filter_bar' ); html_print_input_hidden('group-id', $group_id); html_print_input_hidden('tag-id', $tag_id); // --------------------- form filter ----------------------------------- ui_include_time_picker(); ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); ui_require_javascript_file('TreeController', 'include/javascript/tree/'); ui_print_spinner(__('Loading')); html_print_div( [ 'id' => 'tree-controller-recipient', 'content' => '', ] ); $infoHeadTitle = ''; ?>