From 77ff766f84aac043d0bd728ed04420cd9eaeea64 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 19 Jun 2023 15:25:37 +0200 Subject: [PATCH] remove legacy visual console --- pandora_console/general/header.php | 7 +- .../reporting/visual_console_builder.php | 6 -- .../godmode/setup/setup_visuals.php | 17 +--- pandora_console/include/functions_config.php | 4 - .../include/functions_visual_map_editor.php | 97 +++++++++---------- pandora_console/mobile/operation/home.php | 16 ++- .../visual_console/public_console.php | 7 +- .../operation/visual_console/render_view.php | 7 +- 8 files changed, 60 insertions(+), 101 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index b0cbc0cec5..bb2884c2ae 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -217,11 +217,8 @@ echo sprintf('
', $menuTypeClass); $header_autorefresh = ''; $header_autorefresh_counter = ''; - if ($config['legacy_vc'] - || ($_GET['sec2'] !== 'operation/visual_console/render_view') - || (($_GET['sec2'] !== 'operation/visual_console/render_view') - && $config['legacy_vc']) - ) { + + if (($_GET['sec2'] !== 'operation/visual_console/render_view')) { if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false ) { diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index a898ff017a..b4f04e9be9 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -837,12 +837,6 @@ $buttons['wizard'] = [ 'active' => false, 'text' => ''.html_print_image('images/wizard@svg.svg', true, ['title' => __('Wizard'), 'class' => 'invert_filter']).'', ]; -if ($config['legacy_vc']) { - $buttons['editor'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'', - ]; -} $buttons['view'] = [ 'active' => false, diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index caee126804..b8f93edc1d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1339,17 +1339,6 @@ $table_vc->style[0] = 'font-weight: bold'; $table_vc->size[0] = '50%'; $table_vc->data = []; -// Remove when the new view reaches rock solid stability. -$table_vc->data[$row][] = html_print_label_input_block( - __('Legacy Visual Console View'), - html_print_checkbox_switch( - 'legacy_vc', - 1, - (bool) $config['legacy_vc'], - true - ) -); - $table_vc->data[$row][] = html_print_label_input_block( __('Default cache expiration'), html_print_extended_select_for_time( @@ -1367,7 +1356,6 @@ $table_vc->data[$row][] = html_print_label_input_block( $intervals ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Default interval for refresh on Visual Console'), @@ -1383,6 +1371,7 @@ $table_vc->data[$row][] = html_print_label_input_block( false ) ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Type of view of visual consoles'), @@ -1396,12 +1385,12 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Number of favorite visual consoles to show in the menu'), "" ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Default line thickness for the Visual Console'), @@ -1414,7 +1403,6 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Mobile view not allow visual console orientation'), @@ -1425,6 +1413,7 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); +$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Display item frame on alert triggered'), diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 468c228733..dde3d4ceae 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -3417,10 +3417,6 @@ function config_process_config() config_update_value('dbtype', 'mysql'); } - if (!isset($config['legacy_vc'])) { - config_update_value('legacy_vc', 0); - } - if (!isset($config['vc_default_cache_expiration'])) { config_update_value('vc_default_cache_expiration', 60); } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index c40d2e0740..c7971256e0 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1274,52 +1274,50 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) ); $form_items_advance['element_group_row']['html'] .= ''; - if (!$config['legacy_vc']) { - $intervals = [ - 10 => '10 '.__('seconds'), - 30 => '30 '.__('seconds'), - 60 => '1 '.__('minutes'), - 300 => '5 '.__('minutes'), - 900 => '15 '.__('minutes'), - 1800 => '30 '.__('minutes'), - 3600 => '1 '.__('hour'), - ]; + $intervals = [ + 10 => '10 '.__('seconds'), + 30 => '30 '.__('seconds'), + 60 => '1 '.__('minutes'), + 300 => '5 '.__('minutes'), + 900 => '15 '.__('minutes'), + 1800 => '30 '.__('minutes'), + 3600 => '1 '.__('hour'), + ]; - $form_items_advance['cache_expiration_row'] = []; - $form_items_advance['cache_expiration_row']['items'] = [ - 'static_graph', - 'percentile_bar', - 'percentile_item', - 'module_graph', - 'simple_value', - 'datos', - 'auto_sla_graph', - 'group_item', - 'bars_graph', - 'donut_graph', - 'color_cloud', - 'service', - ]; - $form_items_advance['cache_expiration_row']['html'] = ''; - $form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration'); - $form_items_advance['cache_expiration_row']['html'] .= ''; - $form_items_advance['cache_expiration_row']['html'] .= ''; - $form_items_advance['cache_expiration_row']['html'] .= html_print_extended_select_for_time( - 'cache_expiration', - $config['vc_default_cache_expiration'], - '', - __('No cache'), - 0, - false, - true, - false, - true, - '', - false, - $intervals - ); - $form_items_advance['cache_expiration_row']['html'] .= ''; - } + $form_items_advance['cache_expiration_row'] = []; + $form_items_advance['cache_expiration_row']['items'] = [ + 'static_graph', + 'percentile_bar', + 'percentile_item', + 'module_graph', + 'simple_value', + 'datos', + 'auto_sla_graph', + 'group_item', + 'bars_graph', + 'donut_graph', + 'color_cloud', + 'service', + ]; + $form_items_advance['cache_expiration_row']['html'] = ''; + $form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration'); + $form_items_advance['cache_expiration_row']['html'] .= ''; + $form_items_advance['cache_expiration_row']['html'] .= ''; + $form_items_advance['cache_expiration_row']['html'] .= html_print_extended_select_for_time( + 'cache_expiration', + $config['vc_default_cache_expiration'], + '', + __('No cache'), + 0, + false, + true, + false, + true, + '', + false, + $intervals + ); + $form_items_advance['cache_expiration_row']['html'] .= ''; // Insert and modify before the buttons to create or update. if (enterprise_installed()) { @@ -1454,12 +1452,9 @@ function visual_map_editor_print_toolbox() visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item', true); visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item', true); visual_map_print_button_editor('color_cloud', __('Color cloud'), 'left', false, 'color_cloud_min', true); - if (isset($config['legacy_vc']) === false - || (bool) $config['legacy_vc'] === false - ) { - // Applies only on modern VC. - visual_map_print_button_editor('network_link', __('Network link'), 'left', false, 'network_link_min', true); - } + + // Applies only on modern VC. + visual_map_print_button_editor('network_link', __('Network link'), 'left', false, 'network_link_min', true); if (defined('METACONSOLE')) { echo ' 'ui-icon-menu-group ui-widget-icon-floatbeginning ui-icon-menu-square', ]; - if ((bool) $system->getConfig('legacy_vc', false) === false) { - // Show Visual consoles only if new system is enabled. - $items['visualmaps'] = [ - 'name' => __('Visual consoles'), - 'filename' => 'visualmaps.php', - 'menu_item' => true, - 'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square', - ]; - } + // Show Visual consoles only if new system is enabled. + $items['visualmaps'] = [ + 'name' => __('Visual consoles'), + 'filename' => 'visualmaps.php', + 'menu_item' => true, + 'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square', + ]; $items['alerts'] = [ 'name' => __('Alerts'), diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php index 5c6f2d1fcf..91793ba129 100755 --- a/pandora_console/operation/visual_console/public_console.php +++ b/pandora_console/operation/visual_console/public_console.php @@ -15,13 +15,8 @@ // The session is configured and started inside the config process. require_once '../../include/config.php'; -$legacy = (bool) get_parameter('legacy', $config['legacy_vc']); if (is_metaconsole() === true) { $config['requirements_use_base_url'] = true; } -if ($legacy === false) { - include_once $config['homedir'].'/operation/visual_console/public_view.php'; -} else { - include_once $config['homedir'].'/operation/visual_console/legacy_public_view.php'; -} +require_once $config['homedir'].'/operation/visual_console/public_view.php'; diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index fade549824..158a2d0836 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -13,9 +13,4 @@ // GNU General Public License for more details. global $config; -$legacy = (bool) get_parameter('legacy', $config['legacy_vc']); -if ($legacy === false) { - include_once $config['homedir'].'/operation/visual_console/view.php'; -} else { - include_once $config['homedir'].'/operation/visual_console/legacy_view.php'; -} +require_once $config['homedir'].'/operation/visual_console/view.php';