puppetboard
puppetboard copied to clipboard
Record sort order in URL for auto-refreshing
This is a code snippet that allows the sort order to be controlled via a URL parameter set by clicking on a table header. #314
@mterzo let me know if this is Ok so far. If so I will add a second parameter for ascending vs descending.
Coverage remained the same at 81.76% when pulling 85a957bb47f24a7b92dc5b63249458dec92f07e6 on kirkins:patch-6 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling aa891298971106d0eec5782e6d9a5020b90705a3 on kirkins:patch-6 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
We shouldn’t have to post back to the server on this. I haven’t had a chance to look but most JS sort library’s have a display to show and an actual value. For IPs we just need to conver them to their interfered value.
I’m also looking into the larger scale installations where we are causing too many queries back to PuppetDB. If we don’t have to requery data we already have that would be helpful. Of course if we are paging the results the sort is on the result set not the entire data set.
@mterzo this doesn't post back to the server I'm using an HTML5 feature that lets you update the URL without querying the website.
https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_pushState()_method
Also this isn't related to the IP sorting. It is related to the fact that Puppetboard automatically refreshes every X seconds and forgets which column the user was sorting by.
@mterzo can you please have a look at this?
This works fine for me, but it only records the sort key, not the order (desc or asc).