Fixed problems with output data in netflow, change max view data. Gitlab: #333

This commit is contained in:
m-lopez-f 2017-02-23 09:05:11 +01:00
parent 39e380097b
commit 30baabafeb
2 changed files with 36 additions and 24 deletions

View File

@ -83,7 +83,7 @@ $filter['router_ip'] = get_parameter('router_ip');
// Read chart configuration // Read chart configuration
$chart_type = get_parameter('chart_type', 'netflow_area'); $chart_type = get_parameter('chart_type', 'netflow_area');
$max_aggregates = (int) get_parameter('max_aggregates', 0); $max_aggregates = (int) get_parameter('max_aggregates', 1);
$period = (int) get_parameter('period', SECONDS_1DAY); $period = (int) get_parameter('period', SECONDS_1DAY);
$update_date = (int) get_parameter('update_date', 0); $update_date = (int) get_parameter('update_date', 0);
$date = get_parameter_post ('date', date (DATE_FORMAT, get_system_time ())); $date = get_parameter_post ('date', date (DATE_FORMAT, get_system_time ()));
@ -103,9 +103,10 @@ $update = get_parameter('update_button', '');
$end_date = strtotime ($date . " " . $time); $end_date = strtotime ($date . " " . $time);
$start_date = $end_date - $period; $start_date = $end_date - $period;
if (! defined ('METACONSOLE')) { if (!is_metaconsole()) {
//Header //Header
ui_print_page_header (__('Netflow live view'), "images/op_netflow.png", false, "", false, array ()); ui_print_page_header (__('Netflow live view'),
"images/op_netflow.png", false, "", false, array ());
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) { if ($is_windows) {
@ -126,7 +127,6 @@ if (! defined ('METACONSOLE')) {
ui_print_error_message(sprintf(__('Make sure nfdump version 1.6.8 or newer is installed!'))); ui_print_error_message(sprintf(__('Make sure nfdump version 1.6.8 or newer is installed!')));
} }
} }
} }
else { else {
$nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')), $nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')),
@ -181,9 +181,12 @@ enterprise_hook('open_meta_frame');
$class = "databox filters"; $class = "databox filters";
echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">'; echo '<form method="post" action="' . $config['homeurl'] .
'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure=' .
$pure . '">';
echo "<table class='".$class."' width='100%'>"; echo "<table class='".$class."' width='100%'>";
if (defined("METACONSOLE")) { if (is_metaconsole()) {
echo "<thead> echo "<thead>
<tr> <tr>
<th align=center colspan=6> <th align=center colspan=6>
@ -191,8 +194,7 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
</th> </th>
</tr> </tr>
</thead>"; </thead>";
}
if (defined ('METACONSOLE')) {
$list_servers = array(); $list_servers = array();
$servers = db_get_all_rows_sql ("SELECT * $servers = db_get_all_rows_sql ("SELECT *
@ -250,7 +252,8 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
echo "<tr>"; echo "<tr>";
echo "<td>" . '<b>' . __('Type') . '</b>' . "</td>"; echo "<td>" . '<b>' . __('Type') . '</b>' . "</td>";
echo "<td>" . html_print_select (netflow_get_chart_types (), 'chart_type', $chart_type,'','',0,true) . "</td>"; echo "<td>" . html_print_select (netflow_get_chart_types (),
'chart_type', $chart_type,'','',0,true) . "</td>";
echo "<td>" . '<b>' . __('Max. values') . '</b>' . "</td>"; echo "<td>" . '<b>' . __('Max. values') . '</b>' . "</td>";
$max_values = array ('2' => '2', $max_values = array ('2' => '2',
@ -267,10 +270,18 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
"</a>"; "</a>";
echo "</td>"; echo "</td>";
$onclick = "if (!confirm('".__('Warning').". ".__('IP address resolution can take a lot of time')."')) return false;"; $onclick = "if (!confirm('".__('Warning') . ". " .
$radio_buttons = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended ('address_resolution', 1, '', $address_resolution, false, $onclick, '', true).'&nbsp;&nbsp;&nbsp;'; __('IP address resolution can take a lot of time') .
$radio_buttons .= __('No').'&nbsp;&nbsp;'.html_print_radio_button ('address_resolution', 0, '', $address_resolution, true); "')) return false;";
echo "<td>" . '<b>'.__('IP address resolution').'</b>' . ui_print_help_tip (__("Resolve the IP addresses to get their hostnames."), true) . "</td>"; $radio_buttons = __('Yes').'&nbsp;&nbsp;' .
html_print_radio_button_extended ('address_resolution', 1, '',
$address_resolution, false, $onclick, '', true) .
'&nbsp;&nbsp;&nbsp;';
$radio_buttons .= __('No').'&nbsp;&nbsp;' .
html_print_radio_button ('address_resolution', 0, '',
$address_resolution, true);
echo "<td>" . '<b>'.__('IP address resolution').'</b>' .
ui_print_help_tip (__("Resolve the IP addresses to get their hostnames."), true) . "</td>";
echo "<td>$radio_buttons</td>"; echo "<td>$radio_buttons</td>";
echo "</tr>"; echo "</tr>";
@ -292,7 +303,8 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
echo "<tr class='filter_save' style='display: none;'>"; echo "<tr class='filter_save' style='display: none;'>";
echo "<td>" . '<span id="filter_name_color"><b>'.__('Name').'</b></span>' . "</td>"; echo "<td>" . '<span id="filter_name_color"><b>'.__('Name').'</b></span>' . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('name', $filter['id_name'], false, 20, 80, true) . "</td>"; echo "<td colspan='2'>" . html_print_input_text ('name',
$filter['id_name'], false, 20, 80, true) . "</td>";
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
echo "<td>" . '<span id="filter_group_color"><b>'.__('Group').'</b></span>' . "</td>"; echo "<td>" . '<span id="filter_group_color"><b>'.__('Group').'</b></span>' . "</td>";
echo "<td colspan='2'>" . html_print_select_groups($config['id_user'], "IW", $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false) . "</td>"; echo "<td colspan='2'>" . html_print_select_groups($config['id_user'], "IW", $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false) . "</td>";