Merge branch 'ent-11628-no-carga-el-total-amount-of-events-correctamente-si-hay-varios-widget-tactical-view' into 'develop'

Ent 11628 no carga el total amount of events correctamente si hay varios widget tactical view

See merge request artica/pandorafms!6154
This commit is contained in:
Gorka Sanchez 2023-07-03 07:42:21 +00:00
commit ffc4f04989
4 changed files with 25 additions and 13 deletions

View File

@ -4353,7 +4353,7 @@ function events_page_details($event, $server_id=0)
} else if (can_user_access_node() && is_metaconsole()) {
// Workaround to pass login hash data in POST body instead of directly in the URL.
parse_str($hashstring, $url_hash_array);
$redirection_form = "<form id='agent-redirection' method='POST' action='".$serverstring."index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$event['id_agente']."'>";
$redirection_form = "<form id='agent-redirection' method='POST' action='".$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event['id_agente']."'>";
$redirection_form .= html_print_input_hidden(
'loginhash',
$url_hash_array['loginhash'],

View File

@ -7735,7 +7735,7 @@ function reporting_sql_auxiliary($report, $content, $pdf=false)
}
$result = db_get_all_rows_sql($sql, $historical_db);
if ($result !== false) {
foreach ($result as $row) {
$data_row = [];
@ -14861,7 +14861,13 @@ function reporting_get_stats_servers($filter=[])
'class' => 'main_menu_icon invert_filter',
]
);
$tdata[1] = '<span class="big_data" id="total_events">'.html_print_image('images/spinner.gif', true).'</span>';
$sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento ';
if ($config['event_view_hr']) {
$sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - '.($config['event_view_hr'] * SECONDS_1HOUR).')';
}
$system_events = db_get_value_sql($sql_count_event);
$tdata[1] = '<span class="big_data" id="total_events">'.$system_events.'</span>';
if (isset($system_events) && $system_events > 50000 && !enterprise_installed()) {
$tdata[2] = "<div id='monitoreventsmodal' class='publienterprise left' title='Community version'><img data-title='".__('Enterprise version not installed')."' class='img_help forced_title main_menu_icon' data-use_title_for_force_title='1' src='images/alert-yellow@svg.svg'></div>";

View File

@ -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 "<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' action='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent']."'>";
html_print_input_hidden(
'loginhash',
'auto',

View File

@ -203,21 +203,27 @@ try {
switch ($key) {
case 'module_status':
echo csv_format_delimiter(events_translate_module_status(
$row[$key]
));
echo csv_format_delimiter(
events_translate_module_status(
$row[$key]
)
);
break;
case 'event_type':
echo csv_format_delimiter(events_translate_event_type(
$row[$key]
));
echo csv_format_delimiter(
events_translate_event_type(
$row[$key]
)
);
break;
case 'criticity':
echo csv_format_delimiter(events_translate_event_criticity(
$row[$key]
));
echo csv_format_delimiter(
events_translate_event_criticity(
$row[$key]
)
);
break;
case 'custom_data':