From 139c4d0d4070913b95a3213a30263a911f5c1132 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 16 Mar 2017 16:38:24 +0100 Subject: [PATCH 01/63] Fixed styles and reorganizate elements of graphs. Gitlab: #537 --- pandora_console/include/functions.php | 3 +- .../include/graphs/flot/pandora.flot.js | 61 +++++++++---------- .../include/graphs/functions_flot.php | 7 ++- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index ae6cce3efc..1892b216ef 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1531,7 +1531,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmpwalk_bin = '/usr/pkg/bin/snmpwalk'; break; default: - $snmpwalk_bin = 'snmpwalk'; + $snmpwalk_bin = 'snmpbulkwalk'; break; } } @@ -1598,6 +1598,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', break; } + html_debug($command_str, true); exec($command_str, $output, $rc); // Parse the output of snmpwalk diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index b6f1eb2308..a777f9a7cc 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1540,33 +1540,30 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, tickColor: background_color, markings: markings, color: legend_color - }, - xaxes: [ { - axisLabelFontSizePixels: font_size, - axisLabelUseCanvas: false, - axisLabel: xaxisname, - tickFormatter: xFormatter, - //~ minTickSize: steps, - color: '', - font: font - } ], - yaxes: [ { - tickFormatter: yFormatter, - color: '' - }, - { - // align if we are to the right - alignTicksWithAxis: 1, - position: 'right', - font: font - //tickFormatter: dFormatter - } ] - , + }, + xaxes: [{ + axisLabelFontSizePixels: font_size, + axisLabelUseCanvas: false, + axisLabel: xaxisname, + tickFormatter: xFormatter, + labelHeight: 50, + color: '', + font: font + }], + yaxes: [{ + tickFormatter: yFormatter, + color: '', + alignTicksWithAxis: 1, + position: 'left', + font: font, + labelWidth: 50, + reserveSpace: true, + }], legend: { position: 'se', container: $('#legend_' + graph_id), labelFormatter: lFormatter - } + } }; if (vconsole) { options.grid['hoverable'] = false; @@ -1874,18 +1871,18 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (labels[v] == undefined) { return ''; } - return '
'+labels[v]+'
'; + return '
'+labels[v]+'
'; } function yFormatter(v, axis) { axis.datamin = 0; var formatted = number_format(v,force_integer,unit); - return '
'+formatted+'
'; + return '
'+formatted+'
'; } function lFormatter(v, item) { - return '
'+v+'
'; + return '
'+v+'
'; // Prepared to turn series with a checkbox //return '
'+v+'
'; } @@ -1994,7 +1991,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $('#legend_'+graph_id).css('margin-bottom', '10px'); parent_height = parseInt( $('#menu_'+graph_id).parent().css('height').split('px')[0]); - adjust_menu(graph_id, plot, parent_height); + adjust_menu(graph_id, plot, parent_height, width); } if (!dashboard) { @@ -2028,16 +2025,16 @@ function adjust_menu(graph_id, plot, parent_height, width) { menu_height = $('#menu_'+graph_id).height(); } - offset_between_graph_and_div_graph_container = $('#' + graph_id).offset().top - - $('#' + graph_id).parent().offset().top; + offset = $('#' + graph_id).offsetTop; + $('#menu_' + graph_id) .css('top', - ((offset_between_graph_and_div_graph_container - menu_height - 5) + 'px')); + ((offset + 10) + 'px')); //$('#legend_' + graph_id).css('width',plot.width()); - $('#menu_' + graph_id) - .css('left',width - $('#menu_'+graph_id).width()); + $('#menu_' + graph_id).css('left', $('#'+graph_id)[0].offsetWidth); + $('#menu_' + graph_id).show(); } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d3bf902fd9..1c191a288e 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -203,7 +203,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, } // Parent layer - $return = "
"; + $return = "
"; // Set some containers to legend, graph, timestamp tooltip, etc. $return .= "

"; @@ -245,9 +245,10 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $return .= "