Merge branch 'ent-12524-GISS-Problemas-para-abrir-elementos-en-nuevas-pestañas-Vista-Monitores-y-Alertas' into 'develop'

Ent 12524 giss problemas para abrir elementos en nuevas pestañas vista monitores y alertas

See merge request artica/pandorafms!6720
This commit is contained in:
Rafael Ameijeiras 2024-02-21 07:59:15 +00:00
commit 6d3c88efc0
4 changed files with 18 additions and 9 deletions

View File

@ -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();

View File

@ -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' => '<span class="bolder" title="'.$agente['nombre'].'">'.$agente['alias'].'</span>',
'target' => '_blank',
],
true
);

View File

@ -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();

View File

@ -1712,7 +1712,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 "<form id='agent-redirection-".$inc_id."' method='POST' action='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent']."'>";
echo "<form id='agent-redirection-".$inc_id."' method='POST' target='_blank' action='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent']."'>";
html_print_input_hidden(
'loginhash',
'auto',
@ -1729,7 +1729,7 @@ if (empty($result) === false) {
false
);
echo '</form>';
$agent_link = "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"agent-redirection-".$inc_id."\").submit();' href='#'>";
$agent_link = "<a target='_blank' href='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']).'&id_agente='.$row['id_agent']."'>";
$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),
],
@ -2261,7 +2262,7 @@ if (empty($result) === false) {
$table->cellclass[][2] = 'action_buttons';
if (is_metaconsole() === true) {
echo "<form id='agent-edit-redirection-".$inc_id."' method='POST' action='".$row['server_url']."index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&edit_module=1'>";
echo "<form id='agent-edit-redirection-".$inc_id."' target='_blank' method='POST' action='".$row['server_url']."index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&edit_module=1'>";
html_print_input_hidden(
'id_agente',
$row['id_agent'],
@ -2289,7 +2290,15 @@ if (empty($result) === false) {
);
echo '</form>';
$agent_link = "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"agent-edit-redirection-".$inc_id."\").submit();' href='#'>";
$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 = "<a href='".$url_edit_module."'>";
$agent_alias = ui_print_truncate_text(
$agent_alias,