GUACAMOLE-724: Remove unused arbitrary parameters from client route (the webapp tunnel doesn't use these).

This commit is contained in:
Michael Jumper
2021-06-01 17:07:40 -07:00
parent 85d01ba730
commit fbdb692444
4 changed files with 11 additions and 29 deletions

View File

@@ -201,7 +201,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
name : "CLIENT.ACTION_RECONNECT",
className : "reconnect button",
callback : function reconnectCallback() {
$scope.client = guacClientManager.replaceManagedClient($routeParams.id, $routeParams.params);
$scope.client = guacClientManager.replaceManagedClient($routeParams.id);
guacNotification.showStatus(false);
}
};
@@ -287,7 +287,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
var ids = $routeParams.id.split(/[ +]/);
ids.forEach(function addClient(id) {
clients.push(guacClientManager.getManagedClient(id, $routeParams.params));
clients.push(guacClientManager.getManagedClient(id));
});
return clients;

View File

@@ -96,22 +96,17 @@ angular.module('client').factory('guacClientManager', ['$injector',
* @param {String} id
* 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}
* The ManagedClient associated with the connection having the given
* ID.
*/
service.replaceManagedClient = function replaceManagedClient(id, connectionParameters) {
service.replaceManagedClient = function replaceManagedClient(id) {
// Disconnect any existing client
service.removeManagedClient(id);
// 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
* 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}
* The ManagedClient associated with the connection having the given
* ID.
*/
service.getManagedClient = function getManagedClient(id, connectionParameters) {
service.getManagedClient = function getManagedClient(id) {
var managedClients = storedManagedClients();
// Create new managed client if it doesn't already exist
if (!(id in managedClients))
managedClients[id] = ManagedClient.getInstance(id, connectionParameters);
managedClients[id] = ManagedClient.getInstance(id);
// Return existing client
return managedClients[id];

View File

@@ -46,7 +46,6 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
var connectionService = $injector.get('connectionService');
var preferenceService = $injector.get('preferenceService');
var requestService = $injector.get('requestService');
var schemaService = $injector.get('schemaService');
var tunnelService = $injector.get('tunnelService');
var guacAudio = $injector.get('guacAudio');
var guacHistory = $injector.get('guacHistory');
@@ -260,14 +259,11 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
* @param {ClientIdentifier} identifier
* The identifier representing the connection or group to connect to.
*
* @param {String} [connectionParameters]
* Any additional HTTP parameters to pass while connecting.
*
* @returns {Promise.<String>}
* A promise which resolves with the string of connection parameters to
* 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();
@@ -286,8 +282,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
+ "&GUAC_WIDTH=" + Math.floor(optimal_width)
+ "&GUAC_HEIGHT=" + Math.floor(optimal_height)
+ "&GUAC_DPI=" + Math.floor(optimal_dpi)
+ "&GUAC_TIMEZONE=" + encodeURIComponent(preferenceService.preferences.timezone)
+ (connectionParameters ? '&' + connectionParameters : '');
+ "&GUAC_TIMEZONE=" + encodeURIComponent(preferenceService.preferences.timezone);
// Add audio mimetypes to connect string
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
* ClientIdentifier.toString().
*
* @param {String} [connectionParameters]
* Any additional HTTP parameters to pass while connecting.
*
* @returns {ManagedClient}
* A new ManagedClient instance which is connected to the connection or
* connection group having the given ID.
*/
ManagedClient.getInstance = function getInstance(id, connectionParameters) {
ManagedClient.getInstance = function getInstance(id) {
var tunnel;
@@ -628,7 +620,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
var clientIdentifier = ClientIdentifier.fromString(id);
// Connect the Guacamole client
getConnectString(clientIdentifier, connectionParameters)
getConnectString(clientIdentifier)
.then(function connectClient(connectString) {
client.connect(connectString);
});

View File

@@ -181,7 +181,7 @@ angular.module('index').config(['$routeProvider', '$locationProvider',
})
// Client view
.when('/client/:id/:params?', {
.when('/client/:id', {
bodyClassName : 'client',
templateUrl : 'app/client/templates/client.html',
controller : 'clientController',