From 8277f4ace540f07fdf45e3749d1dbad6ae15c8f5 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 25 May 2020 19:46:43 +0200 Subject: [PATCH] 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 --- www/NavigationTree.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/NavigationTree.js b/www/NavigationTree.js index 1feedf10..9a653fcf 100644 --- a/www/NavigationTree.js +++ b/www/NavigationTree.js @@ -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 = {};