diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf80f9..4b00405 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ --- 3.1 --- * issue#58: Flowview cannot enable in Cacti +* issue#59: Flowview Data wont display in CACTI * issue: Results Cache not working * feature: Support Cacti Format Files in FlowView diff --git a/flowview.php b/flowview.php index 197daac..e72df1a 100644 --- a/flowview.php +++ b/flowview.php @@ -53,6 +53,8 @@ flowview_request_vars(); flowview_gettimespan(); break; + case 'query': + load_session_for_filter(); default: general_header(); @@ -253,7 +255,7 @@ function flowview_request_vars() { ) ); - validate_store_request_vars($filters, 'sess_fv'); + validate_store_request_vars($filters, 'sess_fv_' . get_filter_request_var('query')); /* ================= input validation ================= */ } diff --git a/functions.php b/functions.php index 97d62df..1cbb77d 100644 --- a/functions.php +++ b/functions.php @@ -684,7 +684,7 @@ function flowview_display_filter($data) { }); $('#query').off('change').on('change', function() { - applyFilter(true); + changeQuery(true); }); $('#domains, #exclude').off('change').on('change', function() { @@ -862,8 +862,8 @@ function flowview_display_filter($data) { '&domains=' + $('#domains').is(':checked') + '&query=' + $('#query').val() + '&report=' + $('#report').val() + - '&sortfield=' + ($('#sortfield').val() != '' ? $('#sortfield').val():'') + - '&sortvalue=' + ($('#sortfield').val() != '' ? $('#sortfield option:selected').html():'Bytes') + + '&sortfield=' + ($('#sortfield').val() != null ? $('#sortfield').val():'') + + '&sortvalue=' + ($('#sortfield').val() != null ? $('#sortfield option:selected').html():'Bytes') + '&cutofflines=' + $('#cutofflines').val() + '&cutoffoctets=' + $('#cutoffoctets').val() + '&exclude=' + $('#exclude').val() + @@ -918,8 +918,8 @@ function flowview_display_filter($data) { '&domains=' + $('#domains').is(':checked') + '&query=' + $('#query').val() + '&report=' + $('#report').val() + - '&sortfield=' + ($('#sortfield').val() != '' ? $('#sortfield').val():'') + - '&sortvalue=' + ($('#sortfield').val() != '' ? $('#sortfield option:selected').html():'Bytes') + + '&sortfield=' + ($('#sortfield').val() != null ? $('#sortfield').val():'') + + '&sortvalue=' + ($('#sortfield').val() != null ? $('#sortfield option:selected').html():'Bytes') + '&cutofflines=' + $('#cutofflines').val() + '&cutoffoctets=' + $('#cutoffoctets').val() + '&exclude=' + $('#exclude').val() + @@ -974,8 +974,8 @@ function flowview_display_filter($data) { '&domains=' + $('#domains').is(':checked') + '&query=' + $('#query').val() + '&report=' + $('#report').val() + - '&sortfield=' + ($('#sortfield').val() != '' ? $('#sortfield').val():'') + - '&sortvalue=' + ($('#sortfield').val() != '' ? $('#sortfield option:selected').html():'Bytes') + + '&sortfield=' + ($('#sortfield').val() != null ? $('#sortfield').val():'') + + '&sortvalue=' + ($('#sortfield').val() != null ? $('#sortfield option:selected').html():'Bytes') + '&cutofflines=' + $('#cutofflines').val() + '&cutoffoctets=' + $('#cutoffoctets').val() + '&exclude=' + $('#exclude').val() + @@ -1067,8 +1067,8 @@ function saveFilter() { '&query=' + $('#query').val() + '×pan=' + $('#predefined_timespan').val() + '&report=' + report + - '&sortfield=' + ($('#sortfield').val() != '' ? $('#sortfield').val():'') + - '&sortvalue=' + ($('#sortfield').val() != '' ? $('#sortfield option:selected').html():'Bytes') + + '&sortfield=' + ($('#sortfield').val() != null ? $('#sortfield').val():'') + + '&sortvalue=' + ($('#sortfield').val() != null ? $('#sortfield option:selected').html():'Bytes') + '&cutofflines=' + $('#cutofflines').val() + '&cutoffoctets=' + $('#cutoffoctets').val() + '&exclude=' + $('#exclude').val(), function() { @@ -1112,6 +1112,17 @@ function applyTimespan() { } } + function changeQuery() { + loadPageNoHeader(urlPath+'plugins/flowview/flowview.php' + + '?action=query' + + '&domains=' + $('#domains').is(':checked') + + '&query=' + $('#query').val() + + '×pan=' + $('#predefined_timespan').val() + + '&date1=' + $('#date1').val() + + '&date2=' + $('#date2').val() + + '&header=false'); + } + function applyFilter(reset) { if (reset) { var report = 0; @@ -1125,8 +1136,8 @@ function applyFilter(reset) { '&query=' + $('#query').val() + '×pan=' + $('#predefined_timespan').val() + '&report=' + report + - '&sortfield=' + ($('#sortfield').val() != '' ? $('#sortfield').val():'') + - '&sortvalue=' + ($('#sortfield').val() != '' ? $('#sortfield option:selected').html():'Bytes') + + '&sortfield=' + ($('#sortfield').val() != null ? $('#sortfield').val():'') + + '&sortvalue=' + ($('#sortfield').val() != null ? $('#sortfield option:selected').html():'Bytes') + '&cutofflines=' + $('#cutofflines').val() + '&cutoffoctets=' + $('#cutoffoctets').val() + '&exclude=' + $('#exclude').val() +