fixed errors in graph
This commit is contained in:
parent
a8b8f309e6
commit
47a287b6f6
|
@ -45,31 +45,37 @@ if ($save_custom_graph) {
|
||||||
if ($print_custom_graph) {
|
if ($print_custom_graph) {
|
||||||
ob_clean();
|
ob_clean();
|
||||||
|
|
||||||
$id_graph = (int) get_parameter('id_graph');
|
$params =array(
|
||||||
$height = (int) get_parameter('height', CHART_DEFAULT_HEIGHT);
|
'period' => (int) get_parameter('period', SECONDS_5MINUTES),
|
||||||
$width = (int) get_parameter('width', CHART_DEFAULT_WIDTH);
|
'width' => (int) get_parameter('width', CHART_DEFAULT_WIDTH),
|
||||||
$period = (int) get_parameter('period', SECONDS_5MINUTES);
|
'height' => (int) get_parameter('height', CHART_DEFAULT_HEIGHT),
|
||||||
$stacked = (int) get_parameter('stacked', CUSTOM_GRAPH_LINE);
|
'unit_name' => get_parameter('unit_list', array()),
|
||||||
$date = (int) get_parameter('date', time());
|
'date' => (int) get_parameter('date', time()),
|
||||||
$only_image = (bool) get_parameter('only_image');
|
'only_image' => (bool) get_parameter('only_image', false),
|
||||||
$background_color = (string) get_parameter('background_color', 'white');
|
'homeurl' => (string) get_parameter('homeurl', ''),
|
||||||
$modules_param = get_parameter('modules_param', array());
|
'ttl' => (int) get_parameter('ttl', 1),
|
||||||
$homeurl = (string) get_parameter('homeurl');
|
'dashboard' => (bool) get_parameter('dashboard', false),
|
||||||
$name_list = get_parameter('name_list', array());
|
'vconsole' => (bool) get_parameter('vconsole', false),
|
||||||
$unit_list = get_parameter('unit_list', array());
|
'fullscale' => (bool) get_parameter('fullscale', false),
|
||||||
$show_last = (bool) get_parameter('show_last', true);
|
'backgroundColor' => (string) get_parameter('background_color', 'white'),
|
||||||
$show_max = (bool) get_parameter('show_max', true);
|
'show_alerts' => (bool) get_parameter('show_alerts'),
|
||||||
$show_min = (bool) get_parameter('show_min', true);
|
'show_events' => (bool) get_parameter('show_events'),
|
||||||
$show_avg = (bool) get_parameter('show_avg', true);
|
'type_graph' => get_parameter('type_g', $config['type_module_charts']),
|
||||||
$ttl = (int) get_parameter('ttl', 1);
|
);
|
||||||
$dashboard = (bool) get_parameter('dashboard');
|
|
||||||
$vconsole = (bool) get_parameter('vconsole');
|
|
||||||
$fullscale = (bool) get_parameter('fullscale');
|
|
||||||
|
|
||||||
echo custom_graphs_print($id_graph, $height, $width, $period, $stacked,
|
$params_combined = array(
|
||||||
true, $date, $only_image, $background_color, $modules_param,
|
'stacked' => (int) get_parameter('stacked', CUSTOM_GRAPH_LINE),
|
||||||
$homeurl, $name_list, $unit_list, $show_last, $show_max,
|
'labels' => get_parameter('name_list', array()),
|
||||||
$show_min, $show_avg, $ttl, $dashboard, $vconsole);
|
'modules_series' => get_parameter('modules_param', array()),
|
||||||
|
'id_graph' => (int) get_parameter('id_graph', 0),
|
||||||
|
'return' => 1
|
||||||
|
);
|
||||||
|
|
||||||
|
echo graphic_combined_module(
|
||||||
|
get_parameter('modules_param', array()),
|
||||||
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,24 +190,6 @@ if ($get_graphs){
|
||||||
break;
|
break;
|
||||||
case 'custom_graph':
|
case 'custom_graph':
|
||||||
if ($contador > 0) {
|
if ($contador > 0) {
|
||||||
$graph = db_get_all_rows_field_filter('tgraph', 'id_graph',$value['id_graph']);
|
|
||||||
|
|
||||||
$sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph',$value['id_graph']);
|
|
||||||
$modules = array ();
|
|
||||||
$weights = array ();
|
|
||||||
$labels = array ();
|
|
||||||
foreach ($sources as $source) {
|
|
||||||
array_push ($modules, $source['id_agent_module']);
|
|
||||||
array_push ($weights, $source['weight']);
|
|
||||||
if ($source['label'] != ''){
|
|
||||||
$item['type'] = 'custom_graph';
|
|
||||||
$item['id_agent'] = agents_get_module_id($source['id_agent_module']);
|
|
||||||
$item['id_agent_module'] = $source['id_agent_module'];
|
|
||||||
$labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$homeurl = ui_get_full_url(false, false, false, false);
|
|
||||||
$graph_conf = db_get_row('tgraph', 'id_graph', $value['id_graph']);
|
$graph_conf = db_get_row('tgraph', 'id_graph', $value['id_graph']);
|
||||||
|
|
||||||
if($graph_conf['stacked'] == 4 || $graph_conf['stacked'] == 9){
|
if($graph_conf['stacked'] == 4 || $graph_conf['stacked'] == 9){
|
||||||
|
@ -211,40 +199,28 @@ if ($get_graphs){
|
||||||
} else {
|
} else {
|
||||||
$height = 300;
|
$height = 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
$table .= "<div style='width: 90%'><h4>".$graph[0]['name']."</h4><hr></div>";
|
$table .= "<div style='width: 90%'><h4>".$graph[0]['name']."</h4><hr></div>";
|
||||||
$table .= graphic_combined_module(
|
|
||||||
$modules,
|
$params =array(
|
||||||
$weights,
|
'period' => $value['time_lapse'],
|
||||||
$value['time_lapse'],
|
'width' => 1000,
|
||||||
1000,
|
'height' => $height,
|
||||||
$height,
|
'percentil' => $graph_conf['percentil'] == 1,
|
||||||
'',
|
'fullscale' => $value['fullscale']
|
||||||
'',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$graph_conf['stacked'],
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
$homeurl,
|
|
||||||
1,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
'white',
|
|
||||||
array(),
|
|
||||||
array(),
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
$labels,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$graph_conf['percentil'] == 1,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$value['fullscale']
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'stacked' => $graph_conf['stacked'],
|
||||||
|
'id_graph' => $value['id_graph']
|
||||||
|
);
|
||||||
|
|
||||||
|
$table .= graphic_combined_module(
|
||||||
|
false,
|
||||||
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
|
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -252,10 +252,24 @@ switch ($action) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$params =array(
|
||||||
|
'period' => $period,
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'vconsole' => true,
|
||||||
|
'backgroundColor'=> $background_color
|
||||||
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'id_graph' => $id_custom_graph
|
||||||
|
);
|
||||||
|
|
||||||
if ($id_custom_graph != 0) {
|
if ($id_custom_graph != 0) {
|
||||||
$img = custom_graphs_print(
|
$img = graphic_combined_module(
|
||||||
$id_custom_graph, $height, $width, $period,
|
false,
|
||||||
null, true, 0, true, $background_color);
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$params =array(
|
$params =array(
|
||||||
|
@ -264,8 +278,6 @@ switch ($action) {
|
||||||
'show_events' => false,
|
'show_events' => false,
|
||||||
'width' => $width,
|
'width' => $width,
|
||||||
'height' => $height,
|
'height' => $height,
|
||||||
//'only_image' => true,
|
|
||||||
//'homeurl' => '',
|
|
||||||
'menu' => false,
|
'menu' => false,
|
||||||
'backgroundColor' => $background_color,
|
'backgroundColor' => $background_color,
|
||||||
'vconsole' => true,
|
'vconsole' => true,
|
||||||
|
|
|
@ -99,10 +99,27 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
|
||||||
$params['only_image'] = false;
|
$params['only_image'] = false;
|
||||||
$params['width'] = '1048';
|
$params['width'] = '1048';
|
||||||
|
|
||||||
|
//cominadasssss
|
||||||
|
$params_combined = json_decode($_GET['data_combined'], true);
|
||||||
|
$module_list = json_decode($_GET['data_module_list'], true);
|
||||||
|
$type_graph_pdf = $_GET['type_graph_pdf'];
|
||||||
|
|
||||||
|
if($type_graph_pdf == 'combined'){
|
||||||
|
echo '<p> Grafica molona para combinadaaaaaaaaaaaaa</p>';
|
||||||
|
echo '<div>';
|
||||||
|
echo graphic_combined_module(
|
||||||
|
$module_list,
|
||||||
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
elseif($type_graph_pdf == 'sparse'){
|
||||||
echo '<p> Grafica molona para ' . $params['agent_module_id'] . '</p>';
|
echo '<p> Grafica molona para ' . $params['agent_module_id'] . '</p>';
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
echo grafico_modulo_sparse ($params);
|
echo grafico_modulo_sparse ($params);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -3117,23 +3117,32 @@ function series_type_graph_array($data, $show_elements_graph){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generator_chart_to_pdf($params){
|
function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined = false, $module_list = false){
|
||||||
global $config;
|
global $config;
|
||||||
$params_encode_json = urlencode(json_encode($params));
|
|
||||||
$file_js = $config["homedir"] . "/include/web2image.js";
|
$file_js = $config["homedir"] . "/include/web2image.js";
|
||||||
$url = $config["homeurl"] . "/include/chart_generator.php";
|
$url = $config["homeurl"] . "/include/chart_generator.php";
|
||||||
|
$img_file = "img_". uniqid() .".png";
|
||||||
$img_file = "img_". uniqid() . $params['agent_module_id'] .".png";
|
|
||||||
$img_path = $config["homedir"] . "/attachment/" . $img_file;
|
$img_path = $config["homedir"] . "/attachment/" . $img_file;
|
||||||
$img_url = $config["homeurl"] . "/attachment/" . $img_file;
|
$img_url = $config["homeurl"] . "/attachment/" . $img_file;
|
||||||
|
|
||||||
error_log($img_url);
|
|
||||||
|
|
||||||
$width_img = 500;
|
$width_img = 500;
|
||||||
$height_img = 450;
|
$height_img = 450;
|
||||||
//html_debug_print('entrando en llamada a phantom.js.......', true);
|
|
||||||
$result = exec("phantomjs " . $file_js . " " . $url . " '" . $params_encode_json . "' " . $img_path . " " . $width_img . " " . $height_img);
|
$params_encode_json = urlencode(json_encode($params));
|
||||||
|
|
||||||
|
if($params_combined){
|
||||||
|
$params_combined = urlencode(json_encode($params_combined));
|
||||||
|
}
|
||||||
|
|
||||||
|
if($module_list){
|
||||||
|
$module_list = urlencode(json_encode($module_list));
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = exec("phantomjs " . $file_js . " " . $url . " '" . $type_graph_pdf . "' '" . $params_encode_json . "' '" . $params_combined . "' '" . $module_list . "' " . $img_path . " " . $width_img . " " . $height_img);
|
||||||
return '<img src="' . $img_url . '" />';
|
return '<img src="' . $img_url . '" />';
|
||||||
|
|
||||||
|
//html_debug_print('entrando en llamada a phantom.js.......', true);
|
||||||
//header('Content-Type: image/png;');
|
//header('Content-Type: image/png;');
|
||||||
//return '<img src="data:image/jpg;base64, '.$result.'" />';
|
//return '<img src="data:image/jpg;base64, '.$result.'" />';
|
||||||
//return "<img src='/var/www/html/pandora_console/attachment/imagen_". $params['agent_module_id'] .".png' alt='la imagen bonica'>";
|
//return "<img src='/var/www/html/pandora_console/attachment/imagen_". $params['agent_module_id'] .".png' alt='la imagen bonica'>";
|
||||||
|
|
|
@ -135,149 +135,7 @@ function custom_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGr
|
||||||
$graphs[$graph['id_graph']]['graphs_count'] = $graphsCount;
|
$graphs[$graph['id_graph']]['graphs_count'] = $graphsCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $graphs;
|
return $graphs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Print a custom graph image.
|
|
||||||
*
|
|
||||||
* @param $id_graph Graph id to print.
|
|
||||||
* @param $height Height of the returning image.
|
|
||||||
* @param $width Width of the returning image.
|
|
||||||
* @param $period Period of time to get data in seconds.
|
|
||||||
* @param $stacked Whether the graph is stacked or not.
|
|
||||||
* @param $return Whether to return an output string or echo now (optional, echo by default).
|
|
||||||
* @param $date Date to start printing the graph
|
|
||||||
* @param bool Wether to show an image instead a interactive chart or not
|
|
||||||
* @param string Background color
|
|
||||||
* @param array List of names for the items. Should have the same size as the module list.
|
|
||||||
* @param bool Show the last value of the item on the list.
|
|
||||||
* @param bool Show the max value of the item on the list.
|
|
||||||
* @param bool Show the min value of the item on the list.
|
|
||||||
* @param bool Show the average value of the item on the list.
|
|
||||||
*
|
|
||||||
* @return Mixed
|
|
||||||
*/
|
|
||||||
|
|
||||||
function custom_graphs_print($id_graph, $height, $width, $period,
|
|
||||||
$stacked = null, $return = false, $date = 0, $only_image = false,
|
|
||||||
$background_color = 'white', $modules_param = array(), $homeurl = '',
|
|
||||||
$name_list = array(), $unit_list = array(), $show_last = true,
|
|
||||||
$show_max = true, $show_min = true, $show_avg = true, $ttl = 1,
|
|
||||||
$dashboard = false, $vconsole = false, $percentil = null,
|
|
||||||
$from_interface = false,$id_widget_dashboard=false, $fullscale = false) {
|
|
||||||
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
if ($from_interface) {
|
|
||||||
if ($config["type_interface_charts"] == 'line') {
|
|
||||||
$graph_conf['stacked'] = CUSTOM_GRAPH_LINE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$graph_conf['stacked'] = CUSTOM_GRAPH_AREA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($id_graph == 0) {
|
|
||||||
$graph_conf['stacked'] = CUSTOM_GRAPH_LINE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$graph_conf = db_get_row('tgraph', 'id_graph', $id_graph);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($stacked === null) {
|
|
||||||
$stacked = $graph_conf['stacked'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$sources = false;
|
|
||||||
if ($id_graph == 0) {
|
|
||||||
$modules = $modules_param;
|
|
||||||
$count_modules = count($modules);
|
|
||||||
$weights = array_fill(0, $count_modules, 1);
|
|
||||||
|
|
||||||
if ($count_modules > 0)
|
|
||||||
$sources = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph',
|
|
||||||
$id_graph);
|
|
||||||
|
|
||||||
$series = db_get_all_rows_sql('SELECT summatory_series,average_series,modules_series FROM tgraph WHERE id_graph = '.$id_graph);
|
|
||||||
$summatory = $series[0]['summatory_series'];
|
|
||||||
$average = $series[0]['average_series'];
|
|
||||||
$modules_series = $series[0]['modules_series'];
|
|
||||||
|
|
||||||
$modules = array ();
|
|
||||||
$weights = array ();
|
|
||||||
$labels = array ();
|
|
||||||
foreach ($sources as $source) {
|
|
||||||
array_push ($modules, $source['id_agent_module']);
|
|
||||||
array_push ($weights, $source['weight']);
|
|
||||||
if ($source['label'] != ''){
|
|
||||||
$item['type'] = 'custom_graph';
|
|
||||||
$item['id_agent'] = agents_get_module_id($source['id_agent_module']);
|
|
||||||
$item['id_agent_module'] = $source['id_agent_module'];
|
|
||||||
$labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sources === false) {
|
|
||||||
if ($return){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No items.') ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($homeurl)) {
|
|
||||||
$homeurl = ui_get_full_url(false, false, false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$output = graphic_combined_module(
|
|
||||||
$modules,
|
|
||||||
$weights,
|
|
||||||
$period,
|
|
||||||
$width,
|
|
||||||
$height,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$stacked,
|
|
||||||
$date,
|
|
||||||
$only_image,
|
|
||||||
$homeurl,
|
|
||||||
$ttl,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$background_color,
|
|
||||||
$name_list,
|
|
||||||
array(),
|
|
||||||
$show_last,
|
|
||||||
$show_max,
|
|
||||||
$show_min,
|
|
||||||
$show_avg,
|
|
||||||
$labels,
|
|
||||||
$dashboard,
|
|
||||||
$vconsole,
|
|
||||||
$percentil,
|
|
||||||
$from_interface,
|
|
||||||
$id_widget_dashboard,
|
|
||||||
$fullscale,
|
|
||||||
$summatory,
|
|
||||||
$average,
|
|
||||||
$modules_series
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($return)
|
|
||||||
return $output;
|
|
||||||
echo $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -288,7 +288,10 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||||
$content,
|
$content,
|
||||||
$type,
|
$type,
|
||||||
$force_width_chart,
|
$force_width_chart,
|
||||||
$force_height_chart, 'custom_graph');
|
$force_height_chart,
|
||||||
|
'custom_graph',
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'automatic_graph':
|
case 'automatic_graph':
|
||||||
$report['contents'][] =
|
$report['contents'][] =
|
||||||
|
@ -297,7 +300,10 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||||
$content,
|
$content,
|
||||||
$type,
|
$type,
|
||||||
$force_width_chart,
|
$force_width_chart,
|
||||||
$force_height_chart, 'automatic_graph');
|
$force_height_chart,
|
||||||
|
'automatic_graph',
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
$report['contents'][] = reporting_text(
|
$report['contents'][] = reporting_text(
|
||||||
|
@ -374,7 +380,9 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||||
$content,
|
$content,
|
||||||
$type,
|
$type,
|
||||||
$force_width_chart,
|
$force_width_chart,
|
||||||
$force_height_chart);
|
$force_height_chart,
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'prediction_date':
|
case 'prediction_date':
|
||||||
$report['contents'][] = reporting_prediction_date(
|
$report['contents'][] = reporting_prediction_date(
|
||||||
|
@ -490,7 +498,9 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||||
$report['contents'][] = reporting_network_interfaces_report(
|
$report['contents'][] = reporting_network_interfaces_report(
|
||||||
$report,
|
$report,
|
||||||
$content,
|
$content,
|
||||||
$type);
|
$type,
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'group_configuration':
|
case 'group_configuration':
|
||||||
$report['contents'][] = reporting_group_configuration(
|
$report['contents'][] = reporting_group_configuration(
|
||||||
|
@ -2702,11 +2712,10 @@ function reporting_group_configuration($report, $content) {
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_network_interfaces_report($report, $content, $type = 'dinamic') {
|
function reporting_network_interfaces_report($report, $content, $type = 'dinamic', $pdf = 0) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
$return['type'] = 'network_interfaces_report';
|
$return['type'] = 'network_interfaces_report';
|
||||||
|
|
||||||
if (empty($content['name'])) {
|
if (empty($content['name'])) {
|
||||||
|
@ -2744,7 +2753,15 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$network_interfaces_by_agents = agents_get_network_interfaces(false, $filter);
|
$network_interfaces_by_agents = agents_get_network_interfaces(false, $filter);
|
||||||
$return = agents_get_network_interfaces_array($network_interfaces_by_agents, $return, $type, $content, $report, $fullscale);
|
$return = agents_get_network_interfaces_array(
|
||||||
|
$network_interfaces_by_agents,
|
||||||
|
$return,
|
||||||
|
$type,
|
||||||
|
$content,
|
||||||
|
$report,
|
||||||
|
$fullscale,
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2752,13 +2769,24 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$network_interfaces_by_agents = agents_get_network_interfaces(false, $filter);
|
$network_interfaces_by_agents = agents_get_network_interfaces(false, $filter);
|
||||||
$return = agents_get_network_interfaces_array($network_interfaces_by_agents, $return, $type, $content, $report, $fullscale);
|
$return = agents_get_network_interfaces_array(
|
||||||
|
$network_interfaces_by_agents,
|
||||||
|
$return,
|
||||||
|
$type,
|
||||||
|
$content,
|
||||||
|
$report,
|
||||||
|
$fullscale,
|
||||||
|
$pdf
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
function agents_get_network_interfaces_array($network_interfaces_by_agents, $return, $type, $content, $report, $fullscale){
|
function agents_get_network_interfaces_array(
|
||||||
|
$network_interfaces_by_agents, $return,
|
||||||
|
$type, $content, $report, $fullscale, $pdf
|
||||||
|
){
|
||||||
if (empty($network_interfaces_by_agents)) {
|
if (empty($network_interfaces_by_agents)) {
|
||||||
$return['failed'] =
|
$return['failed'] =
|
||||||
__('The group has no agents or none of the agents has any network interface');
|
__('The group has no agents or none of the agents has any network interface');
|
||||||
|
@ -2777,7 +2805,9 @@ function agents_get_network_interfaces_array($network_interfaces_by_agents, $ret
|
||||||
$row_interface['status'] = $interface['status_image'];
|
$row_interface['status'] = $interface['status_image'];
|
||||||
$row_interface['chart'] = null;
|
$row_interface['chart'] = null;
|
||||||
|
|
||||||
|
//XXXX ancho y largo
|
||||||
// Get chart
|
// Get chart
|
||||||
|
/*
|
||||||
reporting_set_conf_charts($width, $height, $only_image,
|
reporting_set_conf_charts($width, $height, $only_image,
|
||||||
$type, $content, $ttl);
|
$type, $content, $ttl);
|
||||||
|
|
||||||
|
@ -2788,63 +2818,46 @@ function agents_get_network_interfaces_array($network_interfaces_by_agents, $ret
|
||||||
if (!empty($force_height_chart)) {
|
if (!empty($force_height_chart)) {
|
||||||
$height = $force_height_chart;
|
$height = $force_height_chart;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
$width = null;
|
||||||
|
$height = null;
|
||||||
|
|
||||||
|
$params =array(
|
||||||
|
'period' => $content['period'],
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'unit_name' => array_fill(0, count($interface['traffic']), __("bytes/s")),
|
||||||
|
'date' => $report["datetime"],
|
||||||
|
'only_image'=> $pdf,
|
||||||
|
'homeurl' => $config['homeurl'],
|
||||||
|
'fullscale' => $fullscale
|
||||||
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'labels' => array_keys($interface['traffic']),
|
||||||
|
'modules_series' => array_values($interface['traffic'])
|
||||||
|
);
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'dinamic':
|
case 'dinamic':
|
||||||
|
case 'static':
|
||||||
if (!empty($interface['traffic'])) {
|
if (!empty($interface['traffic'])) {
|
||||||
$row_interface['chart'] = custom_graphs_print(0,
|
$row_interface['chart'] = graphic_combined_module(
|
||||||
$height,
|
|
||||||
$width,
|
|
||||||
$content['period'],
|
|
||||||
null,
|
|
||||||
true,
|
|
||||||
$report["datetime"],
|
|
||||||
$only_image,
|
|
||||||
'white',
|
|
||||||
array_values($interface['traffic']),
|
array_values($interface['traffic']),
|
||||||
$config['homeurl'],
|
$params,
|
||||||
array_keys($interface['traffic']),
|
$params_combined
|
||||||
array_fill(0, count($interface['traffic']), __("bytes/s")),
|
);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
1,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$fullscale);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
case 'static':
|
|
||||||
if (!empty($interface['traffic'])) {
|
if (!empty($interface['traffic'])) {
|
||||||
$row_interface['chart'] = custom_graphs_print(0,
|
$params['return_data'] = true;
|
||||||
$height,
|
$row_interface['chart'] = graphic_combined_module(
|
||||||
$width,
|
|
||||||
$content['period'],
|
|
||||||
null,
|
|
||||||
true,
|
|
||||||
$report["datetime"],
|
|
||||||
true,
|
|
||||||
'white',
|
|
||||||
array_values($interface['traffic']),
|
array_values($interface['traffic']),
|
||||||
$config['homeurl'],
|
$params,
|
||||||
array_keys($interface['traffic']),
|
$params_combined
|
||||||
array_fill(0, count($interface['traffic']), __("bytes/s")),
|
);
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
2,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$fullscale);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3589,14 +3602,12 @@ function reporting_prediction_date($report, $content) {
|
||||||
|
|
||||||
function reporting_projection_graph($report, $content,
|
function reporting_projection_graph($report, $content,
|
||||||
$type = 'dinamic', $force_width_chart = null,
|
$type = 'dinamic', $force_width_chart = null,
|
||||||
$force_height_chart = null) {
|
$force_height_chart = null, $pdf = false) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($config['metaconsole']) {
|
if ($config['metaconsole']) {
|
||||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
||||||
|
|
||||||
|
|
||||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
$server = metaconsole_get_connection_by_id ($id_meta);
|
||||||
metaconsole_connect($server);
|
metaconsole_connect($server);
|
||||||
}
|
}
|
||||||
|
@ -3607,67 +3618,59 @@ function reporting_projection_graph($report, $content,
|
||||||
$content['name'] = __('Projection Graph');
|
$content['name'] = __('Projection Graph');
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_name = io_safe_output(
|
$module_name = io_safe_output(modules_get_agentmodule_name($content['id_agent_module']));
|
||||||
modules_get_agentmodule_name($content['id_agent_module']));
|
$agent_name = io_safe_output(modules_get_agentmodule_agent_alias ($content['id_agent_module']));
|
||||||
$agent_name = io_safe_output(
|
|
||||||
modules_get_agentmodule_agent_alias ($content['id_agent_module']));
|
|
||||||
|
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['name'];
|
||||||
$return['subtitle'] = $agent_name . " - " . $module_name;
|
$return['subtitle'] = $agent_name . " - " . $module_name;
|
||||||
$return["description"] = $content["description"];
|
$return["description"] = $content["description"];
|
||||||
$return["date"] = reporting_get_date_text($report, $content);
|
$return["date"] = reporting_get_date_text($report, $content);
|
||||||
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
|
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
|
||||||
|
|
||||||
$return['agent_name'] = $agent_name;
|
$return['agent_name'] = $agent_name;
|
||||||
$return['module_name'] = $module_name;
|
$return['module_name'] = $module_name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set_time_limit(500);
|
set_time_limit(500);
|
||||||
|
|
||||||
|
// Get chart
|
||||||
|
//reporting_set_conf_charts($width, $height, $only_image, $type,
|
||||||
|
// $content, $ttl);
|
||||||
|
|
||||||
|
//XXXX width y height
|
||||||
|
switch ($type) {
|
||||||
|
case 'dinamic':
|
||||||
|
case 'static':
|
||||||
$output_projection = forecast_projection_graph(
|
$output_projection = forecast_projection_graph(
|
||||||
$content['id_agent_module'], $content['period'], $content['top_n_value']);
|
$content['id_agent_module'],
|
||||||
|
$content['period'],
|
||||||
|
$content['top_n_value']
|
||||||
|
);
|
||||||
|
|
||||||
// If projection doesn't have data then don't draw graph
|
// If projection doesn't have data then don't draw graph
|
||||||
if ($output_projection == NULL) {
|
if ($output_projection == NULL) {
|
||||||
$output_projection = false;
|
$output_projection = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get chart
|
$params =array(
|
||||||
reporting_set_conf_charts($width, $height, $only_image, $type,
|
'period' => $content['period'],
|
||||||
$content, $ttl);
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'date' => $report["datetime"],
|
||||||
|
'unit' => '',
|
||||||
|
'only_image' => $pdf,
|
||||||
|
'homeurl' => ui_get_full_url(false, false, false, false) . '/',
|
||||||
|
'ttl' => $ttl
|
||||||
|
);
|
||||||
|
|
||||||
if (!empty($force_width_chart)) {
|
$params_combined = array(
|
||||||
$width = $force_width_chart;
|
'projection' => $output_projection
|
||||||
}
|
);
|
||||||
|
|
||||||
if (!empty($force_height_chart)) {
|
|
||||||
$height = $force_height_chart;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($type) {
|
|
||||||
case 'dinamic':
|
|
||||||
case 'static':
|
|
||||||
$return['chart'] = graphic_combined_module(
|
$return['chart'] = graphic_combined_module(
|
||||||
array($content['id_agent_module']),
|
array($content['id_agent_module']),
|
||||||
array(),
|
$params,
|
||||||
$content['period'],
|
$params_combined
|
||||||
$width,
|
|
||||||
$height,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$report["datetime"],
|
|
||||||
$only_image,
|
|
||||||
ui_get_full_url(false, false, false, false) . '/',
|
|
||||||
$ttl,
|
|
||||||
// Important parameter, this tell to graphic_combined_module function that is a projection graph
|
|
||||||
$output_projection,
|
|
||||||
$content['top_n_value']
|
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
$return['data'] = forecast_projection_graph(
|
$return['data'] = forecast_projection_graph(
|
||||||
|
@ -6285,7 +6288,8 @@ function reporting_general($report, $content) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_custom_graph($report, $content, $type = 'dinamic',
|
function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||||
$force_width_chart = null, $force_height_chart = null, $type_report = "custom_graph") {
|
$force_width_chart = null, $force_height_chart = null,
|
||||||
|
$type_report = "custom_graph", $pdf = false) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -6367,10 +6371,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||||
|
|
||||||
$return['chart'] = '';
|
$return['chart'] = '';
|
||||||
// Get chart
|
// Get chart
|
||||||
reporting_set_conf_charts($width, $height, $only_image, $type,
|
//reporting_set_conf_charts($width, $height, $only_image, $type,
|
||||||
$content, $ttl);
|
// $content, $ttl);
|
||||||
|
$width =null;
|
||||||
|
$height =null;
|
||||||
//height for bullet chart
|
//height for bullet chart
|
||||||
|
/*
|
||||||
if($graph['stacked'] != 4){
|
if($graph['stacked'] != 4){
|
||||||
$height += count($modules) * REPORTING_CUSTOM_GRAPH_LEGEND_EACH_MODULE_VERTICAL_SIZE;
|
$height += count($modules) * REPORTING_CUSTOM_GRAPH_LEGEND_EACH_MODULE_VERTICAL_SIZE;
|
||||||
}
|
}
|
||||||
|
@ -6379,45 +6385,39 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||||
$height = 50;
|
$height = 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'dinamic':
|
case 'dinamic':
|
||||||
case 'static':
|
case 'static':
|
||||||
|
|
||||||
|
$params =array(
|
||||||
|
'period' => $content['period'],
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'date' => $report["datetime"],
|
||||||
|
'only_image' => $pdf,
|
||||||
|
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||||
|
'ttl' => $ttl,
|
||||||
|
'percentil' => $graph["percentil"],
|
||||||
|
'fullscale' => $graph["fullscale"],
|
||||||
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'weight_list' => $weights,
|
||||||
|
'stacked' => $graph["stacked"],
|
||||||
|
'labels' => $labels,
|
||||||
|
'summatory' => $graph["summatory_series"],
|
||||||
|
'average' => $graph["average_series"],
|
||||||
|
'modules_series' => $graph["modules_series"]
|
||||||
|
);
|
||||||
|
|
||||||
$return['chart'] = graphic_combined_module(
|
$return['chart'] = graphic_combined_module(
|
||||||
$modules,
|
$modules,
|
||||||
$weights,
|
$params,
|
||||||
$content['period'],
|
$params_combined
|
||||||
$width, $height,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$graph["stacked"],
|
|
||||||
$report["datetime"],
|
|
||||||
$only_image,
|
|
||||||
ui_get_full_url(false, false, false, false),
|
|
||||||
$ttl,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
'white',
|
|
||||||
array(),
|
|
||||||
array(),
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
$labels,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$graph["percentil"],
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
$graph["fullscale"],
|
|
||||||
$graph["summatory_series"],
|
|
||||||
$graph["average_series"],
|
|
||||||
$graph["modules_series"]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -958,56 +958,51 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($width == 0 || $height == 0) {
|
if ($width == 0 ) {
|
||||||
|
$width = 180;
|
||||||
|
}
|
||||||
|
if($height == 0) {
|
||||||
|
$height = 480;
|
||||||
|
}
|
||||||
|
|
||||||
|
$params =array(
|
||||||
|
'period' => $period,
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'title' => '',
|
||||||
|
'unit_name' => null,
|
||||||
|
'show_alerts' => false,
|
||||||
|
'only_image' => $only_image,
|
||||||
|
'vconsole' => true,
|
||||||
|
'backgroundColor' => $layoutData['image']
|
||||||
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'id_graph' => $layoutData['id_custom_graph']
|
||||||
|
);
|
||||||
|
|
||||||
if ($layoutData['label_position']=='left') {
|
if ($layoutData['label_position']=='left') {
|
||||||
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">'.custom_graphs_print(
|
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">'.
|
||||||
$layoutData['id_custom_graph'], 180, 480,
|
graphic_combined_module(
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
false,
|
||||||
array(), '', array(), array(), true,
|
$params,
|
||||||
false, false, true, 1, false, true).'</div>';
|
$params_combined
|
||||||
|
).'</div>';
|
||||||
}
|
}
|
||||||
elseif ($layoutData['label_position']=='right') {
|
elseif ($layoutData['label_position']=='right') {
|
||||||
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">'.custom_graphs_print(
|
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">'.
|
||||||
$layoutData['id_custom_graph'], 180, 480,
|
graphic_combined_module(
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
false,
|
||||||
array(), '', array(), array(), true,
|
$params,
|
||||||
false, false, true, 1, false, true).'</div>';
|
$params_combined
|
||||||
|
).'</div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$img = custom_graphs_print(
|
$img = graphic_combined_module(
|
||||||
$layoutData['id_custom_graph'], 180, 480,
|
false,
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
$params,
|
||||||
array(), '', array(), array(), true,
|
$params_combined
|
||||||
false, false, true, 1, false, true);
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($width < 480){
|
|
||||||
$img = '<div class="error">'._("Could not draw pie with labels contained inside canvas. Resize widget to 500px width minimum").'</div>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($layoutData['label_position']=='left') {
|
|
||||||
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">'.custom_graphs_print(
|
|
||||||
$layoutData['id_custom_graph'], $height, $width,
|
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
|
||||||
array(), '', array(), array(), true,
|
|
||||||
false, false, true, 1, false, true).'</div>';
|
|
||||||
}
|
|
||||||
elseif($layoutData['label_position']=='right') {
|
|
||||||
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">'.custom_graphs_print(
|
|
||||||
$layoutData['id_custom_graph'], $height, $width,
|
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
|
||||||
array(), '', array(), array(), true,
|
|
||||||
false, false, true, 1, false, true).'</div>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$img = custom_graphs_print(
|
|
||||||
$layoutData['id_custom_graph'], $height, $width,
|
|
||||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
|
||||||
array(), '', array(), array(), true,
|
|
||||||
false, false, true, 1, false, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
var system = require('system');
|
var system = require('system');
|
||||||
|
|
||||||
if (system.args.length < 2 || system.args.length > 6) {
|
if (system.args.length < 3 || system.args.length > 9) {
|
||||||
phantom.exit(1);
|
phantom.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var webPage = require('webpage');
|
var webPage = require('webpage');
|
||||||
var page = webPage.create();
|
var page = webPage.create();
|
||||||
var url = system.args[1];
|
var url = system.args[1];
|
||||||
var url_params = system.args[2];
|
var type_graph_pdf = system.args[2];
|
||||||
var output_filename = system.args[3];
|
var url_params = system.args[3];
|
||||||
var _width = system.args[4];
|
var url_params_comb = system.args[4];
|
||||||
var _height = system.args[5];
|
var url_module_list = system.args[5];
|
||||||
|
var output_filename = system.args[6];
|
||||||
|
var _width = system.args[7];
|
||||||
|
var _height = system.args[8];
|
||||||
|
|
||||||
if (!_width) {
|
if (!_width) {
|
||||||
_width = 750;
|
_width = 750;
|
||||||
|
@ -20,13 +23,21 @@ if (!_height) {
|
||||||
_height = 350;
|
_height = 350;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(type_graph_pdf == 'combined'){
|
||||||
|
finish_url = url + "?" + "data=" + url_params +
|
||||||
|
"&data_combined=" + url_params_comb +
|
||||||
|
"&data_module_list=" + url_module_list +
|
||||||
|
"&type_graph_pdf=" + type_graph_pdf;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
finish_url = url + "?" + "data=" + url_params +
|
||||||
|
"&type_graph_pdf=" + type_graph_pdf;
|
||||||
|
}
|
||||||
|
|
||||||
page.viewportSize = { width: _width, height: _height };
|
page.viewportSize = { width: _width, height: _height };
|
||||||
//page.zoomFactor = 1.75;
|
//page.zoomFactor = 1.75;
|
||||||
|
|
||||||
//console.log("Pagina: " + url);
|
page.open(finish_url, function start(status) {
|
||||||
//console.log("parametros: " + url_params);
|
|
||||||
//console.log("Archivo salida: " + output_filename);
|
|
||||||
page.open(url + "?" + "data=" + url_params, function start(status) {
|
|
||||||
page.render(output_filename, {format: 'png'});
|
page.render(output_filename, {format: 'png'});
|
||||||
//var base64 = page.renderBase64('JPG');
|
//var base64 = page.renderBase64('JPG');
|
||||||
//console.log(base64);
|
//console.log(base64);
|
||||||
|
|
|
@ -192,34 +192,34 @@ $interface_traffic_modules = array(
|
||||||
else
|
else
|
||||||
echo '<div style="margin-left: 50px; padding-top: 10px;">';
|
echo '<div style="margin-left: 50px; padding-top: 10px;">';
|
||||||
|
|
||||||
|
//XXXXXXX width and height
|
||||||
$height = 400;
|
$height = 400;
|
||||||
$width = '90%';
|
$width = '90%';
|
||||||
|
|
||||||
custom_graphs_print(
|
$params =array(
|
||||||
0,
|
'period' => $period,
|
||||||
$height,
|
'width' => $width,
|
||||||
$width,
|
'height' => $height,
|
||||||
$period,
|
'unit_name' => array_fill(0, count($interface_traffic_modules), $config["interface_unit"]),
|
||||||
null,
|
'date' => $date,
|
||||||
false,
|
'homeurl' => $config['homeurl'],
|
||||||
$date,
|
'percentil' => (($show_percentil)? $config['percentil'] : null),
|
||||||
false,
|
'fullscale' => $fullscale
|
||||||
'white',
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'weight_list' => array(),
|
||||||
|
'projection' => false,
|
||||||
|
'labels' => array_keys($interface_traffic_modules),
|
||||||
|
'from_interface' => true,
|
||||||
|
'modules_series' => array_values($interface_traffic_modules),
|
||||||
|
'return' => 0
|
||||||
|
);
|
||||||
|
|
||||||
|
graphic_combined_module(
|
||||||
array_values($interface_traffic_modules),
|
array_values($interface_traffic_modules),
|
||||||
$config['homeurl'],
|
$params,
|
||||||
array_keys($interface_traffic_modules),
|
$params_combined
|
||||||
array_fill(0, count($interface_traffic_modules), $config["interface_unit"]),
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
1,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
(($show_percentil)? $config['percentil'] : null),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
$fullscale
|
|
||||||
);
|
);
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
|
@ -175,12 +175,38 @@ if ($view_graph) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
|
ui_print_page_header (
|
||||||
|
$graph['name'],
|
||||||
|
"images/chart.png",
|
||||||
|
false,
|
||||||
|
"",
|
||||||
|
false,
|
||||||
|
$options
|
||||||
|
);
|
||||||
|
|
||||||
ui_print_page_header ($graph['name'],
|
|
||||||
"images/chart.png", false, "", false, $options);
|
|
||||||
|
|
||||||
$graph_return = custom_graphs_print($id_graph, $height, $width, $period, $stacked, true, $unixdate, false, 'white',
|
//XXXX el width y height
|
||||||
array(), '', array(), array(), true, true, true, true, 1, false, false, $percentil, false, false, $fullscale);
|
$width = null;
|
||||||
|
$height = null;
|
||||||
|
$params =array(
|
||||||
|
'period' => $period,
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'date' => $unixdate,
|
||||||
|
'percentil' => $percentil,
|
||||||
|
'fullscale' => $fullscale
|
||||||
|
);
|
||||||
|
|
||||||
|
$params_combined = array(
|
||||||
|
'stacked' => $stacked,
|
||||||
|
'id_graph' => $id_graph
|
||||||
|
);
|
||||||
|
|
||||||
|
$graph_return = graphic_combined_module(
|
||||||
|
false,
|
||||||
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
|
|
||||||
if ($graph_return){
|
if ($graph_return){
|
||||||
echo "<table class='databox filters' cellpadding='0' cellspacing='0' width='100%'>";
|
echo "<table class='databox filters' cellpadding='0' cellspacing='0' width='100%'>";
|
||||||
|
|
Loading…
Reference in New Issue