From dec21e567415bd7495970158c13f5a3bb99bef47 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 18 Feb 2013 12:03:05 -0800 Subject: [PATCH] Ticket #268: Sort connections and users in main UI. --- guacamole/src/main/webapp/scripts/admin-ui.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/admin-ui.js b/guacamole/src/main/webapp/scripts/admin-ui.js index 78cef9340..cc8450a92 100644 --- a/guacamole/src/main/webapp/scripts/admin-ui.js +++ b/guacamole/src/main/webapp/scripts/admin-ui.js @@ -962,6 +962,11 @@ GuacAdmin.reset = function() { GuacAdmin.cached_protocols = GuacamoleService.Protocols.list(); GuacAdmin.cached_connections = GuacamoleService.Connections.list(); + // Sort connections by ID + GuacAdmin.cached_connections.sort(function(a, b) { + return a.id.localeCompare(b.id); + }); + // Connection management if (GuacAdmin.cached_permissions.create_connection || GuacAdmin.hasEntry(GuacAdmin.cached_permissions.update_connection) @@ -1026,6 +1031,8 @@ GuacAdmin.reset = function() { } + var i; + /* * Add readable users. */ @@ -1040,8 +1047,9 @@ GuacAdmin.reset = function() { GuacAdmin.userPager = new GuacAdmin.Pager(GuacAdmin.containers.user_list); // Add users to pager - for (var name in GuacAdmin.cached_permissions.read_user) - GuacAdmin.addUser(name) + var usernames = Object.keys(GuacAdmin.cached_permissions.read_user).sort(); + for (i=0; i