2013-02-04 Miguel de Dios <miguel.dedios@artica.es>

* install.php: cleaned source code style.
	
	* godmode/netflow/nf_edit.php, include/functions_netflow.php: fixed
	the empty data.
	
	Fixes: #3603092




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-04 12:19:17 +00:00
parent 85c3f27936
commit 19b67559ae
4 changed files with 50 additions and 25 deletions

View File

@ -1,3 +1,12 @@
2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
* install.php: cleaned source code style.
* godmode/netflow/nf_edit.php, include/functions_netflow.php: fixed
the empty data.
Fixes: #3603092
2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora_alerts.js: cleaned source code style.

View File

@ -35,7 +35,8 @@ $pure = get_parameter('pure', 0);
//Header
if (! defined ('METACONSOLE')) {
ui_print_page_header (__('Manage Netflow Filter'), "images/networkmap/so_cisco_new.png", false, "", true);
} else {
}
else {
$nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')),
array('link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit', 'text' => __('Netflow filters')));
@ -113,7 +114,8 @@ $table->head = array ();
$table->head[0] = __('Name');
$table->head[1] = __('Group');
$table->head[2] = __('Action') .
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
html_print_checkbox('all_delete', 0, false, true, false,
'check_all_checkboxes();');
$table->style = array ();
$table->style[0] = 'font-weight: bold';
$table->align = array ();

View File

@ -297,7 +297,8 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate, $unit) {
$source_count++;
$j++;
}
} else {
}
else {
$table->style[1] = 'padding: 4px;';
}
@ -306,6 +307,8 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate, $unit) {
$table->head[1] = __('Data');
$table->align[1] = "right";
$i = 0;
foreach ($data as $timestamp => $value) {
$table->data[$i][0] = date ($time_format, $timestamp);
$table->data[$i][1] = format_numeric ($value['data']) . '&nbsp;' . netflow_format_unit ($unit);
@ -410,7 +413,8 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
$num_intervals = $config['graph_res'] * 50;
$period = $end_date - $start_date;
$interval_length = (int) ($period / $num_intervals);
} else {
}
else {
$period = $end_date - $start_date;
$num_intervals = (int) ($period / $interval_length);
}
@ -447,7 +451,8 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
$val = explode(',',$line);
if ($aggregate == 'proto') {
$values['sources'][$val[3]] = 1;
} else {
}
else {
$values['sources'][$val[4]] = 1;
}
}
@ -511,7 +516,8 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
$values[$interval_start]['data'] = $data['totalbytes'];
break;
}
} else {
}
else {
// Set default values
foreach ($values['sources'] as $source => $discard) {
@ -528,6 +534,10 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
}
}
if (($aggregate != 'none') && (empty($values['data']))) {
return array();
}
return $values;
}
@ -963,12 +973,14 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
$html .= "&nbsp;<b>" . __('Aggregate') . ":</b> " . netflow_format_aggregate ($aggregate);
$html .= graph_netflow_aggregate_pie ($data, netflow_format_aggregate ($aggregate));
return $html;
} else if ($output == 'PDF') {
}
else if ($output == 'PDF') {
$html = "<b>" . __('Unit') . ":</b> " . netflow_format_unit ($unit);
$html .= "&nbsp;<b>" . __('Aggregate') . ":</b> $aggregate";
$html .= graph_netflow_aggregate_pie ($data, netflow_format_aggregate ($aggregate), 2, true);
return $html;
} else if ($output == 'XML') {
}
else if ($output == 'XML') {
$xml = "<unit>$unit</unit>\n";
$xml .= "<aggregate>$aggregate</aggregate>\n";
$xml .= netflow_aggregate_pie_xml ($data);
@ -989,8 +1001,10 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi
$html .= "&nbsp;<b>" . _('Resolution') . ":</b> $interval_length " . __('seconds');
}
$html .= netflow_data_table ($data, $start_date, $end_date, $aggregate, $unit);
return $html;
} else if ($output == 'XML') {
}
else if ($output == 'XML') {
$xml = "<unit>$unit</unit>\n";
$xml .= "<aggregate>$aggregate</aggregate>\n";
$xml .= "<resolution>$interval_length</resolution>\n";