From 917da570b0483815e3b455756a3f45947ec66fc6 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 18 Jun 2020 00:56:47 -0700 Subject: [PATCH 1/2] GUACAMOLE-823: Restructure home screen connection groups to match connections. --- .../app/groupList/types/GroupListItem.js | 23 ++++++++++++++++++- .../src/main/webapp/app/home/styles/home.css | 10 ++++++++ .../webapp/app/home/templates/connection.html | 2 +- .../app/home/templates/connectionGroup.html | 14 +++++++---- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js b/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js index 29bf91bd3..2255cb4c9 100644 --- a/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js +++ b/guacamole/src/main/webapp/app/groupList/types/GroupListItem.js @@ -145,7 +145,7 @@ angular.module('groupList').factory('GroupListItem', ['$injector', function defi }); // If the item is a connection group, generate a connection group identifier - if (this.type === GroupListItem.Type.CONNECTION_GROUP) + if (this.type === GroupListItem.Type.CONNECTION_GROUP && this.balancing) return ClientIdentifier.toString({ dataSource : this.dataSource, type : ClientIdentifier.Types.CONNECTION_GROUP, @@ -157,6 +157,27 @@ angular.module('groupList').factory('GroupListItem', ['$injector', function defi }; + /** + * Returns the relative URL of the client page that connects to the + * connection or connection group represented by this GroupListItem. + * + * @returns {String} + * The relative URL of the client page that connects to the + * connection or connection group represented by this GroupListItem, + * or null if this GroupListItem cannot be connected to. + */ + this.getClientURL = template.getClientURL || function getClientURL() { + + // There is a client page for this item only if it has an + // associated client identifier + var identifier = this.getClientIdentifier(); + if (identifier) + return '#/client/' + encodeURIComponent(identifier); + + return null; + + }; + /** * The connection, connection group, or sharing profile whose data is * exposed within this GroupListItem. If the type of this GroupListItem diff --git a/guacamole/src/main/webapp/app/home/styles/home.css b/guacamole/src/main/webapp/app/home/styles/home.css index fb01cac97..3fc79b44e 100644 --- a/guacamole/src/main/webapp/app/home/styles/home.css +++ b/guacamole/src/main/webapp/app/home/styles/home.css @@ -54,3 +54,13 @@ div.recent-connections div.connection { a.home-connection { display: block; } + +/* Show only expand/collapse icon for connection groups on home screen */ + +.all-connections .connection-group > .caption .icon { + display: none; +} + +.all-connections .connection-group > .caption .icon.expand { + display: inline-block; +} diff --git a/guacamole/src/main/webapp/app/home/templates/connection.html b/guacamole/src/main/webapp/app/home/templates/connection.html index b4284126a..85a7f573b 100644 --- a/guacamole/src/main/webapp/app/home/templates/connection.html +++ b/guacamole/src/main/webapp/app/home/templates/connection.html @@ -1,5 +1,5 @@ diff --git a/guacamole/src/main/webapp/app/home/templates/connectionGroup.html b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html index 909aacfd0..ba0a204ba 100644 --- a/guacamole/src/main/webapp/app/home/templates/connectionGroup.html +++ b/guacamole/src/main/webapp/app/home/templates/connectionGroup.html @@ -1,4 +1,10 @@ - - {{item.name}} - {{item.name}} - + + + +
+ + + {{item.name}} + +
From 7db03ba9cb9f4efb6ade04bbaaf913769c4fe219 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 18 Jun 2020 01:20:43 -0700 Subject: [PATCH 2/2] GUACAMOLE-823: Render empty balancing connection groups on home screen as if they are connections. --- .../app/groupList/templates/guacGroupList.html | 1 + .../src/main/webapp/app/home/styles/home.css | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html b/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html index 4c9bb424c..40145c8a0 100644 --- a/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html +++ b/guacamole/src/main/webapp/app/groupList/templates/guacGroupList.html @@ -3,6 +3,7 @@