From cbb4f971a2f3319134e564323f3ac43cac016492 Mon Sep 17 00:00:00 2001 From: Fermin Date: Fri, 1 Mar 2019 14:23:10 +0100 Subject: [PATCH] Added new network menus Former-commit-id: 885f092dbfcc561cca5bf1bf8c3ba8497d94ffc4 --- pandora_console/operation/menu.php | 53 +++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index bf81ae5110..409566a8c9 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -65,10 +65,55 @@ if (check_acl($config['id_user'], 0, 'AR')) { enterprise_hook('inventory_menu'); - if ($config['activate_netflow']) { - $sub['operation/netflow/nf_live_view']['text'] = __('Netflow Live View'); - $sub['operation/netflow/nf_live_view']['id'] = 'Netflow Live View'; - $sub['operation/netflow/nf_live_view']['refr'] = 0; + if ($config['activate_netflow'] || $config['activate_nta']) { + $sub['network'] = [ + 'text' => __('Network'), + 'id' => 'Network', + 'type' => 'direct', + 'subtype' => 'nolink', + 'refr' => 0, + ]; + + // Initialize the submenu. + $netflow_sub = []; + + if ($config['activate_netflow']) { + $netflow_sub = array_merge( + $netflow_sub, + [ + 'operation/netflow/network_explorer' => [ + 'text' => __('Netflow explorer'), + 'id' => 'Netflow explorer', + ], + 'operation/netflow/nf_live_view' => [ + 'text' => __('Netflow Live View'), + 'id' => 'Netflow Live View', + ], + ] + ); + } + + if ($config['activate_nta']) { + $netflow_sub = array_merge( + $netflow_sub, + [ + 'operation/network/network_explorer' => [ + 'text' => __('Network explorer'), + 'id' => 'Network explorer', + ], + 'operation/network/network_usage_map' => [ + 'text' => __('Network usage map'), + 'id' => 'Network usage map', + ], + 'operation/network/network_dashboard' => [ + 'text' => __('Network dashboard'), + 'id' => 'Network dashboard', + ], + ] + ); + } + + $sub['network']['sub2'] = $netflow_sub; } if ($config['log_collector'] == 1) {