mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2009-03-17 Esteban Sanchez <estebans@artica.es>
* reporting/fgraph.php: Fixed a bug on graphic_error() which always showed image_problem.png. Fixed period labels shorter than days. Fixed an error when fetching data on grafico_modulo_sparse() which was causing to show nothing. Do not show a legend on graph_event_module(). Fixed x axis interval on boolean charts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1545 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9ce6d69b4a
commit
c5a2e297d5
@ -1,3 +1,11 @@
|
|||||||
|
2009-03-17 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* reporting/fgraph.php: Fixed a bug on graphic_error() which always
|
||||||
|
showed image_problem.png. Fixed period labels shorter than days. Fixed
|
||||||
|
an error when fetching data on grafico_modulo_sparse() which was
|
||||||
|
causing to show nothing. Do not show a legend on graph_event_module().
|
||||||
|
Fixed x axis interval on boolean charts.
|
||||||
|
|
||||||
2009-03-17 Esteban Sanchez <estebans@artica.es>
|
2009-03-17 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* godmode/agentes/massive_operations.php: Added to repository. New
|
* godmode/agentes/massive_operations.php: Added to repository. New
|
||||||
|
@ -39,7 +39,7 @@ function graphic_error ($image = 'image_problem.png') {
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
Header ('Content-type: image/png');
|
Header ('Content-type: image/png');
|
||||||
$img = imagecreatefromPng ($config['homedir'].'/images/'.'image_problem.png');
|
$img = imagecreatefromPng ($config['homedir'].'/images/'.$image);
|
||||||
imagealphablending ($img, true);
|
imagealphablending ($img, true);
|
||||||
imagesavealpha ($img, true);
|
imagesavealpha ($img, true);
|
||||||
imagepng ($img);
|
imagepng ($img);
|
||||||
@ -195,7 +195,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
|
|||||||
// Check min value
|
// Check min value
|
||||||
if ($datos < $data[$j]['min'])
|
if ($datos < $data[$j]['min'])
|
||||||
$data[$j]['min'] = $datos;
|
$data[$j]['min'] = $datos;
|
||||||
}
|
}
|
||||||
// Check max value
|
// Check max value
|
||||||
if ($datos > $data[$j]['max'])
|
if ($datos > $data[$j]['max'])
|
||||||
$data[$j]['max'] = $datos;
|
$data[$j]['max'] = $datos;
|
||||||
@ -235,12 +235,12 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
|
|||||||
$module_list_name[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
$module_list_name[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($period <= 86400)
|
if ($period <= 3600)
|
||||||
|
$title_period = __('Last hour');
|
||||||
|
elseif ($period <= 86400)
|
||||||
$title_period = __('Last day');
|
$title_period = __('Last day');
|
||||||
elseif ($period <= 604800)
|
elseif ($period <= 604800)
|
||||||
$title_period = __('Last week');
|
$title_period = __('Last week');
|
||||||
elseif ($period <= 3600)
|
|
||||||
$title_period = __('Last hour');
|
|
||||||
elseif ($period <= 2419200)
|
elseif ($period <= 2419200)
|
||||||
$title_period = __('Last month');
|
$title_period = __('Last month');
|
||||||
else
|
else
|
||||||
@ -299,8 +299,7 @@ function grafico_modulo_sparse ($id_agente_modulo, $period, $show_event,
|
|||||||
}
|
}
|
||||||
|
|
||||||
$all_data = get_db_all_rows_filter ('tagente_datos',
|
$all_data = get_db_all_rows_filter ('tagente_datos',
|
||||||
array ('id_agente' => (int) $id_agente,
|
array ('id_agente_modulo' => (int) $id_agente_modulo,
|
||||||
'id_agente_modulo' => (int) $id_agente_modulo,
|
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
'order' => 'utimestamp ASC'),
|
'order' => 'utimestamp ASC'),
|
||||||
@ -380,12 +379,12 @@ function grafico_modulo_sparse ($id_agente_modulo, $period, $show_event,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($period <= 86400)
|
if ($period <= 3600)
|
||||||
|
$title_period = __('Last hour');
|
||||||
|
elseif ($period <= 86400)
|
||||||
$title_period = __('Last day');
|
$title_period = __('Last day');
|
||||||
elseif ($period <= 604800)
|
elseif ($period <= 604800)
|
||||||
$title_period = __('Last week');
|
$title_period = __('Last week');
|
||||||
elseif ($period <= 3600)
|
|
||||||
$title_period = __('Last hour');
|
|
||||||
elseif ($period <= 2419200)
|
elseif ($period <= 2419200)
|
||||||
$title_period = __('Last month');
|
$title_period = __('Last month');
|
||||||
else
|
else
|
||||||
@ -655,7 +654,9 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
|
|||||||
$data = array_slice ($data, 0, $max_items);
|
$data = array_slice ($data, 0, $max_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
generic_pie_graph ($width, $height, $data, array ('zoom' => 75));
|
generic_pie_graph ($width, $height, $data,
|
||||||
|
array ('zoom' => 75,
|
||||||
|
'show_legend' => false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1005,12 +1006,12 @@ function grafico_modulo_boolean ($id_agente_modulo, $period, $show_event,
|
|||||||
$grafica[$d['timestamp_bottom']] = $d['sum'];
|
$grafica[$d['timestamp_bottom']] = $d['sum'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($period <= 86400)
|
if ($period <= 3600)
|
||||||
|
$title_period = __('Last hour');
|
||||||
|
elseif ($period <= 86400)
|
||||||
$title_period = __('Last day');
|
$title_period = __('Last day');
|
||||||
elseif ($period <= 604800)
|
elseif ($period <= 604800)
|
||||||
$title_period = __('Last week');
|
$title_period = __('Last week');
|
||||||
elseif ($period <= 3600)
|
|
||||||
$title_period = __('Last hour');
|
|
||||||
elseif ($period <= 2419200)
|
elseif ($period <= 2419200)
|
||||||
$title_period = __('Last month');
|
$title_period = __('Last month');
|
||||||
else
|
else
|
||||||
@ -1032,9 +1033,9 @@ function grafico_modulo_boolean ($id_agente_modulo, $period, $show_event,
|
|||||||
$engine->alert_bottom = $show_alert ? $alert_low : false;;
|
$engine->alert_bottom = $show_alert ? $alert_low : false;;
|
||||||
|
|
||||||
if ($period < 10000)
|
if ($period < 10000)
|
||||||
$engine->xaxis_interval = 8;
|
$engine->xaxis_interval = 20;
|
||||||
else
|
else
|
||||||
$engine->xaxis_interval = $resolution / 7;
|
$engine->xaxis_interval = $resolution * 4;
|
||||||
$engine->yaxis_interval = 1;
|
$engine->yaxis_interval = 1;
|
||||||
$engine->xaxis_format = 'date';
|
$engine->xaxis_format = 'date';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user