TableFilter icon indicating copy to clipboard operation
TableFilter copied to clipboard

Add combined IP/FQDN filter option

Open peternewman opened this issue 5 years ago • 0 comments

Enhancement/feature description I have a table with a mix of IPs and FQDNs in it, the IP sort looks good, but won't work sensibly for all FQDNs

Steps which explain the enhancement/feature E.g. sorting the following:

  • 127.0.0.1
  • 1.1.1.1
  • 10.1.2.3
  • a.example.co.uk
  • 1.example.co.uk
  • example.com
  • foo.bar.com

Current and suggested behavior Current will either pad anything with a subdomain < 3 if using IP: https://github.com/koalyptus/TableFilter/blob/b04d4f55ed47230f4571c7700c249ac5447c4ad5/src/extensions/sort/adapterSortabletable.js#L514-L537

Or sort incorrectly if not.

If it checks and if the string split has four parts and each part is a number, it should apply the IP address filter, otherwise it should leave it untouched. It should sort the results as for strings.

This could become the full behaviour of the ipAddress function if the lower casing was dropped, although it wouldn't be as efficient if the field was genuinely all just IPs.

It should probably try and handle IPv6 at some point too...

Why would the enhancement be useful to most users Allow sorting of mixed IP/FQDN records

Describe alternatives you've considered Do nothing/sort incorrectly via IP or string.

peternewman avatar Jul 15 '20 23:07 peternewman