Skip to content

Commit

Permalink
Fixing Issue #59
Browse files Browse the repository at this point in the history
Flowview Data won't display in CACTI
  • Loading branch information
TheWitness committed Nov 21, 2020
1 parent 5a22ab4 commit 4ef2210
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion flowview.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
flowview_request_vars();
flowview_gettimespan();
break;
case 'query':
load_session_for_filter();
default:
general_header();

Expand Down Expand Up @@ -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 ================= */
}

33 changes: 22 additions & 11 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() +
Expand Down Expand Up @@ -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() +
Expand Down Expand Up @@ -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() +
Expand Down Expand Up @@ -1067,8 +1067,8 @@ function saveFilter() {
'&query=' + $('#query').val() +
'&timespan=' + $('#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() {
Expand Down Expand Up @@ -1112,6 +1112,17 @@ function applyTimespan() {
}
}

function changeQuery() {
loadPageNoHeader(urlPath+'plugins/flowview/flowview.php' +
'?action=query' +
'&domains=' + $('#domains').is(':checked') +
'&query=' + $('#query').val() +
'&timespan=' + $('#predefined_timespan').val() +
'&date1=' + $('#date1').val() +
'&date2=' + $('#date2').val() +
'&header=false');
}

function applyFilter(reset) {
if (reset) {
var report = 0;
Expand All @@ -1125,8 +1136,8 @@ function applyFilter(reset) {
'&query=' + $('#query').val() +
'&timespan=' + $('#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() +
Expand Down

0 comments on commit 4ef2210

Please sign in to comment.