Preserve key list sorting setting in Manager
Starting with v1.2.1, keys can be sorted by name or utilized bandwidth. I find the feature very useful for identifying both heavy users and unused keys.
It’d be even nicer to have chosen sorting settings preserved between launches.
@yakovmanshin Thanks for the suggestion!
@alalamav @sandrigo Thoughts?
Seems reasonable to me.
This is a change that would happen on the Manager.
We should have a shared sorting setting, that is applied to all servers, rather than making it per server. There are two parts to the solution: making it a shared setting and persisting it.
Shared Setting
We can define accessKeySortBy and accessKeySortDirection properties at the app-root that gets bound to all servers.
Clicking on the headers would trigger a sorting event to app-root that would update the property, which gets automatically propagated.
The sorting function is called here: https://github.com/Jigsaw-Code/outline-server/blob/166813aa3a473a35f1f542c88e75c0ad15a592b5/src/server_manager/web_app/ui_components/outline-server-view.js#L559
And defined here: https://github.com/Jigsaw-Code/outline-server/blob/166813aa3a473a35f1f542c88e75c0ad15a592b5/src/server_manager/web_app/ui_components/outline-server-view.js#L1020
Persistence
We can persist those properties in local storage and set the app-root properties on start. On sorting changes we should update local storage.