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

View File

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