From 3d71f84f0aea2f4c3b3b3d21b949df3417667d26 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 23 Jun 2019 12:46:04 -0700 Subject: [PATCH] GUACAMOLE-723: Display connection selection menu only if multiple choices are available. --- .../app/client/controllers/clientController.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 5ee084b6e..f78791845 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -280,9 +280,12 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams })(guacClientManager.getManagedClients()); /** - * Map of data source identifier to the root connection group of that data - * source, or null if the connection group hierarchy has not yet been - * loaded. + * The root connection groups of the connection hierarchy that should be + * presented to the user for selecting a different connection, as a map of + * data source identifier to the root connection group of that data + * source. This will be null if the connection group hierarchy has not yet + * been loaded or if the hierarchy is inapplicable due to only one + * connection or balancing group being available. * * @type Object. */ @@ -313,7 +316,13 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams ConnectionGroup.ROOT_IDENTIFIER ) .then(function rootGroupsRetrieved(rootConnectionGroups) { - $scope.rootConnectionGroups = rootConnectionGroups; + + // Store retrieved groups only if there are multiple connections or + // balancing groups available + var clientPages = userPageService.getClientPages(rootConnectionGroups); + if (clientPages.length > 1) + $scope.rootConnectionGroups = rootConnectionGroups; + }, requestService.WARN); /**