Skip to content

Commit

Permalink
Firewall: Log Files: Live View - change cleanup a bit so it keeps fil…
Browse files Browse the repository at this point in the history
…tered items longer available. The trick in this case is relatively simple, by splitting the cleanup in visible and invisible items, we keep visible items longer on screen at the (small) cost of using a little more memory.

might solve part of the problem #6833 tries to solve.

(cherry picked from commit 854043d)
  • Loading branch information
AdSchellevis authored and fichtner committed Oct 29, 2023
1 parent a40dd50 commit e943be3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/opnsense/mvc/app/views/OPNsense/Diagnostics/fw_log.volt
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,14 @@
// apply filter after load
apply_filter();

// limit output, try to keep max X records on screen.
$("#grid-log > tbody > tr:gt("+max_rows+")").remove();
/**
* Limit output, try to keep max X records on screen.
* By removing the invisible items first, we should be able to keep the filtered ones
* longer in scope. In theory the number of items in memory can grow to 2 x max_rows, but
* in practice that's not really an issue.
*/
$("#grid-log > tbody > tr:not(:visible):gt("+max_rows+")").remove();
$("#grid-log > tbody > tr:visible:gt("+max_rows+")").remove();

// bind info buttons
$(".act_info").unbind('click').click(function(){
Expand Down

0 comments on commit e943be3

Please sign in to comment.