diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index b5860068d8..97657f5189 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -1,23 +1,24 @@ '.__('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 + // Groups module. $filter_module_groups_label = ''.__('Module group').''; $filter_module_groups = html_print_select_from_sql( 'SELECT * FROM tmodule_group ORDER BY name', @@ -146,7 +147,7 @@ function mainAgentsModules() 'width: auto;' ); - // agent + // Agent. $agents = agents_get_group_agents($group_id); if ((empty($agents)) || $agents == -1) { $agents = []; @@ -155,7 +156,7 @@ function mainAgentsModules() $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;'); - // type show + // Type show. $selection = [ 0 => __('Show common modules'), 1 => __('Show all modules'), @@ -163,12 +164,12 @@ function mainAgentsModules() $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;'); - // modules + // 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 + // Update. $filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true); $onheader = [ @@ -178,8 +179,11 @@ function mainAgentsModules() 'combo_groups' => $filter_groups, ]; - // Old style table, we need a lot of special formatting,don't use table function - // Prepare old-style table + /* + * Old style table, we need a lot of special formatting,don't use table function. + * Prepare old-style table. + */ + if ($config['pure'] == 0) { // Header. ui_print_page_header( @@ -200,38 +204,51 @@ function mainAgentsModules() $full_modules = urlencode(implode(';', $full_modules_selected)); $full_agents = urlencode(implode(';', $full_agents_id)); - $url = " index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset + $url = 'index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset &group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules - &full_agents_id=$full_agents&selection_agent_module=$selection_a_m"; + &full_agents_id=$full_agents&selection_agent_module=$selection_a_m'; } else { - $url = " index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr"; + $url = 'index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr'; } - // Floating menu - Start + // Floating menu - Start. echo '
'; echo ''; echo '
'; - // Floating menu - End + // Floating menu - End. ui_require_jquery_file('countdown'); } if ($config['pure'] != 1) { - echo '
'; - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "'; - echo ''; - echo '
'.$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.'
'; - echo '
'; + $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_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 .= '
'; + ui_toggle($show_filters, __('Filters')); } if ($agents_id[0] != -1) { @@ -291,7 +308,7 @@ function mainAgentsModules() $count = 0; foreach ($agents as $agent) { - // TODO TAGS agents_get_modules + // TODO TAGS agents_get_modules. $module = agents_get_modules( $agent, false, @@ -339,7 +356,7 @@ function mainAgentsModules() } } } else { - // TODO TAGS agents_get_modules + // TODO TAGS agents_get_modules. $all_modules = agents_get_modules( $agents, false, @@ -414,11 +431,11 @@ function mainAgentsModules() if ($hor_offset > 0) { $new_hor_offset = ($hor_offset - $block); - echo ""."".html_print_image( - 'images/arrow_left.png', + echo "".html_print_image( + 'images/arrow_left_green.png', true, ['title' => __('Previous modules')] - ).''.''; + ).''; } $nmodules = 0; @@ -440,11 +457,11 @@ function mainAgentsModules() if (($hor_offset + $block) < $nmodules) { $new_hor_offset = ($hor_offset + $block); - echo ""."".html_print_image( - 'images/arrow.png', + echo "".html_print_image( + 'images/arrow_right_green.png', true, ['title' => __('More modules')] - ).''.''; + ).''; } echo ''; @@ -457,12 +474,12 @@ function mainAgentsModules() $filter_agents['id_grupo'] = $group_id; } - // 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; + // 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); foreach ($agents as $agent) { - // Get stats for this group + // Get stats for this group. $agent_status = agents_get_status($agent['id_agente']); $alias = db_get_row('tagente', 'id_agente', $agent['id_agente']); if (empty($alias['alias'])) { @@ -471,29 +488,29 @@ function mainAgentsModules() switch ($agent_status) { case 4: - // Alert fired status + // Alert fired status. $rowcolor = 'group_view_alrm'; break; case 1: - // Critical status + // Critical status. $rowcolor = 'group_view_crit'; break; case 2: - // Warning status + // Warning status. $rowcolor = 'group_view_warn'; break; case 0: - // Normal status + // Normal status. $rowcolor = 'group_view_ok'; break; case 3: case -1: default: - // Unknown status + // Unknown status. $rowcolor = 'group_view_unk'; break; } @@ -502,7 +519,7 @@ function mainAgentsModules() echo " ".$alias['alias'].''; - // TODO TAGS agents_get_modules + // TODO TAGS agents_get_modules. $agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true); $nmodules = 0; @@ -572,18 +589,23 @@ function mainAgentsModules() echo ''; - echo "
"; + $show_legend = "
"; + $show_legend .= "
+
".__('Orange cell when the module has fired alerts').'
'; + $show_legend .= "
+
".__('Red cell when the module has a critical status').' +
'; + $show_legend .= "
+
".__('Yellow cell when the module has a warning status').'
'; + $show_legend .= "
+
".__('Green cell when the module has a normal status').'
'; + $show_legend .= "
+
".__('Grey cell when the module has an unknown status').'
'; + $show_legend .= "
+
".__("Cell turns blue when the module is in 'not initialize' status").'
'; + $show_legend .= '
'; + ui_toggle($show_legend, __('Legend')); - echo ''; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo '
".__('Legend').'
".__('Orange cell when the module has fired alerts').'
".__('Red cell when the module has a critical status').'
".__('Yellow cell when the module has a warning status').'
".__('Green cell when the module has a normal status').'
".__('Grey cell when the module has an unknown status').'
".__("Cell turns blue when the module is in 'not initialize' status").'
'; - echo '
'; $pure_var = $config['pure']; if ($pure_var) { $pure_var = 1; @@ -627,16 +649,14 @@ $ignored_params['refresh'] = ''; $.each($('.th_class_module_r'), function (i, elem) { id = $(elem).attr('id').replace('th_module_r_', ''); $("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px'); - - //$("#div_module_r_" + id).css('margin-top', (max_width - $("#div_module_r_" + id).width()) + 'px'); $("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px'); $("#div_module_r_" + id).show(); }); - var refr =" . $refr . "; - var pure =" . $pure_var . "; - var href ='" . ui_get_url_refresh ($ignored_params) . "'; - + var refr = ''; + var pure = ''; + var href =' '; + if (pure) { var startCountDown = function (duration, cb) { $('div.vc-countdown').countdown('destroy'); @@ -646,7 +666,7 @@ $ignored_params['refresh'] = ''; $('div.vc-countdown').countdown({ until: t, format: 'MS', - layout: '(%M%nn%M:%S%nn%S Until refresh)', + layout: '(%M%nn%M:%S%nn%S ) ', alwaysExpire: true, onExpiry: function () { $('div.vc-countdown').countdown('destroy'); @@ -655,8 +675,11 @@ $ignored_params['refresh'] = ''; } }); } - - startCountDown(refr, false); + + if(refr>0){ + startCountDown(refr, false); + } + var controls = document.getElementById('vc-controls'); autoHideElement(controls, 1000); diff --git a/pandora_console/images/arrow_left_green.png b/pandora_console/images/arrow_left_green.png new file mode 100644 index 0000000000..b6aadc9639 Binary files /dev/null and b/pandora_console/images/arrow_left_green.png differ diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 468996e0c6..0596f5bf41 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3108,6 +3108,15 @@ div.nodata_container { border-radius: 3px; } +.legend_white { + width: 100%; + background-color: #fff; + padding: 20px 50px; + display: grid; + grid-gap: 12px; + grid-template-columns: repeat(3, 1fr); +} + .legend_basic { background: #f4f4f4; margin-top: 10px; @@ -3116,12 +3125,13 @@ div.nodata_container { } .agents_modules_table th { - background: #3f3f3f; - border: 1px solid #e2e2e2; + background-color: #fff !important; + border-right: 1px solid #e2e2e2; + color: #000; } .agents_modules_table th * { - color: #ffffff; + color: #000; } /* @@ -3425,9 +3435,12 @@ div.div_groups_status { .agents_modules_table { border: 1px solid #e2e2e2; border-spacing: 0px; + margin-bottom: 30px; + background-color: #fff; } .agents_modules_table td { - border: 1px solid #e2e2e2; + border-right: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; } .databox.filters,