From 03fea8212469eb91d40a4957e844350c68db911b Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 30 Nov 2023 08:45:34 +0100 Subject: [PATCH 1/3] #12524 fixed opening items in new tabs Monitoring and Alerts view --- .../operation/agentes/status_monitor.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 825fbb01df..70101d8a1e 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1708,7 +1708,7 @@ if (empty($result) === false) { // TODO: Calculate hash access before to use it more simply like other sections. I.E. Events view if (is_metaconsole() === true) { - echo "
"; + echo ""; html_print_input_hidden( 'loginhash', 'auto', @@ -1725,7 +1725,7 @@ if (empty($result) === false) { false ); echo '
'; - $agent_link = ""; + $agent_link = ""; $agent_alias = ui_print_truncate_text( $agent_alias, @@ -2257,7 +2257,7 @@ if (empty($result) === false) { $table->cellclass[][2] = 'action_buttons'; if (is_metaconsole() === true) { - echo "
"; + echo ""; html_print_input_hidden( 'id_agente', $row['id_agent'], @@ -2285,7 +2285,15 @@ if (empty($result) === false) { ); echo '
'; - $agent_link = "
"; + + $url_edit_module = $row['server_url']; + $url_edit_module .= 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&'; + $url_edit_module .= '&id_agente='.$row['id_agent']; + $url_edit_module .= '&tab=module&id_agent_module='.$row['id_agente_modulo'].'&edit_module=1'; + $url_edit_module .= '&loginhash=auto&loginhash_data='.$row['hashdata']; + $url_edit_module .= '&loginhash_user='.str_rot13($row['user']); + + $agent_link = ""; $agent_alias = ui_print_truncate_text( $agent_alias, From 5dd9acb02b46596b38382b78d051db25ab295185 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 15 Feb 2024 13:54:14 +0100 Subject: [PATCH 2/3] #12524 disable auto start alerts --- pandora_console/include/functions_html.php | 1 + pandora_console/include/functions_ui.php | 4 +++- pandora_console/operation/agentes/alerts_status.php | 5 +---- pandora_console/operation/agentes/status_monitor.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3a4ca01ebb..a06845064f 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2931,6 +2931,7 @@ function html_print_anchor( 'class', 'title', 'onClick', + 'target', ]; $output .= (isset($options['href']) === true) ? 'href="'.io_safe_input_html($options['href']).'"' : ui_get_full_url(); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 45aa64df22..5c5a74b27b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1445,11 +1445,13 @@ function ui_format_alert_row( if (is_metaconsole() === true) { // Do not show link if user cannot access node if ((bool) can_user_access_node() === true) { - $url = $server['server_url'].'/index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$agente['id_agente']; + $hashdata = metaconsole_get_server_hashdata($server); + $url = $server['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&loginhash=auto&loginhash_data='.$hashdata.'&loginhash_user='.str_rot13($config['id_user']).'&id_agente='.$agente['id_agente']; $data[$index['agent_name']] .= html_print_anchor( [ 'href' => $url, 'content' => ''.$agente['alias'].'', + 'target' => '_blank', ], true ); diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 68988900bc..cf2b819f6f 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -402,6 +402,7 @@ if ($agent_view_page === true) { 'no_toggle' => true, 'class' => 'flex', ], + 'start_disabled' => true, ] ); } else { @@ -585,10 +586,6 @@ function alerts_table_controls() { } $(document).ready ( function () { - if ($('#filter_applied').val() == 0){ - $('#button-form_alerts_status_datatable_search_bt').trigger('click'); - $('#filter_applied').val(1); - } alerts_table_controls(); $('#button-alert_validate').on('click', function () { validateAlerts(); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index a19da7be26..5d707d8476 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1729,7 +1729,7 @@ if (empty($result) === false) { false ); echo ''; - $agent_link = ""; + $agent_link = ""; $agent_alias = ui_print_truncate_text( $agent_alias, From a050c40976f60b71bdf756ecb6157bb005fc826b Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 20 Feb 2024 08:26:02 +0100 Subject: [PATCH 3/3] #12524 blank and send parameters on control + click --- pandora_console/operation/agentes/status_monitor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 5d707d8476..02ec54bc6b 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1729,7 +1729,7 @@ if (empty($result) === false) { false ); echo ''; - $agent_link = ""; + $agent_link = ""; $agent_alias = ui_print_truncate_text( $agent_alias, @@ -1772,6 +1772,7 @@ if (empty($result) === false) { if (in_array('module_name', $show_fields) === true || is_metaconsole() === true) { $data[3] = html_print_anchor( [ + 'target' => '_blank', 'href' => ($url_edit_module ?? '#'), 'content' => ui_print_truncate_text($row['module_name'], 'module_small', false, true, true), ], @@ -2297,7 +2298,7 @@ if (empty($result) === false) { $url_edit_module .= '&loginhash=auto&loginhash_data='.$row['hashdata']; $url_edit_module .= '&loginhash_user='.str_rot13($row['user']); - $agent_link = ""; + $agent_link = ""; $agent_alias = ui_print_truncate_text( $agent_alias,