-
-
Notifications
You must be signed in to change notification settings - Fork 621
Description
Hi Shreyas,
I have a minor UI/UX bug which I'd like to report. When sorting a table on the web UI by "IP" address, the entire IP is being sorted as a string rather than by octet. I have a screenshot from the DCHP lease table and further details below.
Example
Observed order:
- 192.168.0.101
- 192.168.0.61
- 192.168.0.62
Expected order:
- 192.168.0.61
- 192.168.0.62
- 192.168.0.101
Image1: Screenshot from DCHP leases table. Redacted names of family/friends for privacy, but I think the point is clear
Potential error in the source code
I believe the problem is arising from:
if (dir == "asc") {
if (x.innerText.toLowerCase() > y.innerText.toLowerCase()) {
// If so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
} else if (dir == "desc") {
if (x.innerText.toLowerCase() < y.innerText.toLowerCase()) {
// If so, mark as a switch and break the loop:
shouldSwitch = true;
break;
}
}which is a part of the function sortTable(tableId, n) in DnsServerCore/www/js/common.js
https://github.com/TechnitiumSoftware/DnsServer/blob/master/DnsServerCore/www/js/common.js
If you're open for a PR, I can try to improve this sort logic. Full disclosure, I have minimal experience with javascript. However, I feel like this is "easy enough" for me to dip my toes and submit something if you'd like