fixed errors in report interfaces
This commit is contained in:
parent
07b8e178d3
commit
00f779817d
|
@ -482,6 +482,7 @@ switch ($action) {
|
|||
$description = $item['description'];
|
||||
$group = $item['id_group'];
|
||||
$period = $item['period'];
|
||||
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
|
||||
break;
|
||||
case 'top_n':
|
||||
$description = $item['description'];
|
||||
|
@ -1356,7 +1357,8 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
<td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td>
|
||||
</tr>
|
||||
<tr id="row_fullscale" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Full resolution graph (TIP)');?></td>
|
||||
<td style="font-weight:bold;"><?php echo __('Full resolution graph (TIP)').
|
||||
ui_print_help_tip(__('This option may cause performance issues.'), true);?></td>
|
||||
<td><?php html_print_checkbox('fullscale', 1, $fullscale);?></td>
|
||||
</tr>
|
||||
<tr id="row_percentil" style="" class="datos">
|
||||
|
@ -3130,6 +3132,7 @@ function chooseType() {
|
|||
$("#row_description").show();
|
||||
$("#row_period").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
$("#row_fullscale").show();
|
||||
break;
|
||||
|
||||
case 'top_n':
|
||||
|
|
|
@ -1180,6 +1180,9 @@ switch ($action) {
|
|||
else
|
||||
$style['label'] = '';
|
||||
break;
|
||||
case 'network_interfaces_report':
|
||||
$style['fullscale'] = (int) get_parameter('fullscale');
|
||||
break;
|
||||
case 'module_histogram_graph':
|
||||
case 'agent_configuration':
|
||||
case 'alert_report_agent':
|
||||
|
@ -1525,6 +1528,9 @@ switch ($action) {
|
|||
else
|
||||
$style['label'] = '';
|
||||
break;
|
||||
case 'network_interfaces_report':
|
||||
$style['fullscale'] = (int) get_parameter('fullscale');
|
||||
break;
|
||||
case 'module_histogram_graph':
|
||||
case 'agent_configuration':
|
||||
case 'alert_report_agent':
|
||||
|
|
|
@ -1834,13 +1834,28 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
}
|
||||
}
|
||||
else{
|
||||
$temp = fullscale_data_combined($module_list, $period, $date);
|
||||
$flash_charts = true;
|
||||
if($ttl>1 || !$config['flash_charts']){
|
||||
$flash_charts = false;
|
||||
}
|
||||
|
||||
$temp = fullscale_data_combined($module_list, $period, $date, $flash_charts);
|
||||
|
||||
$resolution = count($temp); //Number of points of the graph
|
||||
$interval = (int) ($period / $resolution);
|
||||
$module_name_list = array();
|
||||
$flash_charts = true;
|
||||
|
||||
if($ttl>1 || !$config['flash_charts']){
|
||||
$temp2 = array();
|
||||
foreach ($temp as $key => $value) {
|
||||
$real_date = date("Y/M/d", $key);
|
||||
$real_date .= "\n";
|
||||
$real_date .= date(" H:i:s", $key);
|
||||
$temp2[$real_date] = $value;
|
||||
}
|
||||
$temp = $temp2;
|
||||
}
|
||||
|
||||
foreach ($module_list as $key => $value) {
|
||||
$agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
|
||||
$alias = db_get_value ("alias","tagente","nombre",$agent_name);
|
||||
|
@ -1856,7 +1871,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
}
|
||||
|
||||
$graph_values = $temp;
|
||||
|
||||
|
||||
if($config["fixed_graph"] == false){
|
||||
$water_mark = array(
|
||||
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||
|
@ -2104,7 +2119,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
}
|
||||
}
|
||||
|
||||
function fullscale_data_combined($module_list, $period, $date){
|
||||
function fullscale_data_combined($module_list, $period, $date, $flash_charts){
|
||||
|
||||
// Set variables
|
||||
if ($date == 0){
|
||||
|
@ -2117,7 +2132,12 @@ function fullscale_data_combined($module_list, $period, $date){
|
|||
$data_uncompress = db_uncompress_module_data($value_module, $datelimit, $date);
|
||||
foreach ($data_uncompress as $key_data => $value_data) {
|
||||
foreach ($value_data['data'] as $k => $v) {
|
||||
$real_date = date("Y M d H:i:s", $v['utimestamp']);
|
||||
if($flash_charts) {
|
||||
$real_date = date("Y M d H:i:s", $v['utimestamp']);
|
||||
}
|
||||
else{
|
||||
$real_date = $v['utimestamp'];
|
||||
}
|
||||
$data_all[$real_date][$key_module] = $v['datos'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2674,6 +2674,10 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
|
|||
if (empty($content['name'])) {
|
||||
$content['name'] = __('Network interfaces report');
|
||||
}
|
||||
|
||||
if (isset($content['style']['fullscale'])) {
|
||||
$fullscale = (bool) $content['style']['fullscale'];
|
||||
}
|
||||
|
||||
$group_name = groups_get_name($content['id_group']);
|
||||
|
||||
|
@ -2745,7 +2749,13 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
|
|||
true,
|
||||
true,
|
||||
true,
|
||||
1);
|
||||
1,
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
$fullscale);
|
||||
}
|
||||
break;
|
||||
case 'data':
|
||||
|
@ -2768,7 +2778,13 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
|
|||
true,
|
||||
true,
|
||||
true,
|
||||
2);
|
||||
2,
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
$fullscale);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ $interface_traffic_modules = array(
|
|||
$table->rowclass[] ='';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Full scale');
|
||||
$data[0] = __('Show full scale graph (TIP)');
|
||||
$data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] ='';
|
||||
|
|
Loading…
Reference in New Issue