From 3f27e0a306dc7a45c34574e735b61fc943a8381e Mon Sep 17 00:00:00 2001 From: vgilc Date: Tue, 4 Apr 2017 13:48:11 +0200 Subject: [PATCH] Revert "Merge branch 'remove-traces-debug' into 'develop'" This reverts merge request !266 --- .../include/ajax/visual_console.ajax.php | 4 ++-- pandora_console/include/graphs/flot/pandora.flot.js | 13 +++++++++---- pandora_console/include/javascript/pandora.js | 2 ++ .../include/javascript/pandora_events.js | 1 + pandora_console/operation/agentes/estado_agente.php | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/ajax/visual_console.ajax.php b/pandora_console/include/ajax/visual_console.ajax.php index d736a71374..789398139c 100644 --- a/pandora_console/include/ajax/visual_console.ajax.php +++ b/pandora_console/include/ajax/visual_console.ajax.php @@ -39,8 +39,8 @@ $render_map = (bool)get_parameter('render_map', false); $graph_javascript = (bool)get_parameter('graph_javascript', false); if ($render_map) { - $width = (int) get_parameter('width', '400'); - $height = (int) get_parameter('height', '400'); + $width = (int)get_parameter('width', '400'); + $height = (int)get_parameter('height', '400'); $keep_aspect_ratio = (bool) get_parameter('keep_aspect_ratio'); visual_map_print_visual_map($id_visual_console, true, true, $width, diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index af8875d8b3..b6f1eb2308 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1923,9 +1923,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (thresholded) { $.each(data_base, function() { - datas.push(this); + // Prepared to turning series + //if(showed[this.id.split('_')[1]]) { + datas.push(this); + //} }); - plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { yaxis: {max: max_draw}, @@ -1933,6 +1935,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, thresholded = false; } else { + var max_draw = plot.getAxes().yaxis.datamax; if (max_draw < red_threshold || max_draw < yellow_threshold) { @@ -1942,8 +1945,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $.extend(true, {}, options, { yaxis: {max: maxim_data + (maxim_data*0.5)}, })); - } - else { + } else { plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { yaxis: {max: plot.getAxes().yaxis.max}, @@ -1952,10 +1954,13 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, yellow_threshold, red_threshold, extremes, red_up); thresholded = true; + } plot.setData(datas); plot.draw(); + + //~ plot.setSelection(currentRanges); }); $('#menu_cancelzoom_' + graph_id).click(function() { diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index d762d399e1..b46e6a4b18 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -401,6 +401,8 @@ function alert_templates_changed_by_multiple_agents_with_alerts (event, id_agent templates.push($(val).val()); }); + console.log(templates); + $('#module').attr ('disabled', 1); $('#module').empty (); $('#module').append ($('').html ("Loading...").attr ("value", 0)); diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index bef17eda6e..7b78c0a637 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -542,6 +542,7 @@ function show_events_group_agent (id_insert, id_agent, server_id) { data: parameter, dataType: 'html', success: function (data) { + console.log(data); $("#"+id_insert).html(data); $("#"+id_insert).toggle(); } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 7028394fd9..1d711398d6 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -652,6 +652,7 @@ else {