mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-724: Remove unused arbitrary parameters from client route (the webapp tunnel doesn't use these).
This commit is contained in:
@@ -201,7 +201,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
name : "CLIENT.ACTION_RECONNECT",
|
name : "CLIENT.ACTION_RECONNECT",
|
||||||
className : "reconnect button",
|
className : "reconnect button",
|
||||||
callback : function reconnectCallback() {
|
callback : function reconnectCallback() {
|
||||||
$scope.client = guacClientManager.replaceManagedClient($routeParams.id, $routeParams.params);
|
$scope.client = guacClientManager.replaceManagedClient($routeParams.id);
|
||||||
guacNotification.showStatus(false);
|
guacNotification.showStatus(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -287,7 +287,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
|
|
||||||
var ids = $routeParams.id.split(/[ +]/);
|
var ids = $routeParams.id.split(/[ +]/);
|
||||||
ids.forEach(function addClient(id) {
|
ids.forEach(function addClient(id) {
|
||||||
clients.push(guacClientManager.getManagedClient(id, $routeParams.params));
|
clients.push(guacClientManager.getManagedClient(id));
|
||||||
});
|
});
|
||||||
|
|
||||||
return clients;
|
return clients;
|
||||||
|
@@ -96,22 +96,17 @@ angular.module('client').factory('guacClientManager', ['$injector',
|
|||||||
* @param {String} id
|
* @param {String} id
|
||||||
* The ID of the connection whose ManagedClient should be retrieved.
|
* The ID of the connection whose ManagedClient should be retrieved.
|
||||||
*
|
*
|
||||||
* @param {String} [connectionParameters]
|
|
||||||
* Any additional HTTP parameters to pass while connecting. This
|
|
||||||
* parameter only has an effect if a new connection is established as
|
|
||||||
* a result of this function call.
|
|
||||||
*
|
|
||||||
* @returns {ManagedClient}
|
* @returns {ManagedClient}
|
||||||
* The ManagedClient associated with the connection having the given
|
* The ManagedClient associated with the connection having the given
|
||||||
* ID.
|
* ID.
|
||||||
*/
|
*/
|
||||||
service.replaceManagedClient = function replaceManagedClient(id, connectionParameters) {
|
service.replaceManagedClient = function replaceManagedClient(id) {
|
||||||
|
|
||||||
// Disconnect any existing client
|
// Disconnect any existing client
|
||||||
service.removeManagedClient(id);
|
service.removeManagedClient(id);
|
||||||
|
|
||||||
// Set new client
|
// Set new client
|
||||||
return storedManagedClients()[id] = ManagedClient.getInstance(id, connectionParameters);
|
return storedManagedClients()[id] = ManagedClient.getInstance(id);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -123,22 +118,17 @@ angular.module('client').factory('guacClientManager', ['$injector',
|
|||||||
* @param {String} id
|
* @param {String} id
|
||||||
* The ID of the connection whose ManagedClient should be retrieved.
|
* The ID of the connection whose ManagedClient should be retrieved.
|
||||||
*
|
*
|
||||||
* @param {String} [connectionParameters]
|
|
||||||
* Any additional HTTP parameters to pass while connecting. This
|
|
||||||
* parameter only has an effect if a new connection is established as
|
|
||||||
* a result of this function call.
|
|
||||||
*
|
|
||||||
* @returns {ManagedClient}
|
* @returns {ManagedClient}
|
||||||
* The ManagedClient associated with the connection having the given
|
* The ManagedClient associated with the connection having the given
|
||||||
* ID.
|
* ID.
|
||||||
*/
|
*/
|
||||||
service.getManagedClient = function getManagedClient(id, connectionParameters) {
|
service.getManagedClient = function getManagedClient(id) {
|
||||||
|
|
||||||
var managedClients = storedManagedClients();
|
var managedClients = storedManagedClients();
|
||||||
|
|
||||||
// Create new managed client if it doesn't already exist
|
// Create new managed client if it doesn't already exist
|
||||||
if (!(id in managedClients))
|
if (!(id in managedClients))
|
||||||
managedClients[id] = ManagedClient.getInstance(id, connectionParameters);
|
managedClients[id] = ManagedClient.getInstance(id);
|
||||||
|
|
||||||
// Return existing client
|
// Return existing client
|
||||||
return managedClients[id];
|
return managedClients[id];
|
||||||
|
@@ -46,7 +46,6 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
var connectionService = $injector.get('connectionService');
|
var connectionService = $injector.get('connectionService');
|
||||||
var preferenceService = $injector.get('preferenceService');
|
var preferenceService = $injector.get('preferenceService');
|
||||||
var requestService = $injector.get('requestService');
|
var requestService = $injector.get('requestService');
|
||||||
var schemaService = $injector.get('schemaService');
|
|
||||||
var tunnelService = $injector.get('tunnelService');
|
var tunnelService = $injector.get('tunnelService');
|
||||||
var guacAudio = $injector.get('guacAudio');
|
var guacAudio = $injector.get('guacAudio');
|
||||||
var guacHistory = $injector.get('guacHistory');
|
var guacHistory = $injector.get('guacHistory');
|
||||||
@@ -260,14 +259,11 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
* @param {ClientIdentifier} identifier
|
* @param {ClientIdentifier} identifier
|
||||||
* The identifier representing the connection or group to connect to.
|
* The identifier representing the connection or group to connect to.
|
||||||
*
|
*
|
||||||
* @param {String} [connectionParameters]
|
|
||||||
* Any additional HTTP parameters to pass while connecting.
|
|
||||||
*
|
|
||||||
* @returns {Promise.<String>}
|
* @returns {Promise.<String>}
|
||||||
* A promise which resolves with the string of connection parameters to
|
* A promise which resolves with the string of connection parameters to
|
||||||
* be passed to the Guacamole client, once the string is ready.
|
* be passed to the Guacamole client, once the string is ready.
|
||||||
*/
|
*/
|
||||||
var getConnectString = function getConnectString(identifier, connectionParameters) {
|
var getConnectString = function getConnectString(identifier) {
|
||||||
|
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
|
|
||||||
@@ -286,8 +282,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
+ "&GUAC_WIDTH=" + Math.floor(optimal_width)
|
+ "&GUAC_WIDTH=" + Math.floor(optimal_width)
|
||||||
+ "&GUAC_HEIGHT=" + Math.floor(optimal_height)
|
+ "&GUAC_HEIGHT=" + Math.floor(optimal_height)
|
||||||
+ "&GUAC_DPI=" + Math.floor(optimal_dpi)
|
+ "&GUAC_DPI=" + Math.floor(optimal_dpi)
|
||||||
+ "&GUAC_TIMEZONE=" + encodeURIComponent(preferenceService.preferences.timezone)
|
+ "&GUAC_TIMEZONE=" + encodeURIComponent(preferenceService.preferences.timezone);
|
||||||
+ (connectionParameters ? '&' + connectionParameters : '');
|
|
||||||
|
|
||||||
// Add audio mimetypes to connect string
|
// Add audio mimetypes to connect string
|
||||||
guacAudio.supported.forEach(function(mimetype) {
|
guacAudio.supported.forEach(function(mimetype) {
|
||||||
@@ -355,14 +350,11 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
* a valid ClientIdentifier string, as would be generated by
|
* a valid ClientIdentifier string, as would be generated by
|
||||||
* ClientIdentifier.toString().
|
* ClientIdentifier.toString().
|
||||||
*
|
*
|
||||||
* @param {String} [connectionParameters]
|
|
||||||
* Any additional HTTP parameters to pass while connecting.
|
|
||||||
*
|
|
||||||
* @returns {ManagedClient}
|
* @returns {ManagedClient}
|
||||||
* A new ManagedClient instance which is connected to the connection or
|
* A new ManagedClient instance which is connected to the connection or
|
||||||
* connection group having the given ID.
|
* connection group having the given ID.
|
||||||
*/
|
*/
|
||||||
ManagedClient.getInstance = function getInstance(id, connectionParameters) {
|
ManagedClient.getInstance = function getInstance(id) {
|
||||||
|
|
||||||
var tunnel;
|
var tunnel;
|
||||||
|
|
||||||
@@ -628,7 +620,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
var clientIdentifier = ClientIdentifier.fromString(id);
|
var clientIdentifier = ClientIdentifier.fromString(id);
|
||||||
|
|
||||||
// Connect the Guacamole client
|
// Connect the Guacamole client
|
||||||
getConnectString(clientIdentifier, connectionParameters)
|
getConnectString(clientIdentifier)
|
||||||
.then(function connectClient(connectString) {
|
.then(function connectClient(connectString) {
|
||||||
client.connect(connectString);
|
client.connect(connectString);
|
||||||
});
|
});
|
||||||
|
@@ -181,7 +181,7 @@ angular.module('index').config(['$routeProvider', '$locationProvider',
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Client view
|
// Client view
|
||||||
.when('/client/:id/:params?', {
|
.when('/client/:id', {
|
||||||
bodyClassName : 'client',
|
bodyClassName : 'client',
|
||||||
templateUrl : 'app/client/templates/client.html',
|
templateUrl : 'app/client/templates/client.html',
|
||||||
controller : 'clientController',
|
controller : 'clientController',
|
||||||
|
Reference in New Issue
Block a user