mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-723: Allow connections to be selected within the Guacamole menu.
This commit is contained in:
@@ -24,22 +24,25 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
function clientController($scope, $routeParams, $injector) {
|
||||
|
||||
// Required types
|
||||
var ConnectionGroup = $injector.get('ConnectionGroup');
|
||||
var ManagedClient = $injector.get('ManagedClient');
|
||||
var ManagedClientState = $injector.get('ManagedClientState');
|
||||
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
||||
var ScrollState = $injector.get('ScrollState');
|
||||
|
||||
// Required services
|
||||
var $location = $injector.get('$location');
|
||||
var authenticationService = $injector.get('authenticationService');
|
||||
var clipboardService = $injector.get('clipboardService');
|
||||
var guacClientManager = $injector.get('guacClientManager');
|
||||
var guacNotification = $injector.get('guacNotification');
|
||||
var iconService = $injector.get('iconService');
|
||||
var preferenceService = $injector.get('preferenceService');
|
||||
var requestService = $injector.get('requestService');
|
||||
var tunnelService = $injector.get('tunnelService');
|
||||
var userPageService = $injector.get('userPageService');
|
||||
var $location = $injector.get('$location');
|
||||
var authenticationService = $injector.get('authenticationService');
|
||||
var connectionGroupService = $injector.get('connectionGroupService');
|
||||
var clipboardService = $injector.get('clipboardService');
|
||||
var dataSourceService = $injector.get('dataSourceService');
|
||||
var guacClientManager = $injector.get('guacClientManager');
|
||||
var guacNotification = $injector.get('guacNotification');
|
||||
var iconService = $injector.get('iconService');
|
||||
var preferenceService = $injector.get('preferenceService');
|
||||
var requestService = $injector.get('requestService');
|
||||
var tunnelService = $injector.get('tunnelService');
|
||||
var userPageService = $injector.get('userPageService');
|
||||
|
||||
/**
|
||||
* The minimum number of pixels a drag gesture must move to result in the
|
||||
@@ -264,6 +267,25 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
*/
|
||||
$scope.client = guacClientManager.getManagedClient($routeParams.id, $routeParams.params);
|
||||
|
||||
/**
|
||||
* Map of data source identifier to the root connection group of that data
|
||||
* source, or null if the connection group hierarchy has not yet been
|
||||
* loaded.
|
||||
*
|
||||
* @type Object.<String, ConnectionGroup>
|
||||
*/
|
||||
$scope.rootConnectionGroups = null;
|
||||
|
||||
// Retrieve root groups and all descendants
|
||||
dataSourceService.apply(
|
||||
connectionGroupService.getConnectionGroupTree,
|
||||
authenticationService.getAvailableDataSources(),
|
||||
ConnectionGroup.ROOT_IDENTIFIER
|
||||
)
|
||||
.then(function rootGroupsRetrieved(rootConnectionGroups) {
|
||||
$scope.rootConnectionGroups = rootConnectionGroups;
|
||||
}, requestService.WARN);
|
||||
|
||||
/**
|
||||
* Map of all available sharing profiles for the current connection by
|
||||
* their identifiers. If this information is not yet available, or no such
|
||||
|
@@ -65,6 +65,24 @@
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
#guac-menu .header h2 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#guac-menu .header h2 .menu-dropdown {
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#guac-menu .header h2 .menu-contents {
|
||||
font-weight: normal;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
#guac-menu .header h2 .menu-contents .all-connections {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#guac-menu #mouse-settings .choice {
|
||||
text-align: center;
|
||||
}
|
||||
|
@@ -47,7 +47,20 @@
|
||||
|
||||
<!-- Stationary header -->
|
||||
<div class="header">
|
||||
<h2>{{client.name}}</h2>
|
||||
<h2 ng-hide="rootConnectionGroups">{{client.name}}</h2>
|
||||
<h2 ng-show="rootConnectionGroups">
|
||||
<guac-menu menu-title="client.name">
|
||||
<div class="all-connections">
|
||||
<guac-group-list
|
||||
connection-groups="rootConnectionGroups"
|
||||
templates="{
|
||||
'connection' : 'app/client/templates/connection.html',
|
||||
'connection-group' : 'app/client/templates/connectionGroup.html'
|
||||
}"
|
||||
page-size="20"></guac-group-list>
|
||||
</div>
|
||||
</guac-menu>
|
||||
</h2>
|
||||
<div class="share-menu" ng-show="canShareConnection()">
|
||||
<guac-menu menu-title="'CLIENT.ACTION_SHARE' | translate">
|
||||
<ul ng-repeat="sharingProfile in sharingProfiles">
|
||||
|
@@ -0,0 +1,4 @@
|
||||
<a class="connection" ng-href="#/client/{{ item.getClientIdentifier() }}">
|
||||
<div class="icon type" ng-class="item.protocol"></div>
|
||||
<span class="name">{{item.name}}</span>
|
||||
</a>
|
@@ -0,0 +1,4 @@
|
||||
<span class="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>
|
Reference in New Issue
Block a user