Feature #15437
closed
Use natural sorting when sorting interfaces
Added by Flo Faber almost 2 years ago.
Updated about 2 months ago.
Plus Target Version:
24.11
Description
When the option Interfaces Sort / Sort Alphabetically is enabled, Interfaces are sorted alphabetically instead of naturally. This causes interfaces to be sorted like this:
- LAN
- VLAN12
- VLAN120
- VLAN24
- VLAN240
- WAN
This behavior is not at all great for interface-descriptions containing numbers as it causes even more confusion than unsorted interfaces. Natural sort would improve this a lot:
- LAN
- VLAN12
- VLAN24
- VLAN120
- VlAN240
- WAN
- Tracker changed from Bug to Feature
- Affected Architecture deleted (
All)
- Subject changed from Interfaces sorted alphabetically instead of naturally to Use natural sorting when sorting interfaces
- Status changed from New to Pull Request Review
- Target version set to 2.8.0
- Plus Target Version set to 24.08
- Status changed from Pull Request Review to Feedback
- % Done changed from 0 to 100
- Plus Target Version changed from 24.08 to 24.11
after enabling "Sort Alphabetically"
LAN
VLAN1
VLAN12
VLAN120
VLAN24
VlAN240
WAN
24.11-ALPHA (amd64)
built on Sat Oct 12 8:22:00 PDT 2024
FreeBSD 15.0-CURRENT
once alphabetical sort has been enabled the interface description sort adheres to alphanumerical ascending list order
tested with 24.11.b.20241026.1338 amd64
- Status changed from Feedback to Resolved
Looks good on
24.11-BETA (amd64)
built on Sat Nov 9 14:00:00 UTC 2024
FreeBSD 15.0-CURRENT
Marking resolved.
I'm using 25.11-RELEASE with interfaces sort enabled, and this doesn't seem to be fixed (or it doesn't work as expected when additional non-numeric text follows the number). Here's the problematic excerpt from my supposedly sorted interface list:
- LAN
- LAN1
- LAN10G1
- LAN10G2
- LAN2
For reference,
sort -V (from GNU coreutils) implements a similar natural sorting of alphanumeric text (it's intended for version strings), and it produces the order I'd expect:
- LAN
- LAN1
- LAN2
- LAN10G1
- LAN10G2
Oh I think I see the problem. The edited code must not be addressing all the places an interface list appears. The Interfaces menu is still not sorted naturally. However, the Interfaces widget on the dashboard, the tabs under Firewall/Rules, and the interface selector for various services, all have it sorted naturally.
I opened a new bug report #16654.
Also available in: Atom
PDF