From 4cf1bd1a9f84e967d84f35ff10ed2c2e7dc714f2 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 23 Jan 2012 18:17:52 +0000 Subject: [PATCH] 2012-01-23 Ramon Novoa * operation/menu.php, operation/netflow/nf_live_view.php, godmode/netflow/nf_edit_form.php, godmode/netflow/nf_item_list.php, godmode/netflow/nf_report_item.php, godmode/netflow/nf_report_form.php, godmode/netflow/nf_edit.php: Multiple improvements to netflow live view and report and filter edition. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5407 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 + pandora_console/godmode/netflow/nf_edit.php | 8 +- .../godmode/netflow/nf_edit_form.php | 38 ++-- .../godmode/netflow/nf_item_list.php | 59 +++--- .../godmode/netflow/nf_report_form.php | 69 +++---- .../godmode/netflow/nf_report_item.php | 53 ++--- pandora_console/operation/menu.php | 4 +- .../operation/netflow/nf_live_view.php | 189 +++++++++++------- 8 files changed, 246 insertions(+), 185 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c4109ea668..4c93f2c287 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-01-23 Ramon Novoa + + * operation/menu.php, + operation/netflow/nf_live_view.php, + godmode/netflow/nf_edit_form.php, + godmode/netflow/nf_item_list.php, + godmode/netflow/nf_report_item.php, + godmode/netflow/nf_report_form.php, + godmode/netflow/nf_edit.php: Multiple improvements to netflow live + view and report and filter edition. + 2012-01-23 Juan Manuel Ramon * include/functions_agents.php: Removed Php warning in function diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index c7e5ee3aa3..2028c791c1 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -91,13 +91,7 @@ if ($multiple_delete) { $own_info = get_user_info ($config['id_user']); // Get group list that user has access $groups_user = users_get_groups ($config['id_user'], "AW", $own_info['is_admin'], true); - -$groups_id = array(); -foreach($groups_user as $key => $groups){ - $groups_id[] = $groups['id_grupo']; -} - -$sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',',$groups_id).")"; +$sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',', array_keys ($groups_user)).")"; $filters = db_get_all_rows_sql($sql); if ($filters === false) $filters = array (); diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 6626951e99..a2fb12d141 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -123,26 +123,24 @@ if ($create){ $src_port = get_parameter('src_port',''); $advanced_filter = (string) get_parameter('advanced_filter', ''); - if($name == db_get_value('id_name', 'tnetflow_filter', 'id_name', $name)){ - $result = false; - } else { - $values = array ( - 'id_name'=>$name, - 'id_group' => $assign_group, - 'ip_dst'=>$ip_dst, - 'ip_src'=>$ip_src, - 'dst_port'=>$dst_port, - 'src_port'=>$src_port, - 'aggregate'=>$aggregate, - 'advanced_filter'=>$advanced_filter, - 'output'=>$output - ); - $result = db_process_sql_insert('tnetflow_filter', $values); - } - if ($result === false) - echo '

'.__ ('Error creating filter').'

'; - else - echo '

'.__ ('filter created successfully').'

'; + $values = array ( + 'id_name'=>$name, + 'id_group' => $assign_group, + 'ip_dst'=>$ip_dst, + 'ip_src'=>$ip_src, + 'dst_port'=>$dst_port, + 'src_port'=>$src_port, + 'aggregate'=>$aggregate, + 'advanced_filter'=>$advanced_filter, + 'output'=>$output + ); + + $id = db_process_sql_insert('tnetflow_filter', $values); + if ($id === false) { + ui_print_error_message ('Error creating filter'); + } else { + ui_print_success_message ('Filter created successfully'); + } } $table->width = '80%'; diff --git a/pandora_console/godmode/netflow/nf_item_list.php b/pandora_console/godmode/netflow/nf_item_list.php index 7cc24f7eec..2afce13e0a 100644 --- a/pandora_console/godmode/netflow/nf_item_list.php +++ b/pandora_console/godmode/netflow/nf_item_list.php @@ -31,13 +31,24 @@ if (! check_acl ($config["id_user"], 0, "IW")) { return; } -$buttons['list'] = '' +$buttons['report_list']['active'] = false; +$buttons['report_list'] = '' . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) . ''; +$buttons['report_items']['active'] = true; +$buttons['report_items']['text'] = '' + . html_print_image ("images/god6.png", true, array ("title" => __('Report items'))) + . ''; + +$buttons['edit_report']['active'] = false; +$buttons['edit_report']['text'] = '' + . html_print_image ("images/config.png", true, array ("title" => __('Edit report'))) + . ''; + //Header -ui_print_page_header (__('Item list'), "images/god6.png", false, "", true, $buttons); - +ui_print_page_header (__('Report items'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); + $delete = (bool) get_parameter ('delete'); $multiple_delete = (bool)get_parameter('multiple_delete', 0); $order = get_parameter('order'); @@ -121,27 +132,25 @@ if ($reports_item === false) $table->width = '98%'; $table->head = array (); -$table->head[0] = __('Sort'); -$table->head[1] = __('Id item'); -$table->head[2] = __('Filter'); -$table->head[3] = __('Max values'); -$table->head[4] = __('Item'); -$table->head[5] = __('Action') . - html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); +$table->head[0] = __('Order'); +$table->head[1] = __('Filter'); +$table->head[2] = __('Max. values'); +$table->head[3] = __('Chart type'); +$table->head[3] = __('Chart type'); +$table->head[4] = __('Action') . html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); $table->style = array (); $table->style[1] = 'font-weight: bold'; $table->align = array (); -$table->align[1] = 'center'; +$table->align[1] = 'left'; +$table->align[2] = 'center'; $table->align[3] = 'center'; -$table->align[5] = 'right'; +$table->align[4] = 'right'; $table->size = array (); $table->size[0] = '20px'; -$table->size[1] = '10%'; -$table->size[2] = '50%'; -$table->size[3] = '10%'; -$table->size[4] = '20%'; -$table->size[5] = '20px'; +$table->size[2] = '5%'; +$table->size[3] = '15%'; +$table->size[4] = '60px'; $table->data = array (); @@ -177,29 +186,27 @@ $last_item = $item_max['id_rc']; $data[0] .= '' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . ''; } - $data[1] = ''.$item['id_rc'].''; $name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $item['id_filter']); + $data[1] = ''.$name_filter.''; - $data[2] = $name_filter; - - $data[3] = $item['max']; + $data[2] = $item['max']; switch ($item['show_graph']) { case 0: - $data[4] = 'Area graph'; + $data[3] = 'Area graph'; break; case 1: - $data[4] = 'Pie graph'; + $data[3] = 'Pie graph'; break; case 2: - $data[4] = 'Data table'; + $data[3] = 'Data table'; break; case 3: - $data[4] = 'Statistics table'; + $data[3] = 'Statistics table'; break; } - $data[5] = "" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . html_print_checkbox_extended ('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true); diff --git a/pandora_console/godmode/netflow/nf_report_form.php b/pandora_console/godmode/netflow/nf_report_form.php index 8bbab2bbc2..90a420e218 100644 --- a/pandora_console/godmode/netflow/nf_report_form.php +++ b/pandora_console/godmode/netflow/nf_report_form.php @@ -34,6 +34,24 @@ $id = (int)get_parameter('id'); $update = (string)get_parameter('update', 0); $create = (string)get_parameter('create', 0); +$buttons['report_list']['active'] = false; +$buttons['report_list'] = '' + . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) + . ''; + +$buttons['report_items']['active'] = false; +$buttons['report_items']['text'] = '' + . html_print_image ("images/god6.png", true, array ("title" => __('Report items'))) + . ''; + +$buttons['edit_report']['active'] = true; +$buttons['edit_report']['text'] = '' + . html_print_image ("images/config.png", true, array ("title" => __('Edit report'))) + . ''; + +//Header +ui_print_page_header (__('Netflow Report'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); + if ($id) { $permission = netflow_check_report_group ($id, false); if (!$permission) { //no tiene permisos para acceder a un informe @@ -70,7 +88,8 @@ if ($update) { 'description' => $description, ), array ('id_report' => $id)); - } + ui_print_result_message ($result, __('Report updated successfully'), __('Error updating report')); + } } if ($create){ @@ -78,45 +97,19 @@ if ($create){ $group = (int) get_parameter ('id_group'); $description = get_parameter('description',''); - if($name == db_get_value('id_name', 'tnetflow_report', 'id_name', $name)){ - $result = false; - } else { - $values = array ( - 'id_name' => $name, - 'id_group' => $group, - 'description' => $description, - ); - $result = db_process_sql_insert('tnetflow_report', $values); - } - $id= db_get_value('id_report', 'tnetflow_report', 'id_name', $name); + $values = array ( + 'id_name' => $name, + 'id_group' => $group, + 'description' => $description, + ); + $id = db_process_sql_insert('tnetflow_report', $values); + if ($id === false) { + ui_print_error_message ('Error creating report'); + } else { + ui_print_success_message ('Report created successfully'); + } } -$buttons['view'] = '' - . html_print_image ("images/lupa.png", true, array ("title" => __('View data'))) - . ''; - -$buttons['list'] = '' - . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) - . ''; - -$buttons['list_items'] = '' - . html_print_image ("images/god6.png", true, array ("title" => __('Items list'))) - . ''; - -$buttons['item'] = '' - . html_print_image ("images/config.png", true, array ("title" => __('Item editor'))) - . ''; - -//Header -ui_print_page_header (__('Netflow Report'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); - -if ($create || $update){ - ui_print_result_message ($result, - __('Successfully!'), - __('Error!')); -} - - $table->width = '80%'; $table->border = 0; $table->cellspacing = 3; diff --git a/pandora_console/godmode/netflow/nf_report_item.php b/pandora_console/godmode/netflow/nf_report_item.php index f4fa8c61b1..7ac5c6dea6 100644 --- a/pandora_console/godmode/netflow/nf_report_item.php +++ b/pandora_console/godmode/netflow/nf_report_item.php @@ -36,16 +36,23 @@ $id_rc = (int)get_parameter('id_rc'); $update = (string)get_parameter('update', 0); $create = (string)get_parameter('create', 0); -$buttons['list_items'] = '' - . html_print_image ("images/god6.png", true, array ("title" => __('Item list'))) - . ''; - -$buttons['list'] = '' +$buttons['report_list']['active'] = false; +$buttons['report_list'] = '' . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) . ''; + +$buttons['report_items']['active'] = true; +$buttons['report_items']['text'] = '' + . html_print_image ("images/god6.png", true, array ("title" => __('Report items'))) + . ''; + +$buttons['edit_report']['active'] = false; +$buttons['edit_report']['text'] = '' + . html_print_image ("images/config.png", true, array ("title" => __('Edit report'))) + . ''; + //Header -ui_print_page_header (__('Netflow Report'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); - +ui_print_page_header (__('Report item editor'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); if ($id_rc) { $item = netflow_reports_get_content ($id_rc); @@ -95,22 +102,21 @@ if ($create){ } else { $order++; } - // $values = array ( - 'id_report' => $id, - 'id_filter' => $id_filter, - 'max' => $max_val, - 'show_graph' => $show_graph, - '`order`' => $order - ); - $result = db_process_sql_insert('tnetflow_report_content', $values); - - if ($result === false) - echo '

'.__ ('Error creating item').'

'; - else - echo '

'.__ ('Item created successfully').'

'; + 'id_report' => $id, + 'id_filter' => $id_filter, + 'max' => $max_val, + 'show_graph' => $show_graph, + '`order`' => $order + ); + $id_rc = db_process_sql_insert('tnetflow_report_content', $values); + if ($id_rc === false) { + echo '

'.__ ('Error creating item').'

'; + } else { + echo '

'.__ ('Item created successfully').'

'; } +} $table->width = '70%'; $table->border = 0; @@ -136,10 +142,10 @@ foreach($groups_user as $key => $groups){ } $sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',',$groups_id).")"; -$table->data[0][0] = ''.__('Filters').''; +$table->data[0][0] = ''.__('Filter').''; $table->data[0][1] = html_print_select_from_sql($sql, 'id_filter', $name_filter, '', '', 0, true); -$table->data[1][0] = ''.__('Max values aggregated').''; +$table->data[1][0] = ''.__('Max. values').''; $max_values = array ('2' => '2', '5' => '5', '10' => '10', @@ -150,7 +156,8 @@ $table->data[1][0] = ''.__('Max values aggregated').''; ); $table->data[1][1] = html_print_select ($max_values, 'max', $max_val, '', '', 0, true); -$table->data[2][0] = ''.__('Elements').''; +$table->data[2][0] = ''.__('Chart type').''; +$table->data[2][1] = html_print_select (netflow_get_chart_types (), 'show_graph', $show_graph,'','',0,true); $table->data[2][1] = html_print_select (netflow_get_chart_types (), 'show_graph', $show_graph,'','',0,true); echo '
'; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 2dcdf9848e..1470b93701 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -263,10 +263,10 @@ $menu["usuarios"]["id"] = "oper-users"; if (check_acl ($config['id_user'], 0, "IR")) { if ($config['activate_netflow']) { $menu["netf"]["text"] = __('Netflow'); - $menu["netf"]["sec2"] = "operation/netflow/nf_live_view"; + $menu["netf"]["sec2"] = "operation/netflow/nf_reporting"; $menu["netf"]["id"] = "oper-netflow"; $sub = array (); - $sub["operation/netflow/nf_reporting"]["text"] = __('Reports'); + $sub["operation/netflow/nf_live_view"]["text"] = __('Live view'); $menu["netf"]["sub"] = $sub; } } diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index 0edad0baee..5f33cd8ec8 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -32,6 +32,7 @@ if (! check_acl ($config["id_user"], 0, "AR")) { } // Read filter configuration +$filter_id = (int) get_parameter ('filter_id', 0); $filter['id_name'] = (string) get_parameter ('name', ''); $filter['id_group'] = (int) get_parameter ('assign_group', 0); $filter['aggregate'] = get_parameter('aggregate',''); @@ -53,18 +54,47 @@ $time = get_parameter_post ('time', date ("H:i:s", get_system_time ())); // Read buttons $draw = get_parameter('draw_button', ''); +$save = get_parameter('save_button', ''); +$update = get_parameter('update_button', ''); +$load = get_parameter('load_button', ''); // Calculate start and end dates $end_date = strtotime ($date . " " . $time); $start_date = $end_date - $period; -$buttons = array (); -//$buttons['report_list'] = '' -// . html_print_image ("images/edit.png", true, array ("title" => __('Report list'))) -// . ''; - //Header -ui_print_page_header (__('Netflow live view'), "images/networkmap/so_cisco_new.png", false, "", false, $buttons); +ui_print_page_header (__('Netflow live view'), "images/networkmap/so_cisco_new.png", false, "", false, array ()); + +// Save user defined filter +if ($save != '') { + $filter_id = db_process_sql_insert ('tnetflow_filter', $filter); + if ($filter_id === false) { + $filter_id = 0; + echo '

'.__ ('Error creating filter').'

'; + } else { + echo '

'.__ ('Filter created successfully').'

'; + } +} +// Update current filter +else if ($update != '' && $filter_id > 0) { + // Do not update the filter name and group + $filter_copy = $filter; + unset ($filter_copy['id_name']); + unset ($filter_copy['id_group']); + + $result = db_process_sql_update ('tnetflow_filter', $filter_copy, array ('id_sg' => $filter_id)); + ui_print_result_message ($result, __('Filter updated successfully'), __('Error updating filter')); +} +// Load an existing filter +else if ($load != '' && $filter_id > 0) { + $result = db_get_row_sql ("SELECT * FROM tnetflow_filter WHERE id_sg = $filter_id"); + if ($result !== false) { + $filter = $result; + } +} + +// The filter name will not be needed anymore +$filter['id_name'] = ''; echo ''; @@ -92,16 +122,11 @@ echo ''; -// html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); -// html_print_input_hidden ('update_date', 1); -// echo ''; - // Filter options table $table->width = '100%'; $table->border = 0; @@ -110,60 +135,69 @@ echo 'data[0][0] = ui_print_error_message ('Define a name for the filter and click on Save as new filter again', '', true); + $table->colspan[0][0] = 4; + + $table->data[1][0] = ''.__('Name').''; + $table->data[1][1] = html_print_input_text ('name', $filter['id_name'], false, 20, 80, true); + $own_info = get_user_info ($config['id_user']); + $table->data[1][2] = ''.__('Group').''; + $table->data[1][3] = html_print_select_groups($config['id_user'], "IW", $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false); + + // Read filter type if ($filter['advanced_filter'] != '') { $filter_type = 1; } else { $filter_type = 0; } - $table->data[0][0] = ''.__('Filter:').''; - $table->data[0][1] = __('Normal') . ' ' . html_print_radio_button_extended ('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true); - $table->data[0][2] = __('Advanced') . ' ' . html_print_radio_button_extended ('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true); + $table->data[2][0] = ''.__('Filter').''; + $table->data[2][1] = __('Normal') . ' ' . html_print_radio_button_extended ('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true); + $table->data[2][1] .= __('Advanced') . ' ' . html_print_radio_button_extended ('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true); + $table->data[2][2] = ''.__('Load filter').''; + $user_groups = users_get_groups ($config['id_user'], "AW", $own_info['is_admin'], true); + $sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',', array_keys ($user_groups)).")"; + $table->data[2][3] = html_print_select_from_sql ($sql, 'filter_id', $filter_id, '', __('none'), 0, true); + $table->data[2][3] .= html_print_submit_button (__('Load'), 'load_button', false, 'class="sub upd"', true); - $table->data[1][0] = __('Dst Ip'). ui_print_help_tip (__("Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:
25.46.157.214,160.253.135.249"), true); - $table->data[1][1] = html_print_input_text ('ip_dst', $filter['ip_dst'], false, 40, 80, true); - $table->data[1][2] = __('Src Ip'). ui_print_help_tip (__("Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:
25.46.157.214,160.253.135.249"), true); - $table->data[1][3] = html_print_input_text ('ip_src', $filter['ip_src'], false, 40, 80, true); + $table->data[3][0] = __('Dst Ip'). ui_print_help_tip (__("Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:
25.46.157.214,160.253.135.249"), true); + $table->data[3][1] = html_print_input_text ('ip_dst', $filter['ip_dst'], false, 40, 80, true); + $table->data[3][2] = __('Src Ip'). ui_print_help_tip (__("Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:
25.46.157.214,160.253.135.249"), true); + $table->data[3][3] = html_print_input_text ('ip_src', $filter['ip_src'], false, 40, 80, true); - $table->data[2][0] = __('Dst Port'). ui_print_help_tip (__("Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
80,22"), true); - $table->data[2][1] = html_print_input_text ('dst_port', $filter['dst_port'], false, 40, 80, true); - $table->data[2][2] = __('Src Port'). ui_print_help_tip (__("Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
80,22"), true); - $table->data[2][3] = html_print_input_text ('src_port', $filter['src_port'], false, 40, 80, true); + $table->data[4][0] = __('Dst Port'). ui_print_help_tip (__("Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
80,22"), true); + $table->data[4][1] = html_print_input_text ('dst_port', $filter['dst_port'], false, 40, 80, true); + $table->data[4][2] = __('Src Port'). ui_print_help_tip (__("Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
80,22"), true); + $table->data[4][3] = html_print_input_text ('src_port', $filter['src_port'], false, 40, 80, true); - $table->data[3][0] = ui_print_help_icon ('pcap_filter', true); - $table->data[3][1] = html_print_textarea ('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px;'", true); - $table->colspan[3][1] = 3; + $table->data[5][0] = ui_print_help_icon ('pcap_filter', true); + $table->data[5][1] = html_print_textarea ('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px;'", true); + $table->colspan[5][1] = 3; - $table->data[4][0] = ''.__('Aggregate by').''. ui_print_help_icon ('aggregate_by', true); + $table->data[6][0] = ''.__('Aggregate by').''. ui_print_help_icon ('aggregate_by', true); $aggregate_list = array(); $aggregate_list = array ('none' => __('None'), 'proto' => __('Protocol'), 'srcip' =>__('Src Ip Address'), 'dstip' =>__('Dst Ip Address'), 'srcport' =>__('Src Port'), 'dstport' =>__('Dst Port') ); - - $table->data[4][1] = html_print_select ($aggregate_list, "aggregate", $filter['aggregate'], '', '', 0, true, false, true, '', false); + $table->data[6][1] = html_print_select ($aggregate_list, "aggregate", $filter['aggregate'], '', '', 0, true, false, true, '', false); - $table->data[4][2] = ''.__('Output format').''; + $table->data[6][2] = ''.__('Output format').''; $show_output = array(); $show_output = array ('packets' => __('Packets'), 'bytes' => __('Bytes'), 'flows' =>__('Flows')); - $table->data[4][3] = html_print_select ($show_output, 'output', $filter['output'], '', '', 0, true, false, true, '', false); + $table->data[6][3] = html_print_select ($show_output, 'output', $filter['output'], '', '', 0, true, false, true, '', false); html_print_table ($table); html_print_submit_button (__('Draw'), 'draw_button', false, 'class="sub upd"'); + html_print_submit_button (__('Save as new filter'), 'save_button', false, 'class="sub upd" onClick="return defineFilterName();"'); + if ($filter_id > 0) { + html_print_submit_button (__('Update current filter'), 'update_button', false, 'class="sub upd"'); + } echo'
'; if ($draw != '') { - // Get the command to call nfdump - $command = netflow_get_command ($filter); + // Get the command to call nfdump + $command = netflow_get_command ($filter); // Build a unique id for the cache $unique_id = 'live_view__' . ($end_date - $start_date); @@ -176,40 +210,57 @@ if ($draw != '') {