ui: navigation: sort datastores entries

adding a new one after load will append it still at the end, though.
But datastores are not something which get frequently added after
initial setup, so don't care about that for now..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-25 19:46:43 +02:00
parent 9b1aa424b9
commit 8277f4ace5

View File

@ -89,6 +89,13 @@ Ext.define('PBS.view.main.NavigationTree', {
});
}
// FIXME: newly added always get appended to the end..
records.sort((a, b) => {
if (a.id > b.id) return 1;
if (a.id < b.id) return -1;
return 0;
});
var list = root.findChild('path', 'pbsDataStoreStatus', false);
var length = records.length;
var lookup_hash = {};