Skip to content

Commit

Permalink
Implement 'Save' button
Browse files Browse the repository at this point in the history
- Restore some filtering functions
- Replace legacy jQuery unbind/bind with off/on
- Simplify the values saved to the session
- Make pace actions more consistent for long running queries especially
  • Loading branch information
TheWitness committed Nov 1, 2020
1 parent f9c7e62 commit 2647892
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 94 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* feature: Support IPv4 and IPv6
* feature: Support daily and hourly partitioning
* feature: Run Schedules in Background
* feature: Allow Saving of some Filter Information from Flowview

--- 2.1 ---
* issue: Prepare for sunrise theme in 1.1.17
Expand Down
77 changes: 4 additions & 73 deletions flowview.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
case 'save':
save_filter();
break;
case 'savefilter':
save_filter_form();
break;
case 'sort_filter':
sort_filter();
break;
Expand Down Expand Up @@ -183,20 +186,8 @@ function load_session_for_filter() {
function flowview_request_vars() {
/* ================= input validation and session storage ================= */
$filters = array(
'includeif' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'statistics' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '0'
),
'printed' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '0'
),
'sortfield' => array(
'filter' => FILTER_DEFAULT,
'filter' => FILTER_VALIDATE_INT,
'default' => ''
),
'sortvalue' => array(
Expand All @@ -217,11 +208,6 @@ function flowview_request_vars() {
'filter' => FILTER_VALIDATE_INT,
'default' => '1000000'
),
'device' => array(
'filter' => FILTER_CALLBACK,
'options' => array('options' => 'sanitize_search_string'),
'default' => '0'
),
'predefined_timespan' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => read_user_setting('default_timespan')
Expand All @@ -240,56 +226,6 @@ function flowview_request_vars() {
'options' => array('options' => 'sanitize_search_string'),
'default' => ''
),
'protocols' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_ARRAY,
'default' => array()
),
'includeif' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => ''
),
'tcpflags' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'tosfields' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'sourceip' => array(
'filter' => FILTER_CALLBACK,
'options' => array('options' => 'sanitize_search_string'),
'default' => ''
),
'sourceport' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'sourceinterface' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'sourceas' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'destip' => array(
'filter' => FILTER_CALLBACK,
'options' => array('options' => 'sanitize_search_string'),
'default' => ''
),
'destport' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'destinterface' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'destas' => array(
'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST,
'default' => ''
),
'domains' => array(
'filter' => FILTER_VALIDATE_REGEXP,
'options' => array('options' => array('regexp' => '(true|false)')),
Expand All @@ -314,11 +250,6 @@ function flowview_request_vars() {
'filter' => FILTER_VALIDATE_REGEXP,
'options' => array('options' => array('regexp' => '(true|false)')),
'default' => 'false'
),
'resolve' => array(
'filter' => FILTER_VALIDATE_REGEXP,
'options' => array('options' => array('regexp' => '(Y|N|true|false)')),
'default' => 'true'
)
);

Expand Down
Loading

0 comments on commit 2647892

Please sign in to comment.