From 712da9070fc59306feadb3b2de369eea92511f1c Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 28 Mar 2023 10:45:41 +0200 Subject: [PATCH] #10699 Fixed maps --- pandora_console/include/functions_graph.php | 6 +-- pandora_console/include/functions_menu.php | 2 + pandora_console/include/styles/networkmap.css | 4 ++ .../operation/agentes/networkmap.dinamic.php | 38 +++++++++++-------- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 0d5b38f668..2fdf276364 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4949,7 +4949,7 @@ function iterate_group_array($groups, &$data_agents) break; } - $tooltip_content = html_print_image('images/groups_small/'.$group['icon'].'.png', true).' '.__('Group').': '.$group_aux['name'].''; + $tooltip_content = html_print_image('images/'.$group['icon'], true).' '.__('Group').': '.$group_aux['name'].''; $group_aux['tooltip_content'] = $tooltip_content; $group_aux['children'] = []; @@ -4990,10 +4990,10 @@ function graph_monitor_wheel($width=550, $height=600, $filter=false) if ($filter['group'] != 0) { $filter_subgroups = ''; if (!$filter['dont_show_subgroups']) { - $filter_subgroups = ' || parent = '.$filter['group']; + $filter_subgroups = ' || parent IN ('.$filter['group'].')'; } - $groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo = '.$filter['group'].$filter_subgroups); + $groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo IN ('.$filter['group'].') '.$filter_subgroups); $groups_ax = []; foreach ($groups as $g) { diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 2a52aed31b..071c40d7a1 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -68,6 +68,8 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/alerts/alert_commands'; } else if ($sec2 === 'enterprise/godmode/setup/edit_skin') { $sec2 = 'enterprise/godmode/setup/setup_skins'; + } else if ($sec2 === 'operation/agentes/networkmap.dinamic') { + $sec2 = 'operation/agentes/pandora_networkmap'; } else if ($sec2 === 'godmode/gis_maps/configure_gis_map') { $map_id = (string) get_parameter('map_id'); if (empty($map_id) === false) { diff --git a/pandora_console/include/styles/networkmap.css b/pandora_console/include/styles/networkmap.css index f933fa07c3..314bd92ce5 100644 --- a/pandora_console/include/styles/networkmap.css +++ b/pandora_console/include/styles/networkmap.css @@ -12,6 +12,10 @@ stroke-width: 5; } +.node_image { + filter: invert(100%) brightness(125%); +} + .node_children { stroke: #00f; } diff --git a/pandora_console/operation/agentes/networkmap.dinamic.php b/pandora_console/operation/agentes/networkmap.dinamic.php index 0d9b139821..e0de72f83e 100644 --- a/pandora_console/operation/agentes/networkmap.dinamic.php +++ b/pandora_console/operation/agentes/networkmap.dinamic.php @@ -2,7 +2,7 @@ // Pandora FMS - http://pandorafms.com // ================================================== -// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas +// Copyright (c) 2005-2023 Artica Soluciones Tecnologicas // Please see http://pandorafms.org for full contribution list // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -11,7 +11,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// Load global vars +// Load global vars. global $config; check_login(); @@ -39,7 +39,7 @@ if (defined('_activeTab_') && _activeTab_ != '_activeTab_') { $tab = $activeTab; } -// Networkmap id required +// Networkmap id required. if (!isset($id)) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, @@ -49,7 +49,7 @@ if (!isset($id)) { exit; } -// Get the group for ACL +// Get the group for ACL. if (!isset($store_group)) { $store_group = db_get_value('id_group', 'tmap', 'id', $id); if ($store_group === false) { @@ -62,7 +62,7 @@ if (!isset($store_group)) { } } -// ACL for the networkmap permission +// ACL for the networkmap permission. if (!isset($networkmap_read)) { $networkmap_read = check_acl($config['id_user'], $store_group, 'MR'); } @@ -91,12 +91,12 @@ $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_use $networkmap = db_get_row('tmap', 'id', $id); $pure = (int) get_parameter('pure', 0); -// Main code +// Main code. if ($pure == 1) { $buttons['screen'] = [ 'active' => false, 'text' => ''.html_print_image( - 'images/normal_screen.png', + 'images/exit_fullscreen@svg.svg', true, [ 'title' => __('Normal screen'), @@ -109,7 +109,7 @@ if ($pure == 1) { $buttons['screen'] = [ 'active' => false, 'text' => ''.html_print_image( - 'images/full_screen.png', + 'images/fullscreen@svg.svg', true, [ 'title' => __('Full screen'), @@ -120,7 +120,7 @@ if ($pure == 1) { $buttons['list'] = [ 'active' => false, 'text' => ''.html_print_image( - 'images/list.png', + 'images/file-collection@svg.svg', true, [ 'title' => __('List of networkmap'), @@ -132,16 +132,24 @@ if ($pure == 1) { } if ($dashboard != 1) { - ui_print_page_header( + // Header. + ui_print_standard_header( io_safe_output($networkmap['name']), 'images/bricks.png', false, 'network_map_enterprise_list', false, $buttons, - false, - '', - $config['item_title_size_text'] + [ + [ + 'link' => '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Network maps'), + ], + ] ); } @@ -208,14 +216,14 @@ switch ($networkmap['generation_method']) { break; } -// Set filter +// Set filter. $filter = networkmap_get_filter($layout); if (!isset($text_filter)) { $text_filter = ''; } -// Generate dot file +// Generate dot file. $graph = networkmap_generate_hash( __('Pandora FMS'), $group,