diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5d9c09275a..350984b3b3 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -708,10 +708,10 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $width, $height , $title = '', $unit_name = null, - $show_alerts = false, $avg_only = 0, $pure = false, - $date = 0, $unit = '', $baseline = 0, $return_data = 0, - $show_title = true, $only_image = false, $homeurl = '', $ttl = 1, - $projection = false, $adapt_key = '', $compare = false, $show_unknown = false, + $show_alerts = false, $avg_only = 0, $pure = false, $date = 0, + $unit = '', $baseline = 0, $return_data = 0, $show_title = true, + $only_image = false, $homeurl = '', $ttl = 1, $projection = false, + $adapt_key = '', $compare = false, $show_unknown = false, $menu = true, $backgroundColor = 'white') { global $config; @@ -735,7 +735,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $series_suffix_str = ''; if ($compare !== false) { $series_suffix = '2'; - $series_suffix_str = ' ('.__('Previous').')'; + $series_suffix_str = ' (' . __('Previous') . ')'; // Build the data of the previous period grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, @@ -761,7 +761,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $series_type_prev = $series_type; $color_prev = $color; foreach($color_prev as $k => $col) { - $color_prev[$k]['color'] = '#'.get_complementary_rgb($color_prev[$k]['color']); + $color_prev[$k]['color'] = '#' . + get_complementary_rgb($color_prev[$k]['color']); } break; } diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 7e95c61945..061a33e30f 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -764,6 +764,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, var legends = $('#legend_' + graph_id + ' .legendLabel'); + var updateLegendTimeout = null; var latestPosition = null; var currentPlot = null; @@ -839,11 +840,17 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, // The graphs of points type and unknown graphs will dont be updated if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) { - legends.eq(i).text(label_aux.replace(/=.*/, '= ' + parseFloat(y).toFixed(2) +' '+unit)); + + $('#legend_' + graph_id + ' .legendLabel') + .eq(i).text(label_aux.replace(/=.*/, + '= ' + parseFloat(y).toFixed(2) + ' ' + unit)); } - legends.eq(i).css('font-size',font_size+'pt'); - legends.eq(i).css('color','#000'); + $('#legend_' + graph_id + ' .legendLabel') + .eq(i).css('font-size',font_size+'pt'); + + $('#legend_' + graph_id + ' .legendLabel') + .eq(i).css('color','#000'); i++; } @@ -936,7 +943,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $('#timestamp_'+graph_id).hide(); dataset = plot.getData(); for (i = 0; i < dataset.length; ++i) { - legends.eq(i).text(legends.eq(i).text().replace(/=.*/, '')); + $('#legend_' + graph_id + ' .legendLabel') + .eq(i).text(legends.eq(i).text().replace(/=.*/, '')); } plot.clearCrosshair(); overview.clearCrosshair(); @@ -972,14 +980,14 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (menu) { var parent_height; - $('#menu_overview_'+graph_id).click(function() { - if ( $('#overview_'+graph_id).css('visibility') == 'hidden' ) - $('#overview_'+graph_id).css('visibility','visible'); + $('#menu_overview_' + graph_id).click(function() { + if ( $('#overview_' + graph_id).css('visibility') == 'hidden' ) + $('#overview_' + graph_id).css('visibility','visible'); else - $('#overview_'+graph_id).css('visibility','hidden'); + $('#overview_' + graph_id).css('visibility','hidden'); }); - $('#menu_threshold_'+graph_id).click(function() { + $('#menu_threshold_' + graph_id).click(function() { datas = new Array(); if (thresholded) { @@ -999,12 +1007,12 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, //} }); - plot = $.plot($('#'+graph_id), datas, options); + plot = $.plot($('#' + graph_id), datas, options); plot.setSelection(currentRanges); }); - $('#menu_cancelzoom_'+graph_id).click(function() { + $('#menu_cancelzoom_' + graph_id).click(function() { // cancel the zooming plot = $.plot($('#'+graph_id), data_base, $.extend(true, {}, options, { @@ -1012,7 +1020,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, legend: { show: false } })); - $('#menu_cancelzoom_'+graph_id).attr('src',homeurl+'/images/zoom_cross.disabled.png'); + $('#menu_cancelzoom_' + graph_id) + .attr('src', homeurl + '/images/zoom_cross.disabled.png'); overview.clearSelection(); currentRanges = null; }); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 4130ad3e4a..614a96f05a 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -33,7 +33,9 @@ if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) { $loginhash_data = get_parameter("loginhash_data", ""); $loginhash_user = get_parameter("loginhash_user", ""); - if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) { + if ($config["loginhash_pwd"] != "" + && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) { + db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $loginhash_user; $config["id_user"] = $loginhash_user; @@ -101,7 +103,8 @@ $label = base64_decode(get_parameter('label', '')); // Get input parameters $label = get_parameter ("label",""); if (!isset($_GET["period"]) OR (!isset($_GET["id"]))) { - ui_print_error_message(__('There was a problem locating the source of the graph')); + ui_print_error_message( + __('There was a problem locating the source of the graph')); exit; } @@ -202,9 +205,9 @@ $label = base64_decode(get_parameter('label', '')); } echo ''; - /////////////////////////// + //////////////////////////////////////////////////////////////// // SIDE MENU - /////////////////////////// + //////////////////////////////////////////////////////////////// $params = array(); // TOP TEXT $params['top_text'] = "