GUACAMOLE-1896: Add a new guacClientArgumentsUpdated event instead of abusing guacClientFocused.

This commit is contained in:
James Muehlner
2024-01-02 23:27:04 +00:00
parent 176eec6fd8
commit 83d4115727
2 changed files with 13 additions and 1 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

@@ -94,7 +94,7 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
// Notify whenever arguments of currently-focused client changes // Notify whenever arguments of currently-focused client changes
$scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() { $scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() {
$scope.$emit('guacClientFocused', $scope.getFocusedClient()); $scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient());
}, true); }, true);
/** /**