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,6 +1571,16 @@ function netflow_draw_item(
$graph_output = pie_graph( $graph_output = pie_graph(
$pie_data, $pie_data,
[ [
'width' => 200,
'height' => 200,
'ttl' => ($output === 'PDF') ? 2 : 1,
'dataLabel' => ['display' => 'auto'],
'layout' => [
'padding' => [
'top' => 15,
'bottom' => 15,
],
],
'legend' => [ 'legend' => [
'display' => true, 'display' => true,
'position' => 'right', 'position' => 'right',
@ -1583,7 +1592,13 @@ function netflow_draw_item(
$html .= '<tr>'; $html .= '<tr>';
$html .= "<td class='w500p padding-bottom-25px'>"; $html .= "<td class='w500p padding-bottom-25px'>";
if ($output === 'PDF') {
$html .= '<img src="data:image/png;base64,'.$graph_output.'" />';
} else {
$html .= $graph_output; $html .= $graph_output;
}
$html .= '</td>'; $html .= '</td>';
$html .= '</tr>'; $html .= '</tr>';
} }

View File

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