services_dnsmasq_edit.php: Configuration XML hosts section order appears randomized
Related to #6893 - when I view the diff of the configuration XML after a change to DNS Resolver's Host Overrides section, the <unbound><hosts> entries appear to be randomized when they get written out to the XML. This makes viewing the diff confusing as it shows several lines modified, when in reality only a single change may have taken place.
It would be nice if the order of the XML elements matched the order displayed in the GUI.
#2 Updated by Steve Beaver 7 months ago
- Subject changed from Configuration XML hosts section order appears randomized to services_dnsmasq_edit.php: Configuration XML hosts section order appears randomized
- Status changed from New to Feedback
It is certainly not "randomized", but since the two tables may be sorted (by clicking the column headers) the hosts can appear in whichever order you want.
Currently on saving a new override the hosts are sorted alphabetically by host name, so they should always appear in a consistent order when the page is first loaded, and this seems a desirable feature. Of course it also means that if you add a new override and its name begins with 'A', it will be added to the start of the list and all existing hosts will move down one.
A better approach might be to leave the list unsorted on save, but sort it when rendering the display?
A change to that effect has been pushed. Please test in the next snapshot.