diff --git a/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js b/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js
index f472090d5..3591dd0ce 100644
--- a/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js
+++ b/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js
@@ -77,43 +77,36 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
this.children = template.children || [];
/**
- * Whether this item represents a connection. If this item represents
- * a connection group or sharing profile, this MUST be false.
+ * The type of object represented by this GroupListItem. Standard types
+ * are defined by GroupListItem.Type, but custom types are also legal.
*
- * @type Boolean
+ * @type String
*/
- this.isConnection = template.isConnection;
+ this.type = template.type;
/**
- * Whether this item represents a connection group. If this item
- * represents a connection or sharing profile, this MUST be false.
+ * Whether this item, or items of the same type, can contain children.
+ * This may be true even if this particular item does not presently
+ * contain children.
*
* @type Boolean
*/
- this.isConnectionGroup = template.isConnectionGroup;
-
- /**
- * Whether this item represents a sharing profile. If this item
- * represents a connection or connection group, this MUST be false.
- *
- * @type Boolean
- */
- this.isSharingProfile = template.isSharingProfile;
+ this.expandable = template.expandable;
/**
* Whether this item represents a balancing connection group.
*
* @type Boolean
*/
- this.isBalancing = template.isBalancing;
+ this.balancing = template.balancing;
/**
* Whether the children items should be displayed.
*
* @type Boolean
*/
- this.isExpanded = template.isExpanded;
-
+ this.expanded = template.expanded;
+
/**
* Returns the number of currently active users for this connection,
* connection group, or sharing profile, if known.
@@ -126,9 +119,11 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
/**
* The connection, connection group, or sharing profile whose data is
- * exposed within this GroupListItem.
+ * exposed within this GroupListItem. If the type of this GroupListItem
+ * is not one of the types defined by GroupListItem.Type, then this
+ * value may be anything.
*
- * @type Connection|ConnectionGroup|SharingProfile
+ * @type Connection|ConnectionGroup|SharingProfile|*
*/
this.wrappedItem = template.wrappedItem;
@@ -192,9 +187,8 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
dataSource : dataSource,
// Type information
- isConnection : true,
- isConnectionGroup : false,
- isSharingProfile : false,
+ expandable : includeSharingProfiles,
+ type : GroupListItem.Type.CONNECTION,
// Already-converted children
children : children,
@@ -287,10 +281,9 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
dataSource : dataSource,
// Type information
- isConnection : false,
- isConnectionGroup : true,
- isSharingProfile : false,
- isBalancing : connectionGroup.type === ConnectionGroup.Type.BALANCING,
+ type : GroupListItem.Type.CONNECTION_GROUP,
+ balancing : connectionGroup.type === ConnectionGroup.Type.BALANCING,
+ expandable : true,
// Already-converted children
children : children,
@@ -341,9 +334,7 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
dataSource : dataSource,
// Type information
- isConnection : false,
- isConnectionGroup : false,
- isSharingProfile : true,
+ type : GroupListItem.Type.SHARING_PROFILE,
// Wrapped item
wrappedItem : sharingProfile
@@ -352,6 +343,42 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
};
+ /**
+ * All pre-defined types of GroupListItems. Note that, while these are the
+ * standard types supported by GroupListItem and the related guacGroupList
+ * directive, the type string is otherwise arbitrary and custom types are
+ * legal.
+ *
+ * @type Object.
+ */
+ GroupListItem.Type = {
+
+ /**
+ * The standard type string of a GroupListItem which represents a
+ * connection.
+ *
+ * @type String
+ */
+ CONNECTION : 'connection',
+
+ /**
+ * The standard type string of a GroupListItem which represents a
+ * connection group.
+ *
+ * @type String
+ */
+ CONNECTION_GROUP : 'connection-group',
+
+ /**
+ * The standard type string of a GroupListItem which represents a
+ * sharing profile.
+ *
+ * @type String
+ */
+ SHARING_PROFILE : 'sharing-profile'
+
+ };
+
return GroupListItem;
}]);
diff --git a/guacamole/src/main/webapp/app/home/controllers/homeController.js b/guacamole/src/main/webapp/app/home/controllers/homeController.js
index aff81ae83..150ac4ead 100644
--- a/guacamole/src/main/webapp/app/home/controllers/homeController.js
+++ b/guacamole/src/main/webapp/app/home/controllers/homeController.js
@@ -26,6 +26,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
// Get required types
var ConnectionGroup = $injector.get('ConnectionGroup');
var ClientIdentifier = $injector.get('ClientIdentifier');
+ var GroupListItem = $injector.get('GroupListItem');
// Get required services
var authenticationService = $injector.get('authenticationService');
@@ -95,15 +96,15 @@ angular.module('home').controller('homeController', ['$scope', '$injector',
getClientIdentifier : function getClientIdentifier(item) {
// If the item is a connection, generate a connection identifier
- if (item.isConnection)
+ if (item.type === GroupListItem.Type.CONNECTION)
return ClientIdentifier.toString({
dataSource : item.dataSource,
type : ClientIdentifier.Types.CONNECTION,
id : item.identifier
});
- // If the item is a connection, generate a connection group identifier
- if (item.isConnectionGroup)
+ // If the item is a connection group, generate a connection group identifier
+ if (item.type === GroupListItem.Type.CONNECTION_GROUP)
return ClientIdentifier.toString({
dataSource : item.dataSource,
type : ClientIdentifier.Types.CONNECTION_GROUP,
diff --git a/guacamole/src/main/webapp/app/home/templates/connectionGroup.html b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html
index 1fe151570..7356883c2 100644
--- a/guacamole/src/main/webapp/app/home/templates/connectionGroup.html
+++ b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html
@@ -1,5 +1,4 @@
-
- {{item.name}}
- {{item.name}}
+ {{item.name}}
+ {{item.name}}
diff --git a/guacamole/src/main/webapp/app/home/templates/home.html b/guacamole/src/main/webapp/app/home/templates/home.html
index 727194520..f68a0a9f9 100644
--- a/guacamole/src/main/webapp/app/home/templates/home.html
+++ b/guacamole/src/main/webapp/app/home/templates/home.html
@@ -25,8 +25,10 @@
diff --git a/guacamole/src/main/webapp/app/index/styles/lists.css b/guacamole/src/main/webapp/app/index/styles/lists.css
index 5ce162a13..0c761aef3 100644
--- a/guacamole/src/main/webapp/app/index/styles/lists.css
+++ b/guacamole/src/main/webapp/app/index/styles/lists.css
@@ -18,28 +18,28 @@
*/
.user,
-.group,
+.connection-group,
.connection {
cursor: pointer;
}
.user a,
.connection a,
-.group a {
+.connection-group a {
text-decoration:none;
color: black;
}
.user a:hover,
.connection a:hover,
-.group a:hover {
+.connection-group a:hover {
text-decoration:none;
color: black;
}
.user a:visited,
.connection a:visited,
-.group a:visited {
+.connection-group a:visited {
text-decoration:none;
color: black;
}
diff --git a/guacamole/src/main/webapp/app/index/styles/ui.css b/guacamole/src/main/webapp/app/index/styles/ui.css
index 62db41fb5..434f443f6 100644
--- a/guacamole/src/main/webapp/app/index/styles/ui.css
+++ b/guacamole/src/main/webapp/app/index/styles/ui.css
@@ -178,11 +178,11 @@ div.section {
background-position: center center;
}
-.group > .caption .icon {
+.connection-group > .caption .icon {
background-image: url('images/folder-closed.png');
}
-.group.expanded > .caption .icon {
+.connection-group.expanded > .caption .icon {
background-image: url('images/folder-open.png');
}
@@ -213,7 +213,7 @@ div.section {
padding-left: 13px;
}
-.group.empty.balancer .icon {
+.connection-group.empty.balancer .icon {
background-image: url('images/protocol-icons/guac-monitor.png');
}
diff --git a/guacamole/src/main/webapp/app/manage/templates/locationChooser.html b/guacamole/src/main/webapp/app/manage/templates/locationChooser.html
index 57c957e5a..baeebded9 100644
--- a/guacamole/src/main/webapp/app/manage/templates/locationChooser.html
+++ b/guacamole/src/main/webapp/app/manage/templates/locationChooser.html
@@ -9,7 +9,9 @@
context="groupListContext"
show-root-group="true"
connection-groups="rootGroups"
- connection-group-template="'app/manage/templates/locationChooserConnectionGroup.html'"/>
+ templates="{
+ 'connection-group' : 'app/manage/templates/locationChooserConnectionGroup.html'
+ }"/>
diff --git a/guacamole/src/main/webapp/app/manage/templates/manageUser.html b/guacamole/src/main/webapp/app/manage/templates/manageUser.html
index 82bc1e978..e32d725ae 100644
--- a/guacamole/src/main/webapp/app/manage/templates/manageUser.html
+++ b/guacamole/src/main/webapp/app/manage/templates/manageUser.html
@@ -78,9 +78,11 @@