mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-11 15:37:41 +00:00
GUACAMOLE-5: Generalize and clean the guacGroupList directive such that arbitrary GroupListItem types can be supported.
This commit is contained in:
@@ -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,
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<span class="name">
|
||||
|
||||
<a ng-show="item.isBalancing" ng-href="#/client/{{context.getClientIdentifier(item)}}">{{item.name}}</a>
|
||||
<span ng-show="!item.isBalancing">{{item.name}}</span>
|
||||
<a ng-show="item.balancing" ng-href="#/client/{{context.getClientIdentifier(item)}}">{{item.name}}</a>
|
||||
<span ng-show="!item.balancing">{{item.name}}</span>
|
||||
</span>
|
||||
|
@@ -25,8 +25,10 @@
|
||||
<guac-group-list
|
||||
context="context"
|
||||
connection-groups="filteredRootConnectionGroups"
|
||||
connection-template="'app/home/templates/connection.html'"
|
||||
connection-group-template="'app/home/templates/connectionGroup.html'"
|
||||
templates="{
|
||||
'connection' : 'app/home/templates/connection.html',
|
||||
'connection-group' : 'app/home/templates/connectionGroup.html'
|
||||
}"
|
||||
page-size="20"></guac-group-list>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user