The API only sets 'active' for active interfaces, so it is either 1 or
missing. As 1 compares neither greater nor less than undefined, sorting
by the 'Active' column kept the previous order. The same applies to the
'Autostart' and 'VLAN aware' columns.
Declare those fields as booleans, so that missing values get converted
to false and the interfaces can be sorted by them. The shown values do
not change, as missing values were already rendered as 'No'.
Signed-off-by: Michal Fox <me@dualfroz.com>
The interface list was sorted by comparing the names as plain strings,
so 'eno10' and 'eno11' came before 'eno2', and 'vmbr10' before 'vmbr2'.
Sort by name with a comparison that orders numbers in the names by
their value instead. Use the same sorter for the initial order of the
store and for the name column, so that the column header still shows
the initial sort order and the first click on it reverses it, like
before.
The 'Ports/Slaves' column uses the type as data index, so sorting by it
just sorted by type. Sort it by the shown ports or slaves instead, also
in natural order.
Signed-off-by: Michal Fox <me@dualfroz.com>
When an interface has an IPv6 address, the selector adds a separate
entry for it and takes the comment from the 'comments6' property.
The API never returns that property: since pve-common commit f2ac9dd
("fix #3153: INotify: adding comment of interface to inet6 section when
this is the only section") the parser merges the inet6 comments into
'comments'.
As a result, the comment of IPv6-only interfaces was dropped, and the
IPv6 entry of dual-stack interfaces had no comment at all, for example
when selecting corosync links or the Ceph networks.
Just keep the 'comments' value, which is already present on the record
or on its copy.
Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20260929140710.2823699-1-me@dualfroz.com