opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.37k stars 757 forks source link

Ability to sort on columns in Firewall: Diagnostics: pfTables #4577

Closed Styx13 closed 3 years ago

Styx13 commented 3 years ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe. Not really a problem, just it is difficult to consults some statistics. Enabling statistics on certain aliases, especially Table/URLTable type of aliases uses for droplist (i.e. spamhaus) is very useful to keep track of which IP is attempting to reach in. The statistics are available at the Firewall: Diagnostics: pfTables page, however this page does not have sorting capabilities on the different columns (packet/bytes blocked/passed, ..)

Describe the solution you like The solution would involved the possibility to sort on columns by clicking on them. So a clear example, on the Firewall: Diagnostics: pfTables page, after selecting an alias in the dropdown list at the top left (example. bogons) I see the list of IPs associated with that alias and the statistics for the IPs (assuming the statistics checkbox has been checked for this alias). I would like then to be able to click on any of the column (IP Address, packets in block, packets out block, packets in pass, ...) and get the entries in the table sorted by that column.

In my case, I would sort on the "packets in block" to identify the IP addresses that attempted to connect to my network the most.

Relevant forum thread: https://forum.opnsense.org/index.php?topic=20722.0

kulikov-a commented 3 years ago

hi all! Since I have suggested making a FR for this on forum, can I make PR for this? (1 character is added in list_table.py and 12 lines in the AliasUtilController.php). for tables with allowed stats, "0" is displayed instead of nbsp, for tables without enabled statistics, the lines are empty (as it was). sorting by all columns works. (all server-side as it was)

https://user-images.githubusercontent.com/36099472/104043181-7d39be00-51ec-11eb-8f77-712e6eeef618.mp4

AdSchellevis commented 3 years ago

@kulikov-a sure, go ahead and we'll try to review when we can.