Merge branch 'ent-11606-Quitar-consolas-visuales-legacy' into 'develop'

remove legacy visual console

See merge request artica/pandorafms!6140
This commit is contained in:
Daniel Rodriguez 2023-07-26 11:09:44 +00:00
commit c2d7c10442
8 changed files with 60 additions and 101 deletions

View File

@ -233,11 +233,8 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $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
) {

View File

@ -837,12 +837,6 @@ $buttons['wizard'] = [
'active' => false,
'text' => '<a href="'.$url_base.$action.'&tab=wizard&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/wizard@svg.svg', true, ['title' => __('Wizard'), 'class' => 'invert_filter']).'</a>',
];
if ($config['legacy_vc']) {
$buttons['editor'] = [
'active' => false,
'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>',
];
}
$buttons['view'] = [
'active' => false,

View File

@ -1344,17 +1344,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(
@ -1372,7 +1361,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'),
@ -1388,6 +1376,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'),
@ -1401,12 +1390,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'),
"<input ' value=".$config['vc_menu_items']." size='5' name='vc_menu_items' min='0' max='25'>"
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Default line thickness for the Visual Console'),
@ -1419,7 +1408,6 @@ $table_vc->data[$row][] = html_print_label_input_block(
true
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Lock screen orientation when viewing on mobile devices'),
@ -1430,6 +1418,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'),

View File

@ -3479,10 +3479,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);
}

View File

@ -1274,52 +1274,50 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
);
$form_items_advance['element_group_row']['html'] .= '</td>';
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'] = '<td align="left">';
$form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration');
$form_items_advance['cache_expiration_row']['html'] .= '</td>';
$form_items_advance['cache_expiration_row']['html'] .= '<td align="left">';
$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'] .= '</td>';
}
$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'] = '<td align="left">';
$form_items_advance['cache_expiration_row']['html'] .= __('Cache expiration');
$form_items_advance['cache_expiration_row']['html'] .= '</td>';
$form_items_advance['cache_expiration_row']['html'] .= '<td align="left">';
$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'] .= '</td>';
// 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 '<a href="javascript:" class="tip"><img src="'.$config['homeurl_static'].'/images/tip.png" data-title="The data displayed in editor mode is not real" data-use_title_for_force_title="1"

View File

@ -60,15 +60,13 @@ class Home
'icon' => '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'),

View File

@ -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';

View File

@ -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';