diff --git a/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt b/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt index 6202b2984..65f885192 100644 --- a/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt +++ b/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt @@ -95,12 +95,24 @@ POSSIBILITY OF SUCH DAMAGE. } /** - * Add fileid to alert filter + * add filter criteria to log query */ function addAlertQryFilters(request) { - var selected =$('#alert-logfile').find("option:selected").val(); - if ( selected != "") { - request['fileid'] = selected; + var selected_logfile =$('#alert-logfile').find("option:selected").val(); + var selected_max_entries =$('#alert-logfile-max').find("option:selected").val(); + var search_phrase = $("#inputSearchAlerts").val(); + + // add loading overlay + $('#processing-dialog').modal('show'); + $("#grid-alerts").bootgrid().on("loaded.rs.jquery.bootgrid", function (e){ + $('#processing-dialog').modal('hide'); + }); + + + if ( selected_logfile != "") { + request['fileid'] = selected_logfile; + request['rowCount'] = selected_max_entries; + request['searchPhrase'] = search_phrase; } return request; } @@ -170,7 +182,7 @@ POSSIBILITY OF SUCH DAMAGE. // refresh when all toggles are executed $.when.apply(null, deferreds).done(function(){ - $("#"+gridId).bootgrid("reload"); + $("#"+gridId).bootgrid("refresh"); }); } } @@ -200,6 +212,7 @@ POSSIBILITY OF SUCH DAMAGE. get:'/api/ids/settings/getRuleInfo/', options:{ requestHandler:addRuleFilters, + rowCount:[10, 25, 50,100,500,1000] , formatters:{ rowtoggle: function (column, row) { var toggle = " "; @@ -227,12 +240,15 @@ POSSIBILITY OF SUCH DAMAGE. options:{ multiSelect:false, selection:false, + templates : { + header: "" + }, requestHandler:addAlertQryFilters, formatters:{ info: function (column, row) { return " "; } - } + }, } }); } @@ -343,6 +359,13 @@ POSSIBILITY OF SUCH DAMAGE. actionToggleSelected(gridId, url, 1, 100); }); + /** + * link query alerts button. + */ + $("#actQueryAlerts").click(function(){ + $('#grid-alerts').bootgrid('reload'); + }); + /** * Initialize */ @@ -442,6 +465,23 @@ POSSIBILITY OF SUCH DAMAGE.