From 4777ecd4bf310eb61f61f7e8ffdb0a9ae8ce5421 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 24 Mar 2020 10:12:14 +0100 Subject: [PATCH] Ent 5439 error grafica eventos de agente --- pandora_console/include/functions_graph.php | 6 +++--- pandora_console/include/functions_treeview.php | 2 +- pandora_console/include/graphs/flot/pandora.flot.js | 7 +++++-- pandora_console/include/graphs/functions_flot.php | 5 +++-- pandora_console/operation/events/events.php | 5 ++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index ce20278c15..103fa957d0 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3809,7 +3809,7 @@ function graph_custom_sql_graph( * @param string homeurl * @param bool return or echo the result */ -function graph_graphic_agentevents($id_agent, $width, $height, $period=0, $homeurl, $return=false, $from_agent_view=false, $widgets=false) +function graph_graphic_agentevents($id_agent, $width, $height, $period=0, $homeurl, $return=false, $from_agent_view=false, $widgets=false, $server_id='') { global $config; global $graphic_type; @@ -3885,8 +3885,8 @@ function graph_graphic_agentevents($id_agent, $width, $height, $period=0, $homeu ]; // Draw slicebar graph - $out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent, $full_legend_date, 0, 1, $widgets); - + $out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent, $full_legend_date, 0, 1, $widgets, true, false, $server_id); + // id_server if ($return) { return $out; } else { diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index a15b0f93d9..c7efb25f60 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -767,7 +767,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) } $events_graph = '
'; - $events_graph .= graph_graphic_agentevents($id_agente, 375, 45, SECONDS_1DAY, '', true, false, true); + $events_graph .= graph_graphic_agentevents($id_agente, 375, 45, SECONDS_1DAY, '', true, false, true, $server_id); $events_graph .= '

'; ui_toggle($events_graph, __('Events (24h)')); diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index aed866334d..ba4c971a7a 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -786,7 +786,8 @@ function pandoraFlotSlicebar( full_legend, not_interactive, show_date, - datelimit + datelimit, + server_id ) { values = values.split(separator2); legend = legend.split(separator); @@ -934,7 +935,9 @@ function pandoraFlotSlicebar( date_from: newdate, time_from: from + ":00", status: "-1", - group_rep: "1" + group_rep: "1", + from_event_graph: 1, + id_server_meta: server_id }; if (full_legend != "") { diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 04560b6ce0..5445884a8a 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -740,7 +740,8 @@ function flot_slicesbar_graph( $ttl=1, $widgets=false, $show=true, - $date_to=false + $date_to=false, + $server_id='' ) { global $config; @@ -880,7 +881,7 @@ function flot_slicesbar_graph( // Javascript code. $return .= "'; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 3c758fde12..6c30d0c0fd 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -417,7 +417,10 @@ $user_filter = db_get_row_sql( $config['id_user'] ) ); -if ($user_filter !== false) { + +// Do not load the user filter if we come from the 24h event graph +$from_event_graph = get_parameter('filter[from_event_graph]', $filter['from_event_graph']); +if ($user_filter !== false && $from_event_graph != 1) { $filter = events_get_event_filter($user_filter['id_filter']); if ($filter !== false) { $id_group = $filter['id_group'];