diff --git a/guacamole/src/main/webapp/scripts/admin-ui.js b/guacamole/src/main/webapp/scripts/admin-ui.js index a5ba46c78..5c1dbe663 100644 --- a/guacamole/src/main/webapp/scripts/admin-ui.js +++ b/guacamole/src/main/webapp/scripts/admin-ui.js @@ -497,7 +497,8 @@ GuacAdmin.UserEditor = function(name, parameters) { var connections_section = GuacUI.createChildElement(sections, "dd"); // Construct group view for all readable connections - var group_view = new GuacUI.GroupView(GuacAdmin.cached_root_group, true); + var group_view = new GuacUI.GroupView(GuacAdmin.cached_root_group, + GuacUI.GroupView.SHOW_CONNECTIONS | GuacUI.GroupView.MULTISELECT); connections_section.appendChild(group_view.getElement()); // Update connection permissions when changed @@ -1231,7 +1232,7 @@ GuacAdmin.reset = function() { // Add new group view GuacAdmin.containers.connection_list.innerHTML = ""; - var group_view = new GuacUI.GroupView(GuacAdmin.cached_root_group, false); + var group_view = new GuacUI.GroupView(GuacAdmin.cached_root_group, GuacUI.GroupView.SHOW_CONNECTIONS); GuacAdmin.containers.connection_list.appendChild(group_view.getElement()); // Show connection editor when connections are clicked diff --git a/guacamole/src/main/webapp/scripts/guac-ui.js b/guacamole/src/main/webapp/scripts/guac-ui.js index fcfc7d0ab..c9df919a9 100644 --- a/guacamole/src/main/webapp/scripts/guac-ui.js +++ b/guacamole/src/main/webapp/scripts/guac-ui.js @@ -912,9 +912,10 @@ GuacUI.ListGroup = function(caption) { * @constructor * @param {GuacamoleService.ConnectionGroup} root_group The group to display * within the view. - * @param {Boolean} multiselect Whether multiple objects are selectable. + * @param {Number} flags Any flags (such as MULTISELECT or SHOW_CONNECTIONS) + * for modifying the behavior of this group view. */ -GuacUI.GroupView = function(root_group, multiselect) { +GuacUI.GroupView = function(root_group, flags) { /** * Reference to this GroupView. @@ -926,6 +927,16 @@ GuacUI.GroupView = function(root_group, multiselect) { var element = GuacUI.createElement("div", "group-view"); var list = GuacUI.createChildElement(element, "div", "list"); + /** + * Whether multiselect is enabled. + */ + var multiselect = flags & GuacUI.GroupView.MULTISELECT; + + /** + * Whether connections should be included in the view. + */ + var show_connections = flags & GuacUI.GroupView.SHOW_CONNECTIONS; + /** * Set of all group checkboxes, indexed by ID. Only applicable when * multiselect is enabled. @@ -1102,59 +1113,61 @@ GuacUI.GroupView = function(root_group, multiselect) { group_view.groups[group.id] = group; // Add all contained connections - for (i=0; i