minor fixes

This commit is contained in:
alejandro.campos@artica.es 2024-01-25 16:03:48 +01:00
parent 19024e63d3
commit 18cb14bec6
2 changed files with 29 additions and 10 deletions

View File

@ -1553,8 +1553,7 @@ function netflow_draw_item(
if ($output === 'HTML' || $output === 'PDF') {
$html = '<table class="w100p">';
if ($show_graph === true && $max_aggregates <= 10) {
if ($show_graph === true) {
$labels = array_map(
function ($conn) {
return __('% Traffic').' '.$conn['ip_src'].' - '.$conn['ip_dst'];
@ -1572,6 +1571,16 @@ function netflow_draw_item(
$graph_output = pie_graph(
$pie_data,
[
'width' => 200,
'height' => 200,
'ttl' => ($output === 'PDF') ? 2 : 1,
'dataLabel' => ['display' => 'auto'],
'layout' => [
'padding' => [
'top' => 15,
'bottom' => 15,
],
],
'legend' => [
'display' => true,
'position' => 'right',
@ -1583,7 +1592,13 @@ function netflow_draw_item(
$html .= '<tr>';
$html .= "<td class='w500p padding-bottom-25px'>";
if ($output === 'PDF') {
$html .= '<img src="data:image/png;base64,'.$graph_output.'" />';
} else {
$html .= $graph_output;
}
$html .= '</td>';
$html .= '</tr>';
}

View File

@ -7036,11 +7036,15 @@ function reporting_netflow(
break;
}
if ($extended === true) {
$return['subtitle'] = __('InBound/Outbound traffic per SrcIP/DestIP');
} else {
$return['subtitle'] = netflow_generate_subtitle_report(
$filter['aggregate'],
$content['top_n'],
$type_netflow
);
}
return reporting_check_structure_content($return);
}