From 8196ed21df987b9bfd853d1753ebc0cb562a4b9c Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 18 Sep 2018 18:55:53 +0200 Subject: [PATCH 1/3] New mr 21.sql commit --- pandora_console/extras/mr/21.sql | 3 +++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++-- pandora_console/pandoradb_data.sql | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 pandora_console/extras/mr/21.sql diff --git a/pandora_console/extras/mr/21.sql b/pandora_console/extras/mr/21.sql new file mode 100644 index 0000000000..edefd0f194 --- /dev/null +++ b/pandora_console/extras/mr/21.sql @@ -0,0 +1,3 @@ +START TRANSACTION; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index a0d724faab..f1cc319556 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1175,13 +1175,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 19); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 21); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '726'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '728'); -- --------------------------------------------------------------------- -- Table `tconfig_os` diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 07fd6acd64..7439fe087d 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_header', ''), ('custom_report_front_footer', ''), -('MR', 19), +('MR', 21), ('identification_reminder', 1), ('identification_reminder_timestamp', 0), -('current_package_enterprise', '727'), +('current_package_enterprise', '728'), ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'), ('custom_docs_logo', 'default_docs.png'), ('custom_support_logo', 'default_support.png'), From 89798909645ad88d1124daabc71f4ea60c90498b Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 18 Sep 2018 19:05:20 +0200 Subject: [PATCH 2/3] Added is_favourite to tservice table --- pandora_console/extras/mr/21.sql | 3 +++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ pandora_console/pandoradb.sql | 1 + 3 files changed, 6 insertions(+) diff --git a/pandora_console/extras/mr/21.sql b/pandora_console/extras/mr/21.sql index edefd0f194..d7a4b7b961 100644 --- a/pandora_console/extras/mr/21.sql +++ b/pandora_console/extras/mr/21.sql @@ -1,3 +1,6 @@ START TRANSACTION; +ALTER TABLE `tservice` ADD COLUMN `is_favourite` tinyint(1) NOT NULL default 0; +UPDATE tservice SET `is_favourite` = 1 WHERE `name` REGEXP '^[_|.|\[|\(]'; + COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index f1cc319556..27a523616a 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1273,6 +1273,8 @@ ALTER TABLE `tservice` ADD COLUMN `quiet` tinyint(1) NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `evaluate_sla` int(1) NOT NULL default 0; +ALTER TABLE `tservice` ADD COLUMN `is_favourite` tinyint(1) NOT NULL default 0; +UPDATE tservice SET `is_favourite` = 1 WHERE `name` REGEXP '^[_|.|\[|\(]'; -- --------------------------------------------------------------------- -- Table `tlayout` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 655bae59bf..1c002bb417 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2470,6 +2470,7 @@ CREATE TABLE IF NOT EXISTS `tservice` ( `cps` int NOT NULL default 0, `cascade_protection` tinyint(1) NOT NULL default 0, `evaluate_sla` int(1) NOT NULL default 0, + `is_favourite` tinyint(1) NOT NULL default 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB COMMENT = 'Table to define services to monitor' From e318d9539c4802c32fe2521857e67042e08781b0 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 19 Sep 2018 16:56:58 +0200 Subject: [PATCH 3/3] Added favourite services configuration tokens --- .../godmode/setup/setup_visuals.php | 25 ++++++++++++++++--- pandora_console/include/functions_config.php | 21 +++++++++++++--- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 057c220001..00a968fc04 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -741,8 +741,8 @@ $table_vc->style[0] = 'font-weight: bold'; $table_vc->size[0] = '50%'; $table_vc->data = array (); -$vc_favourite_view_array[0] = 'Classic view'; -$vc_favourite_view_array[1] = 'View of favorites'; +$vc_favourite_view_array[0] = __('Classic view'); +$vc_favourite_view_array[1] = __('View of favorites'); $table_vc->data[$row][0] = __('Type of view of visual consoles') . ui_print_help_tip(__('Allows you to directly display the list of favorite visual consoles'), true); $table_vc->data[$row][1] = html_print_select($vc_favourite_view_array, 'vc_favourite_view', $config["vc_favourite_view"], '', '', 0, true); @@ -750,7 +750,6 @@ $row++; $table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu') . ui_print_help_tip(__('If the number is 0 it will not show the pull-down menu and maximum 25 favorite consoles'), true); -//$table_vc->data[$row][1] = html_print_input_text ('vc_menu_items', $config["vc_menu_items"], '', 5, 5, true); $table_vc->data[$row][1] = ""; $row++; @@ -763,8 +762,26 @@ $table_vc->data[$row][1] = html_print_input_text ('vc_line_thickness', $config[" echo "
"; echo "" . __('Visual consoles configuration') . ""; html_print_table ($table_vc); -echo "
"; +echo ""; +//---------------------------------------------------------------------- +// Services +//---------------------------------------------------------------------- +$table_ser = new stdClass(); +$table_ser->width = '100%'; +$table_ser->class = "databox filters"; +$table_ser->style[0] = 'font-weight: bold'; +$table_ser->size[0] = '50%'; +$table_ser->data = array (); + +$table_ser->data['number'][0] = __('Number of favorite services to show in the menu') . + ui_print_help_tip(__('If the number is 0 it will not show the pull-down menu and maximum 25 favorite services'), true); +$table_ser->data['number'][1] = ""; + +echo "
"; +echo "" . __('Services configuration') . ""; + html_print_table ($table_ser); +echo "
"; //---------------------------------------------------------------------- // OTHER CONFIGURATION diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index ca94033ef7..d911ef731f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -530,7 +530,7 @@ function config_update_config () { $error_update[] = __('Product name'); if (!config_update_value ('rb_copyright_notice', (string) get_parameter ('rb_copyright_notice'))) $error_update[] = __('Copyright notice'); - + if (!config_update_value ('meta_custom_logo', (string) get_parameter ('meta_custom_logo'))) $error_update[] = __('Custom logo metaconsole'); if (!config_update_value ('meta_custom_logo_white_bg', (string) get_parameter ('meta_custom_logo_white_bg'))) @@ -545,7 +545,7 @@ function config_update_config () { $error_update[] = __('Custom title2 login metaconsole'); if (!config_update_value ('meta_login_background', (string) get_parameter ('meta_login_background'))) $error_update[] = __('Login background metaconsole'); - + if (!config_update_value ('meta_custom_docs_url', (string) get_parameter ('meta_custom_docs_url'))) $error_update[] = __('Custom Docs url'); if (!config_update_value ('meta_custom_support_url', (string) get_parameter ('meta_custom_support_url'))) @@ -553,13 +553,16 @@ function config_update_config () { if (!config_update_value ('vc_refr', get_parameter('vc_refr'))) $error_update[] = __('Default interval for refresh on Visual Console'); - if (!config_update_value ('vc_favourite_view', (int) get_parameter('vc_favourite_view', 5))) + if (!config_update_value ('vc_favourite_view', (int) get_parameter('vc_favourite_view', 0))) $error_update[] = __('Default line favourite_view for the Visual Console'); if (!config_update_value ('vc_menu_items', (int) get_parameter('vc_menu_items', 10))) $error_update[] = __('Default line menu items for the Visual Console'); if (!config_update_value ('vc_line_thickness', (int) get_parameter('vc_line_thickness'))) $error_update[] = __('Default line thickness for the Visual Console'); + if (!config_update_value ('ser_menu_items', (int) get_parameter('ser_menu_items', 10))) + $error_update[] = __('Default line menu items for the Services'); + if (!config_update_value ('agent_size_text_small', get_parameter('agent_size_text_small'))) $error_update[] = __('Agent size text'); if (!config_update_value ('agent_size_text_medium', get_parameter('agent_size_text_medium'))) @@ -1300,6 +1303,16 @@ function config_process_config () { config_update_value ('meta_custom_title2_login', __('METACONSOLE')); } + if (!isset($config['vc_favourite_view'])) { + config_update_value('vc_favourite_view', 0); + } + if (!isset($config['vc_menu_items'])) { + config_update_value('vc_menu_items', 10); + } + if (!isset($config['ser_menu_items'])) { + config_update_value('ser_menu_items', 10); + } + if (!isset ($config['history_db_enabled'])) { config_update_value ( 'history_db_enabled', false); } @@ -2010,7 +2023,7 @@ function config_process_config () { if (!isset($config['ehorus_req_timeout'])) { config_update_value('ehorus_req_timeout', 5); } - + /* Finally, check if any value was overwritten in a form */ config_update_config(); }