outline-apps icon indicating copy to clipboard operation
outline-apps copied to clipboard

Preserve key list sorting setting in Manager

Open yakovmanshin opened this issue 7 years ago • 3 comments

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 avatar Dec 06 '18 19:12 yakovmanshin

@yakovmanshin Thanks for the suggestion!

@alalamav @sandrigo Thoughts?

trevj avatar Dec 07 '18 15:12 trevj

Seems reasonable to me.

trevj avatar Jan 08 '19 13:01 trevj

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.

fortuna avatar Sep 20 '21 14:09 fortuna