From c07a112f4b6bee86dba33d319400983ec002016b Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 19 Aug 2021 16:23:52 +0200 Subject: [PATCH] migrate histrogram report items --- pandora_console/extras/mr/49.sql | 4 ++++ .../godmode/reporting/reporting_builder.item_editor.php | 7 ------- pandora_console/godmode/reporting/reporting_builder.php | 2 -- pandora_console/include/functions_reporting.php | 1 - pandora_console/include/functions_reporting_html.php | 4 ---- pandora_console/include/functions_reports.php | 4 ---- 6 files changed, 4 insertions(+), 18 deletions(-) diff --git a/pandora_console/extras/mr/49.sql b/pandora_console/extras/mr/49.sql index dd55beec74..5831c8ee4d 100644 --- a/pandora_console/extras/mr/49.sql +++ b/pandora_console/extras/mr/49.sql @@ -5,4 +5,8 @@ ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TIN ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0'; +INSERT INTO treport_content (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":1,"dyn_height":"230"}', server_name, 1, 1 FROM treport_content WHERE type = 'histogram_data'; +INSERT INTO treport_content_item (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0; +DELETE FROM treport_content WHERE type = 'histogram_data'; + COMMIT; diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index f96ad82589..59f9f161b8 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -360,7 +360,6 @@ switch ($action) { $failover_type = $item['failover_type']; break; - case 'histogram_data': case 'module_histogram_graph': $description = $item['description']; $period = $item['period']; @@ -840,7 +839,6 @@ switch ($action) { case 'database_serialized': case 'last_value': case 'monitor_report': - case 'histogram_data': case 'min_value': case 'max_value': case 'avg_value': @@ -4434,7 +4432,6 @@ $(document).ready (function () { case 'max_value': case 'min_value': case 'monitor_report': - case 'histogram_data': case 'database_serialized': case 'last_value': case 'sumatory': @@ -4488,7 +4485,6 @@ $(document).ready (function () { case 'prediction_date': case 'projection_graph': case 'monitor_report': - case 'histogram_data': case 'module_histogram_graph': case 'avg_value': case 'max_value': @@ -4574,7 +4570,6 @@ $(document).ready (function () { case 'max_value': case 'min_value': case 'monitor_report': - case 'histogram_data': case 'database_serialized': case 'last_value': case 'sumatory': @@ -4623,7 +4618,6 @@ $(document).ready (function () { case 'prediction_date': case 'projection_graph': case 'monitor_report': - case 'histogram_data': case 'module_histogram_graph': case 'avg_value': case 'max_value': @@ -5651,7 +5645,6 @@ function chooseType() { $("#row_summary").show(); break; - case 'histogram_data': case 'module_histogram_graph': $("#row_description").show(); $("#row_period").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 2386cca275..15d033288c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2199,7 +2199,6 @@ switch ($action) { break; case 'module_histogram_graph': - case 'histogram_data': case 'agent_configuration': case 'alert_report_agent': case 'alert_report_module': @@ -2846,7 +2845,6 @@ switch ($action) { break; case 'module_histogram_graph': - case 'histogram_data': case 'agent_configuration': case 'alert_report_agent': case 'alert_report_module': diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 214c5783e4..af66d58451 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -858,7 +858,6 @@ function reporting_make_reporting_data( ); break; - case 'histogram_data': case 'module_histogram_graph': $report['contents'][] = reporting_module_histogram_graph( $report, diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 7992a2193a..14a71b3685 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -433,10 +433,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) $mini ); break; - - case 'histogram_data': - reporting_enterprise_html_histogram_data($table, $item, $mini); - break; } if ($item['type'] == 'agent_module') { diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index b19be7f93c..a5c21eea9f 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -757,10 +757,6 @@ function reports_get_report_types($template=false, $not_editor=false) 'optgroup' => __('Modules'), 'name' => __('Last value'), ]; - $types['histogram_data'] = [ - 'optgroup' => __('Modules'), - 'name' => __('Histogram'), - ]; $types['general'] = [ 'optgroup' => __('Grouped'),