mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUACAMOLE-723: Allow connections to be selected within the Guacamole menu.
This commit is contained in:
@@ -24,6 +24,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
function clientController($scope, $routeParams, $injector) {
|
function clientController($scope, $routeParams, $injector) {
|
||||||
|
|
||||||
// Required types
|
// Required types
|
||||||
|
var ConnectionGroup = $injector.get('ConnectionGroup');
|
||||||
var ManagedClient = $injector.get('ManagedClient');
|
var ManagedClient = $injector.get('ManagedClient');
|
||||||
var ManagedClientState = $injector.get('ManagedClientState');
|
var ManagedClientState = $injector.get('ManagedClientState');
|
||||||
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
||||||
@@ -32,7 +33,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
// Required services
|
// Required services
|
||||||
var $location = $injector.get('$location');
|
var $location = $injector.get('$location');
|
||||||
var authenticationService = $injector.get('authenticationService');
|
var authenticationService = $injector.get('authenticationService');
|
||||||
|
var connectionGroupService = $injector.get('connectionGroupService');
|
||||||
var clipboardService = $injector.get('clipboardService');
|
var clipboardService = $injector.get('clipboardService');
|
||||||
|
var dataSourceService = $injector.get('dataSourceService');
|
||||||
var guacClientManager = $injector.get('guacClientManager');
|
var guacClientManager = $injector.get('guacClientManager');
|
||||||
var guacNotification = $injector.get('guacNotification');
|
var guacNotification = $injector.get('guacNotification');
|
||||||
var iconService = $injector.get('iconService');
|
var iconService = $injector.get('iconService');
|
||||||
@@ -264,6 +267,25 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
*/
|
*/
|
||||||
$scope.client = guacClientManager.getManagedClient($routeParams.id, $routeParams.params);
|
$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
|
* Map of all available sharing profiles for the current connection by
|
||||||
* their identifiers. If this information is not yet available, or no such
|
* their identifiers. If this information is not yet available, or no such
|
||||||
|
@@ -65,6 +65,24 @@
|
|||||||
margin-top: 1em;
|
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 {
|
#guac-menu #mouse-settings .choice {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,20 @@
|
|||||||
|
|
||||||
<!-- Stationary header -->
|
<!-- Stationary header -->
|
||||||
<div class="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()">
|
<div class="share-menu" ng-show="canShareConnection()">
|
||||||
<guac-menu menu-title="'CLIENT.ACTION_SHARE' | translate">
|
<guac-menu menu-title="'CLIENT.ACTION_SHARE' | translate">
|
||||||
<ul ng-repeat="sharingProfile in sharingProfiles">
|
<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