Added advanced filter on netflow live view
Former-commit-id: 13e2d3d26f6bb2c2f25900793464390997be4e41
This commit is contained in:
parent
8696bd9f91
commit
92d2e505ed
|
@ -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', 1);
|
$max_aggregates = (int) get_parameter('max_aggregates', 10);
|
||||||
$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()));
|
||||||
|
@ -284,26 +284,17 @@ if (is_metaconsole()) {
|
||||||
echo '<td>'.html_print_select($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true).'<a id="max_values" href="#" onclick="javascript: edit_max_value();">'.html_print_image('images/pencil.png', true, ['id' => 'pencil']).'</a>';
|
echo '<td>'.html_print_select($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true).'<a id="max_values" href="#" onclick="javascript: edit_max_value();">'.html_print_image('images/pencil.png', true, ['id' => 'pencil']).'</a>';
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
||||||
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
|
echo '<td>'.'<b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true).'</td>';
|
||||||
$radio_buttons = __('Yes').' '.html_print_radio_button_extended(
|
$aggregate_list = [];
|
||||||
'address_resolution',
|
$aggregate_list = [
|
||||||
1,
|
'none' => __('None'),
|
||||||
'',
|
'proto' => __('Protocol'),
|
||||||
$address_resolution,
|
'srcip' => __('Src Ip Address'),
|
||||||
false,
|
'dstip' => __('Dst Ip Address'),
|
||||||
$onclick,
|
'srcport' => __('Src Port'),
|
||||||
'',
|
'dstport' => __('Dst Port'),
|
||||||
true
|
];
|
||||||
).' ';
|
echo '<td>'.html_print_select($aggregate_list, 'aggregate', $filter['aggregate'], '', '', 0, true, false, true, '', false).'</td>';
|
||||||
$radio_buttons .= __('No').' '.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 '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
|
@ -333,10 +324,24 @@ if (is_metaconsole()) {
|
||||||
$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>';
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo '<tr>';
|
|
||||||
|
|
||||||
|
echo '<tr id="filter_toggle">';
|
||||||
|
echo '<td>';
|
||||||
|
html_print_image(
|
||||||
|
'images/darrowdown.png',
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'onclick' => 'toggleFilters(event)',
|
||||||
|
'style' => 'cursor: pointer;',
|
||||||
|
'id' => 'nf-toggle-button',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
echo __('Advanced');
|
||||||
|
echo '</td>';
|
||||||
|
echo '</tr>';
|
||||||
|
|
||||||
|
echo '<tr class="nf_filter">';
|
||||||
if ($netflow_disable_custom_lvfilters) {
|
if ($netflow_disable_custom_lvfilters) {
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
|
@ -359,10 +364,7 @@ if (is_metaconsole()) {
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
|
echo "<tr class='filter_normal nf_filter'>";
|
||||||
|
|
||||||
echo "<tr class='filter_normal'>";
|
|
||||||
|
|
||||||
if ($netflow_disable_custom_lvfilters) {
|
if ($netflow_disable_custom_lvfilters) {
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
|
@ -380,8 +382,8 @@ if (is_metaconsole()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo "<tr class='filter_normal'>";
|
|
||||||
|
|
||||||
|
echo "<tr class='filter_normal nf_filter'>";
|
||||||
if ($netflow_disable_custom_lvfilters) {
|
if ($netflow_disable_custom_lvfilters) {
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
|
@ -399,8 +401,8 @@ if (is_metaconsole()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo "<tr class='filter_advance' style='display: none;'>";
|
|
||||||
|
|
||||||
|
echo "<tr class='filter_advance nf_filter' style='display: none;'>";
|
||||||
if ($netflow_disable_custom_lvfilters) {
|
if ($netflow_disable_custom_lvfilters) {
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
echo '<td></td>';
|
echo '<td></td>';
|
||||||
|
@ -410,19 +412,28 @@ if (is_metaconsole()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo '<tr>';
|
echo '<tr class="nf_filter">';
|
||||||
|
|
||||||
echo '<td>'.'<b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true).'</td>';
|
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
|
||||||
$aggregate_list = [];
|
$radio_buttons = __('Yes').' '.html_print_radio_button_extended(
|
||||||
$aggregate_list = [
|
'address_resolution',
|
||||||
'none' => __('None'),
|
1,
|
||||||
'proto' => __('Protocol'),
|
'',
|
||||||
'srcip' => __('Src Ip Address'),
|
$address_resolution,
|
||||||
'dstip' => __('Dst Ip Address'),
|
false,
|
||||||
'srcport' => __('Src Port'),
|
$onclick,
|
||||||
'dstport' => __('Dst Port'),
|
'',
|
||||||
];
|
true
|
||||||
echo '<td>'.html_print_select($aggregate_list, 'aggregate', $filter['aggregate'], '', '', 0, true, false, true, '', false).'</td>';
|
).' ';
|
||||||
|
$radio_buttons .= __('No').' '.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>'.'<b>'.__('Router ip').'</b>'.'</td>';
|
echo '<td>'.'<b>'.__('Router ip').'</b>'.'</td>';
|
||||||
echo '<td>'.html_print_input_text('router_ip', $filter['router_ip'], false, 30, 80, true).'</td>';
|
echo '<td>'.html_print_input_text('router_ip', $filter['router_ip'], false, 30, 80, true).'</td>';
|
||||||
|
@ -554,7 +565,22 @@ if (is_metaconsole()) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function toggleFilters (event) {
|
||||||
|
// Display or show the items.
|
||||||
|
var is_advanced = $("#radiobtn0001").is(':checked');
|
||||||
|
var class_name = is_advanced ? ".filter_advance" : ".filter_normal";
|
||||||
|
$(".nf_filter").not(class_name).toggle();
|
||||||
|
|
||||||
|
// Change the image.
|
||||||
|
$('#' + event.target.id).attr(
|
||||||
|
'src',
|
||||||
|
$(".nf_filter").not(class_name).first().is(':visible')
|
||||||
|
? 'images/darrowup.png'
|
||||||
|
: 'images/darrowdown.png'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Display the appropriate filter
|
// Display the appropriate filter
|
||||||
var filter_type = <?php echo $filter_type; ?>;
|
var filter_type = <?php echo $filter_type; ?>;
|
||||||
if (filter_type == 0) {
|
if (filter_type == 0) {
|
||||||
|
@ -704,3 +730,8 @@ if (is_metaconsole()) {
|
||||||
|
|
||||||
$.datepicker.regional["<?php echo get_user_language(); ?>"];
|
$.datepicker.regional["<?php echo get_user_language(); ?>"];
|
||||||
</script>
|
</script>
|
||||||
|
<style type="text/css">
|
||||||
|
.nf_filter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue