From 33c9b50ddcfec62a5f0f25fde1385bbb95c12cd7 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 10 Jan 2023 14:57:40 +0100 Subject: [PATCH] Polishing agent detail view --- pandora_console/include/ajax/events.php | 35 ++++++++++------ pandora_console/include/ajax/module.php | 42 ++++++------------- pandora_console/include/styles/pandora.css | 3 ++ .../operation/agentes/alerts_status.php | 2 +- .../operation/agentes/estado_monitores.php | 9 ++-- 5 files changed, 41 insertions(+), 50 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 6d87ab5f8f..a753be36cb 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -1974,8 +1974,8 @@ if ($table_events) { include_once 'include/functions_events.php'; include_once 'include/functions_graph.php'; - $id_agente = (int) get_parameter('id_agente', 0); - $all_events_24h = (int) get_parameter('all_events_24h', 0); + $id_agente = (int) get_parameter('id_agente'); + $all_events_24h = (int) get_parameter('all_events_24h'); // Fix: for tag functionality groups have to be all user_groups // (propagate ACL funct!). @@ -1988,19 +1988,28 @@ if ($table_events) { 'event_condition', 'AND' ); - echo '
'; - echo ''; - echo html_print_switch( - [ - 'name' => 'all_events_24h', - 'value' => $all_events_24h, - 'id' => 'checkbox-all_events_24h', - ] - ); - echo '
'; + + $tableEvents24h = new stdClass(); + $tableEvents24h->class = 'filter_table'; + $tableEvents24h->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;'; + $tableEvents24h->width = '100%'; + $tableEvents24h->data = []; + + $tableEvents24h->data[0] = __('Show all Events 24h'); + $tableEvents24h->rowstyle[1] = 'height: 42px'; + $tableEvents24h->data[1] = html_print_switch( + [ + 'name' => 'all_events_24h', + 'value' => $all_events_24h, + 'id' => 'checkbox-all_events_24h', + ] + ); + + html_print_table($tableEvents24h); + $date_subtract_day = (time() - (24 * 60 * 60)); - if ($all_events_24h) { + if ($all_events_24h !== 0) { events_print_event_table( 'utimestamp > '.$date_subtract_day, 200, diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 205f5ace5b..0543bb18b1 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -356,7 +356,7 @@ if (check_login()) { ]; } - if ($selection_mode == 'fromnow') { + if ($selection_mode === 'fromnow') { $date = get_system_time(); $period = $period; } else { @@ -958,7 +958,7 @@ if (check_login()) { $table = new stdClass(); $table->width = '100%'; - $table->styleTable = 'display:flex;border: 0;border-radius: 0;vertical-align: baseline;flex-direction: column;'; + $table->styleTable = 'border: 0;border-radius: 0;vertical-align: baseline;'; $table->cellpadding = 0; $table->cellspacing = 0; $table->class = 'tactical_table info_table'; @@ -976,41 +976,24 @@ if (check_login()) { $table->align[5] = 'left'; $table->align[6] = 'left'; $table->align[7] = 'center'; - $table->align[8] = 'left'; - $table->align[9] = 'right'; - // Cell styles. - $table->style[0] = 'width: 5%;vertical-align: baseline'; - $table->style[1] = 'width: 5%;vertical-align: baseline'; - $table->style[2] = 'width: 20%;vertical-align: baseline'; - $table->style[3] = 'width: 20%;vertical-align: baseline'; - $table->style[4] = 'width: 5%;vertical-align: baseline'; - $table->style[5] = 'width: 15%;vertical-align: baseline'; - $table->style[6] = 'width: 10%;vertical-align: baseline;font-size: 9pt'; - $table->style[7] = 'width: 10%;vertical-align: baseline'; - $table->style[8] = 'width: 10%;vertical-align: baseline;font-size: 9pt'; - $table->style[9] = 'width: 10%;vertical-align: baseline'; + // Fixed styles. + $table->headstyle[0] = 'width: 4%;text-align: center;'; + $table->headstyle[1] = 'width: 55px;text-align: left;'; + $table->headstyle[4] = 'width: 100px; text-align: center'; + $table->headstyle[7] = 'width: 130px; text-align: center'; + $table->headstyle[8] = 'width: 10%; text-align: center'; + $table->headstyle[9] = 'text-align: center'; // Row class. - // $table->headclass[] = 'header_row'; $table->head[0] = ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) ? ''.__('P').'' : ''; - $table->headstyle[0] = 'width: 5%;text-align: center;'; - $table->head[1] = ''.__('Type').''.ui_get_sorting_arrows($url_up_type, $url_down_type, $selectTypeUp, $selectTypeDown); - $table->headstyle[1] = 'width: 5%;text-align: left;'; + $table->head[1] = ''.__('T').''.ui_get_sorting_arrows($url_up_type, $url_down_type, $selectTypeUp, $selectTypeDown); $table->head[2] = ''.__('Module name').''.ui_get_sorting_arrows($url_up_name, $url_down_name, $selectNameUp, $selectNameDown); - $table->headstyle[2] = 'width: 20%;text-align: left;'; $table->head[3] = ''.__('Description').''; - $table->headstyle[3] = 'width: 20%;text-align: left;'; $table->head[4] = ''.__('Status').''.ui_get_sorting_arrows($url_up_status, $url_down_status, $selectStatusUp, $selectStatusDown); - $table->headstyle[4] = 'width: 5%;text-align: center;'; $table->head[5] = ''.__('Thresholds').''; - $table->headstyle[5] = 'width: 15%;text-align: left;'; $table->head[6] = ''.__('Data').''; - $table->headstyle[6] = 'width: 10%;text-align: left;'; $table->head[7] = ''.__('Last contact').''.ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); - $table->headstyle[7] = 'width: 10%;'; $table->head[8] = ''.__('Graphs').''; - $table->headstyle[8] = 'width: 10%;'; $table->head[9] = ''.__('Actions').''; - $table->headstyle[8] = 'width: 10%;'; $last_modulegroup = 0; $rowIndex = 0; @@ -1039,7 +1022,7 @@ if (check_login()) { if ($hierachy_mode === 'false') { // The code add the row of 1 cell with title of group for to be more organice the list. if ($module['id_module_group'] != $last_modulegroup) { - $table->colspan[$rowIndex][0] = count($table->style); + $table->colspan[$rowIndex][0] = count($table->head); $table->rowclass[$rowIndex] = 'datos4'; array_push($table->data, [''.$module['name'].'']); @@ -1051,10 +1034,9 @@ if (check_login()) { // End of title of group. } + $table->rowstyle[$rowIndex] = 'vertical-align: baseline'; $data = []; - // Module policy. - // $table->cellstyle[$rowIndex][0] = 'width: 1%;'; $data[0] = ''; if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ((int) $module['id_policy_module'] !== 0) { diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 902e724795..464b10c436 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3673,6 +3673,9 @@ table#policy_modules td * { border: 0 !important; } +.tactical_table > thead > tr span { + line-height: 26px; +} .info_table thead th .sort_arrow, .tactical_table thead th .sort_arrow { vertical-align: top; diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index a089a00db6..eacfa319e2 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -453,7 +453,7 @@ if ($free_search != '') { false, [ 'icon' => 'wand', - 'mode' => 'mini', + 'mode' => 'secondary mini', ], true ), diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index acb7fdf50a..7d7b1a0ba6 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -268,12 +268,10 @@ html_print_div( parameters["status_text_monitor"] = filter_text; parameters["status_module_group"] = filter_group; parameters["page"] = "include/ajax/module"; - - + $("#module_list").empty(); $("#module_list_loading").show(); - - + jQuery.ajax ({ data: parameters, type: 'POST', @@ -281,13 +279,12 @@ html_print_div( dataType: 'html', success: function (data) { $("#module_list_loading").hide(); - $("#module_list").empty(); $("#module_list").html(data); } }); } - + function filter_modules() { filter_status = $("#status_filter_monitor").val(); filter_group = $("#status_module_group").val();