From c0f5264ddea4e4bef9ff6038afcca7b652d293c3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 4 May 2023 13:17:02 +0200 Subject: [PATCH 1/4] #9686 new section for add policy in agent --- .../godmode/agentes/configurar_agente.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index da75fd6342..9c885f0cf4 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -460,6 +460,18 @@ if ($id_agente) { $templatetab['active'] = ($tab === 'template'); + // Policy tab. + $policyTab['text'] = html_print_menu_button( + [ + 'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=policy&id_agente='.$id_agente, + 'image' => 'images/policy@svg.svg', + 'title' => __('Manage policy'), + ], + true + ); + + $policyTab['active'] = ($tab === 'policy'); + // Inventory. $inventorytab['text'] = ''.html_print_image( 'images/hardware-software-component@svg.svg', @@ -638,6 +650,7 @@ if ($id_agente) { 'template' => $templatetab, 'inventory' => $inventorytab, 'pluginstab' => $pluginstab, + 'policy' => (enterprise_installed() === true) ? $policyTab : '', 'collection' => $collectiontab, 'group' => $grouptab, 'gis' => $gistab, @@ -654,11 +667,11 @@ if ($id_agente) { 'template' => $templatetab, 'inventory' => $inventorytab, 'pluginstab' => $pluginstab, + 'policy' => (enterprise_installed() === true) ? $policyTab : '', 'collection' => $collectiontab, 'group' => $grouptab, 'gis' => $gistab, 'agent_wizard' => $agent_wizard, - ]; } @@ -725,6 +738,11 @@ if ($id_agente) { $tab_name = __('Inventory'); break; + case 'policy': + $help_header = 'policy_tab'; + $tab_name = __('Policy'); + break; + case 'plugins': $help_header = 'plugins_tab'; $tab_name = __('Agent plugins'); @@ -2421,6 +2439,10 @@ switch ($tab) { include 'inventory_manager.php'; break; + case 'policy': + enterprise_include('operation/agentes/policy_manager.php'); + break; + default: if (enterprise_hook('switch_agent_tab', [$tab])) { // This will make sure that blank pages will have at least some From 4f26bc2d513914e04f39ccf4968d5410acdf1898 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 13 Jul 2023 08:56:58 +0200 Subject: [PATCH 2/4] #9686 fixed pagination in policies manager --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 9c885f0cf4..6014f87ad0 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -740,7 +740,7 @@ if ($id_agente) { case 'policy': $help_header = 'policy_tab'; - $tab_name = __('Policy'); + $tab_name = __('Policies'); break; case 'plugins': From b35b4e40a1200ccdac40885927930a73a8146b83 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 13 Jul 2023 10:46:10 +0200 Subject: [PATCH 3/4] #9686 fixed bug pagination in datatable --- pandora_console/include/functions_ui.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a49beb0113..df22edae69 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4343,7 +4343,8 @@ function ui_print_datatable(array $parameters) $(".action_buttons_right_content").html("
"); $(".action_buttons_right_content").html("
"); - $(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style","margin-right: 10px;")); + let original_styles = $("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style"); + $(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style", original_styles + " margin-right: 10px;")); $(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_length")); $(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dt-buttons")); $(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_filter")); From 9012b897f95d5c4605ee59a40a19e6be543a1d3c Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 13 Jul 2023 11:59:10 +0200 Subject: [PATCH 4/4] #9686 added status in centralized mode --- pandora_console/include/styles/pandora.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d4fec36d08..9832fa25bc 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -10804,6 +10804,10 @@ button.ui-button.ui-widget.submit-cancel:active { border-color: #96a2bf; } +.cursor-default { + cursor: default; +} + .hasColorPicker { z-index: 10; }