GUACAMOLE-1896: Merge support for programmatically applying updates to connection parameters.

This commit is contained in:
Mike Jumper
2024-01-03 09:43:55 -08:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

@@ -486,6 +486,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}); });
// Automatically update connection parameters that have been modified
// for the current focused client
$scope.$on('guacClientArgumentsUpdated', function focusedClientChanged(event, focusedClient) {
// Update available connection parameters, if the updated arguments are
// for the current focused client - otherwise ignore them
if ($scope.focusedClient && $scope.focusedClient === focusedClient)
$scope.menu.connectionParameters = focusedClient ?
ManagedClient.getArgumentModel(focusedClient) : {};
});
// Update page icon when thumbnail changes // Update page icon when thumbnail changes
$scope.$watch('focusedClient.thumbnail.canvas', function thumbnailChanged(canvas) { $scope.$watch('focusedClient.thumbnail.canvas', function thumbnailChanged(canvas) {
iconService.setIcons(canvas); iconService.setIcons(canvas);

View File

@@ -92,6 +92,11 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
$scope.$emit('guacClientFocused', focusedClient); $scope.$emit('guacClientFocused', focusedClient);
}); });
// Notify whenever arguments of currently-focused client changes
$scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() {
$scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient());
}, true);
/** /**
* Returns a callback for guacClick that assigns or updates keyboard * Returns a callback for guacClick that assigns or updates keyboard
* focus to the given client, allowing that client to receive and * focus to the given client, allowing that client to receive and