GUACAMOLE-823: Merge render empty balancing group as if they were connections.

This commit is contained in:
Virtually Nick
2020-06-18 16:18:14 -04:00
committed by GitHub
5 changed files with 56 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
<script type="text/ng-template" id="nestedItem.html">
<div class="{{item.type}}" ng-if="isVisible(item.type)"
ng-class="{
balancer : item.balancing,
expanded : item.expanded,
expandable : item.expandable,
empty : !item.children.length

View File

@@ -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

View File

@@ -51,6 +51,27 @@ div.recent-connections div.connection {
overflow: hidden;
}
a.home-connection {
a.home-connection, .empty.balancer a.home-connection-group {
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;
}
/* ... except for empty balancing groups, which should be rendered as if they
* are connections. */
.all-connections .connection-group.empty.balancer > .caption .icon {
display: inline-block;
}
.all-connections .connection-group.empty.balancer > .caption .icon.expand {
display: none;
}

View File

@@ -1,5 +1,5 @@
<a class="home-connection"
ng-href="#/client/{{ item.getClientIdentifier() }}"
ng-href="{{ item.getClientURL() }}"
ng-class="{active: item.getActiveConnections()}">
<!-- Connection icon -->

View File

@@ -1,4 +1,10 @@
<span class="home-connection-group name">
<a ng-show="item.balancing" ng-href="#/client/{{ item.getClientIdentifier() }}">{{item.name}}</a>
<span ng-show="!item.balancing">{{item.name}}</span>
</span>
<a class="home-connection-group"
ng-href="{{ item.getClientURL() }}">
<!-- Connection group icon -->
<div ng-show="item.balancing" class="icon type balancer"></div>
<!-- Connection group name -->
<span class="name">{{item.name}}</span>
</a>