From 4984e2608a6fc1db53a93a004ffafa4a9f7a4c35 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 26 May 2023 12:30:36 +0200 Subject: [PATCH] #11314 Collapses the boxes for modules, alerts and events when the agent does not have this information related --- pandora_console/operation/agentes/alerts_status.php | 3 ++- pandora_console/operation/agentes/estado_monitores.php | 2 +- pandora_console/operation/agentes/status_events.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 8c251903af..6590131020 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -475,6 +475,7 @@ $html_content = ob_get_clean(); if ($agent_view_page === true) { // Create controlled toggle content. + $alerts_count = alerts_get_alerts(0, '', 'all', -1, $true, true, $agent['id_agente']); html_print_div( [ 'class' => 'agent_details_line', @@ -483,7 +484,7 @@ if ($agent_view_page === true) { ''.__('Full list of alerts').'', 'status_monitor_agent', !$alerts_defined, - false, + ($alerts_count > 0) ? false : true, true, '', '', diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 52a93fde85..5003068354 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -196,7 +196,7 @@ html_print_div( ).'', 'status_monitor_agent', false, - false, + ($agent['total_count'] > 0) ? false : true, true, '', 'white-box-content', diff --git a/pandora_console/operation/agentes/status_events.php b/pandora_console/operation/agentes/status_events.php index 478b0771c2..8f14d2e730 100755 --- a/pandora_console/operation/agentes/status_events.php +++ b/pandora_console/operation/agentes/status_events.php @@ -22,6 +22,7 @@ if (!isset($id_agente)) { require_once 'include/functions_events.php'; ui_require_css_file('events'); +$event_count = db_get_row('tevento', 'id_agente', $id_agente); html_print_div( [ 'class' => 'agent_details_line', @@ -30,7 +31,7 @@ html_print_div( ''.__('Latest events for this agent').'', __('Latest events for this agent'), 'latest_events_agent', - false, + ($event_count) ? false : true, true, '', 'box-flat white-box-content no_border',