mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Fixed bugs in metaconsole reports
This commit is contained in:
parent
d566da6fb1
commit
454750aefe
@ -124,8 +124,26 @@ function custom_graphs_get_user($id_user=0, $only_names=false, $returnAllGroup=t
|
|||||||
}
|
}
|
||||||
|
|
||||||
$groups = users_get_groups($id_user, $privileges, $returnAllGroup);
|
$groups = users_get_groups($id_user, $privileges, $returnAllGroup);
|
||||||
|
$all_graphs = [];
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
$servers = metaconsole_get_connection_names();
|
||||||
|
foreach ($servers as $key => $server) {
|
||||||
|
$connection = metaconsole_get_connection($server);
|
||||||
|
if (metaconsole_connect($connection) != NOERR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$all_graph = db_get_all_rows_in_table('tgraph', 'name');
|
||||||
|
if ($all_graph !== false) {
|
||||||
|
$all_graphs = array_merge($all_graphs, $all_graph);
|
||||||
|
}
|
||||||
|
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$all_graphs = db_get_all_rows_in_table('tgraph', 'name');
|
||||||
|
}
|
||||||
|
|
||||||
$all_graphs = db_get_all_rows_in_table('tgraph', 'name');
|
|
||||||
if ($all_graphs === false) {
|
if ($all_graphs === false) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -7488,10 +7488,12 @@ function reporting_custom_graph(
|
|||||||
|
|
||||||
if ($type_report == 'custom_graph') {
|
if ($type_report == 'custom_graph') {
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole()) {
|
||||||
$id_meta = metaconsole_get_id_server($content['server_name']);
|
$servers = metaconsole_get_connection_names();
|
||||||
$server = metaconsole_get_connection_by_id($id_meta);
|
foreach ($servers as $server) {
|
||||||
if (metaconsole_connect($server) != NOERR) {
|
$connection = metaconsole_get_connection($server);
|
||||||
return false;
|
if (metaconsole_connect($connection) != NOERR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,6 +251,7 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
reporting_html_sql($table, $item);
|
reporting_html_sql($table, $item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'simple_baseline_graph':
|
||||||
case 'simple_graph':
|
case 'simple_graph':
|
||||||
reporting_html_graph($table, $item);
|
reporting_html_graph($table, $item);
|
||||||
break;
|
break;
|
||||||
@ -315,10 +316,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
reporting_html_prediction_date($table, $item, $mini);
|
reporting_html_prediction_date($table, $item, $mini);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'simple_baseline_graph':
|
|
||||||
reporting_html_graph($table, $item);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'netflow_area':
|
case 'netflow_area':
|
||||||
case 'netflow_data':
|
case 'netflow_data':
|
||||||
case 'netflow_summary':
|
case 'netflow_summary':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user