Sort the DHCP reservation list by any column #914
Conversation
Asus is currently doing a lot of changes to the webui to link it to the new improved networkmap. That code isn't present yet on Github as it's still beta GPL code. It means there's a chance that a lot will change on that page by the time it gets merged in. |
Ok. If they don't add the feature themselves I'm ready to adjust my script at that time if need be. |
I should be done with major changes to the DHCP page for now (I merged support for the new networkmap code), so feel free to update this patch to adapt to the new code (first col data must be accessed through .title rather than .innerHTML now). |
I don't see that your changes interfere with my code. The only thing I modify on the page is the dhcp_staticlist_array variable and as far as I can read the code it has not been changed. After I modify that I just call the standard showdhcp_staticlist() function... I don't know how to test it since it is read-only on the router - unless you can direct me to guide of how to temporarily put the new file on the router? |
You could recompile the firmware with your patches applied on top of it. Otherwise, copy the content of /www to your USB disk, edit/add your files there, then bind it on top of the original directory:
The server will then use whatever is stored in that writable copy, until next reboot. |
(But how do I moved this pull request to the master branch and 380.59-beta1 tag?)
Excellent! Have enhanced my code to work with the new file and tested that it works. Have committed the new file here but I don't know how to move it to the right tag (380.59-beta1) - can you do that? And the single added line in Advanced_DHCP_Content.asp must come AFTER the line with /js/jquery.js in the new file. |
Worst case scenario I guess it will create a separate branch, from which I can either merge back on master, or cherry-pick your commits. I'll see if I can find some time to merge and test things out before 380.59 beta2, otherwise I'll schedule it for 380.60. |
Found two issues:
|
Code manually merged inside Advanced_DHCP_Content.asp, currently sitting on the sortdhcp branch. I fixed the toggleable sort order, only issue left is the MAC field sort. |
I purposely didn't implement reverse sorted since I thought I had some kind of issue with (but forgot what) and thought that it wasn't really needed anyway. But if you got it working fine, great. In the latest version it also showed the name field together with the MAC address, that's why I made it toggle between sorting on MAC address and Name field. (That was also a factor that would complicate the UI for doing reverse sorting) But if you want to have reverse sorting instead of being able to sort by the name you need to change this:
to
and then remove all references to |
Thanks, got it working. I decided to go with reversable sort for sake of consistency - everyone expects columns to sort in reverse order when clicking a second time on it. |
Final version of the patch merged with commit 6a8ed67 . |
A completely self-contained solution for adding sorting of the manually assigned IPs on the DHCP page. You can sort by any of the 3 columns: MAC, IP, and Hostname.
Made a clean and modular solution that interfere as little as possible with existing code and is easy to disable in case it becomes incompatible with future versions. Requires jQuery but that seems to already be loaded on the page.
Tested in recent versions of Firefox, Chrome, IE.