2014-03-10 Miguel de Dios <miguel.dedios@artica.es>

* include/graphs/flot/pandora.flot.js: fixed the position of buttons
	in the flot area graphs when the graphs are in other pages than
	stat win.
	
	Incident: #560
	
	* operation/agentes/graphs.php, include/graphs/fgraph.php,
	include/graphs/functions_flot.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-10 15:59:36 +00:00
parent eb9a8dadf9
commit 95675f4b5e
5 changed files with 54 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2014-03-10 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/flot/pandora.flot.js: fixed the position of buttons
in the flot area graphs when the graphs are in other pages than
stat win.
Incident: #560
* operation/agentes/graphs.php, include/graphs/fgraph.php,
include/graphs/functions_flot.php: cleaned source code style.
2014-03-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora_snmp_browser.js,

View File

@ -219,7 +219,24 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
}
if ($flash_chart) {
return flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url, $series_type, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, $menu);
return flot_area_simple_graph(
$chart_data,
$width,
$height,
$color,
$legend,
$long_index,
$homeurl,
$unit,
$water_mark_url,
$series_type,
$chart_extra_data,
$yellow_threshold,
$red_threshold,
$adapt_key,
$force_integer,
$series_suffix_str,
$menu);
}
else {
$graph = array();

View File

@ -1012,8 +1012,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors,
// Adjust the menu image on top of the plot
// If there is no legend we increase top-padding to make space to the menu
if (legends.length == 0) {
$('#menu_'+graph_id).parent().css('padding-top',$('#menu_'+graph_id).css('height'));
$('#menu_' + graph_id).parent().css('padding-top',
$('#menu_' + graph_id).css('height'));
}
// Add bottom margin in the legend
// Estimated height of 24 (works fine with this data in all browsers)
menu_height = 24;
@ -1049,15 +1051,22 @@ function adjust_menu(graph_id, plot, parent_height) {
}
var menu_height = '25';
if($('#menu_'+graph_id).height() != undefined && $('#menu_'+graph_id).height() > 20) {
if ($('#menu_'+graph_id).height() != undefined && $('#menu_'+graph_id).height() > 20) {
menu_height = $('#menu_'+graph_id).height();
}
$('#menu_'+graph_id).css('top', (($('#'+graph_id).offset().top-menu_height-15)+'px'));
$('#legend_'+graph_id).css('width',plot.width());
$('#menu_'+graph_id).css('left',plot.width()-$('#menu_'+graph_id).width() + 10);
$('#menu_'+graph_id).show();
offset_between_graph_and_div_graph_container = $('#' + graph_id).offset().top -
$('#' + graph_id).parent().offset().top;
$('#menu_' + graph_id)
.css('top',
((offset_between_graph_and_div_graph_container - menu_height - 5) + 'px'));
$('#legend_' + graph_id).css('width',plot.width());
$('#menu_' + graph_id)
.css('left',plot.width() - $('#menu_'+graph_id).width() + 10);
$('#menu_' + graph_id).show();
}
function set_watermark(graph_id, plot, watermark_src) {

View File

@ -126,12 +126,12 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in
$graph_id = uniqid('graph_');
// Parent layer
$return = "<div class='parent_graph' style='width: ".$width."px;'>";
$return = "<div class='parent_graph' style='width: " . $width . "px;'>";
// Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>";
$return .= "<div id='timestamp_$graph_id' class='timestamp_graph' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px; z-index:1000;'></div>";
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
if($menu) {
if ($menu) {
$height = 100;
}
else {

View File

@ -60,13 +60,17 @@ $table->size[1] = '80%';
$table->style[0] = 'font-weight: bolder; text-align: right;';
$table->style[1] = '';
$table->valign[0] = 'top';
$table->data[0][0] = __('Modules');
$listModules = array();
foreach ($modules as $id => $module) {
$checked = false;
if (isset($modulesChecked[$id]))
$checked = (bool) $modulesChecked[$id];
$listModules[] = '<span style="white-space: nowrap;">' . html_print_checkbox('modules[' . $id . ']', 1, $checked, true) . ' ' . $module . '</span>';
$listModules[] = '<span style="white-space: nowrap;">' .
html_print_checkbox('modules[' . $id . ']', 1, $checked, true, false, '', true) .
' ' . $module . '</span>';
}
$table->data[0][1] = implode(' ', $listModules);
@ -112,7 +116,9 @@ else
foreach ($modulesChecked as $idModuleShowGraph => $value) {
echo "<h4>" . $modules[$idModuleShowGraph] . '</h4>';
$unit = modules_get_unit ($idModuleShowGraph);
echo grafico_modulo_sparse($idModuleShowGraph, $period, $draw_events, $width, $height,
$modules[$idModuleShowGraph], null, $draw_alerts, $avg_only, false, $date, $unit);
}