From e3c842b36cc761c95a4fd1217236973605ef0d1a Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 18 Apr 2024 12:41:17 +0200 Subject: [PATCH 1/3] #13453 Fixed dark theme styles in Netflow Widgets --- pandora_console/include/functions_netflow.php | 14 +++++++++++--- .../include/lib/Dashboard/Widgets/netflow.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index e4d76387bc..3a87ea8be7 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1389,6 +1389,7 @@ function netflow_draw_item( $show_summary=true, $show_table=true ) { + global $config; $aggregate = $filter['aggregate']; $interval = ($end_date - $start_date); if (is_metaconsole() === true) { @@ -1568,13 +1569,20 @@ function netflow_draw_item( $data_top_n ); + // Theme. + $theme = $config['style']; + $text_color = ($theme !== 'pandora_black') ? '#333' : '#fff'; + $graph_output = pie_graph( $pie_data, [ 'width' => 200, 'height' => 200, 'ttl' => ($output === 'PDF') ? 2 : 1, - 'dataLabel' => ['display' => 'auto'], + 'dataLabel' => [ + 'display' => 'auto', + 'color' => $text_color, + ], 'layout' => [ 'padding' => [ 'top' => 15, @@ -1650,8 +1658,8 @@ function netflow_draw_item( netflow_aggregate_is_ip($aggregate) ); - $data_circular['width'] = $width_content; - $data_circular['height'] = $height_content; + $data_circular['width'] = 390; + $data_circular['height'] = 390; $html = '
'; $html .= graph_netflow_circular_mesh($data_circular); diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index 6c0aa76eca..dccf1cffda 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -462,7 +462,7 @@ class Netflow extends Widget public function getSizeModalConfiguration(): array { $size = [ - 'width' => 400, + 'width' => 600, 'height' => 530, ]; From 0c2209713a80fa2c80cd0e32cfc2d2237c6ebc37 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 23 Apr 2024 12:00:49 +0200 Subject: [PATCH 2/3] #13453 Fixed the size of the type graph as a parameter so as not to affect the function --- pandora_console/include/functions_netflow.php | 4 ++-- pandora_console/include/lib/Dashboard/Widgets/netflow.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 3a87ea8be7..9f016ac88a 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1658,8 +1658,8 @@ function netflow_draw_item( netflow_aggregate_is_ip($aggregate) ); - $data_circular['width'] = 390; - $data_circular['height'] = 390; + $data_circular['width'] = $width_content; + $data_circular['height'] = $height_content; $html = '
'; $html .= graph_netflow_circular_mesh($data_circular); diff --git a/pandora_console/include/lib/Dashboard/Widgets/netflow.php b/pandora_console/include/lib/Dashboard/Widgets/netflow.php index dccf1cffda..f1c2123782 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/netflow.php +++ b/pandora_console/include/lib/Dashboard/Widgets/netflow.php @@ -366,8 +366,8 @@ class Netflow extends Widget '', 'HTML', 0, - ($size['width'] - 50), - ($size['height'] - 20), + ($size['width'] + 120), + ($size['height'] + 120), ), ], true From ec7626dcf443f1f170d7b5569d8a68307090178d Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 24 Apr 2024 15:34:20 +0200 Subject: [PATCH 3/3] #13453 remove repetition of warning modal when a date greater than 30 days is selected --- pandora_console/include/javascript/pandora.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index ad17d670a2..ef5b48b982 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2566,19 +2566,13 @@ function menuActionButtonResizing() { function check_period_warning(time, title, message) { var period = time.value; - var times = 0; + if (period >= 2592000 && period < 7776000) { WarningPeriodicityModal(title, message); } else if (period >= 7776000 && period < 15552000) { - do { - WarningPeriodicityModal(title, message); - times = times + 1; - } while (times < 2); + WarningPeriodicityModal(title, message); } else if (period >= 15552000) { - do { - WarningPeriodicityModal(title, message); - times = times + 1; - } while (times < 3); + WarningPeriodicityModal(title, message); } }