mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUAC-932: Allow root group to be shown in group list.
This commit is contained in:
@@ -64,7 +64,16 @@ angular.module('groupList').directive('guacGroupList', [function guacGroupList()
|
|||||||
*
|
*
|
||||||
* @type String
|
* @type String
|
||||||
*/
|
*/
|
||||||
connectionGroupTemplate : '='
|
connectionGroupTemplate : '=',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the root of the connection group hierarchy given should
|
||||||
|
* be shown. If false (the default), only the descendants of the
|
||||||
|
* given connection group will be listed.
|
||||||
|
*
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
|
showRootGroup : '='
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -77,8 +86,24 @@ angular.module('groupList').directive('guacGroupList', [function guacGroupList()
|
|||||||
// Set contents whenever the connection group is assigned or changed
|
// Set contents whenever the connection group is assigned or changed
|
||||||
$scope.$watch("connectionGroup", function setContents(connectionGroup) {
|
$scope.$watch("connectionGroup", function setContents(connectionGroup) {
|
||||||
|
|
||||||
if (connectionGroup)
|
if (connectionGroup) {
|
||||||
$scope.rootItem = GroupListItem.fromConnectionGroup(connectionGroup);
|
|
||||||
|
// Create item hierarchy
|
||||||
|
var rootItem = GroupListItem.fromConnectionGroup(connectionGroup);
|
||||||
|
|
||||||
|
// If root group is to be shown, wrap that group as the child of a fake root group
|
||||||
|
if ($scope.showRootGroup)
|
||||||
|
$scope.rootItem = new GroupListItem({
|
||||||
|
isConnectionGroup : true,
|
||||||
|
isBalancing : false,
|
||||||
|
children : [ rootItem ]
|
||||||
|
});
|
||||||
|
|
||||||
|
// If not wrapped, only the descendants of the root will be shown
|
||||||
|
else
|
||||||
|
$scope.rootItem = rootItem;
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$scope.rootItem = null;
|
$scope.rootItem = null;
|
||||||
|
|
||||||
@@ -92,7 +117,7 @@ angular.module('groupList').directive('guacGroupList', [function guacGroupList()
|
|||||||
* connection group.
|
* connection group.
|
||||||
*/
|
*/
|
||||||
$scope.toggleExpanded = function toggleExpanded(groupListItem) {
|
$scope.toggleExpanded = function toggleExpanded(groupListItem) {
|
||||||
groupListItem.expanded = !groupListItem.expanded;
|
groupListItem.isExpanded = !groupListItem.isExpanded;
|
||||||
};
|
};
|
||||||
|
|
||||||
}]
|
}]
|
||||||
|
Reference in New Issue
Block a user