Skip to content

Commit f23b667

Browse files
authored
GUACAMOLE-1896: Merge support for programmatically applying updates to connection parameters.
2 parents 2a76050 + 83d4115 commit f23b667

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

guacamole/src/main/frontend/src/app/client/controllers/clientController.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
486486

487487
});
488488

489+
// Automatically update connection parameters that have been modified
490+
// for the current focused client
491+
$scope.$on('guacClientArgumentsUpdated', function focusedClientChanged(event, focusedClient) {
492+
493+
// Update available connection parameters, if the updated arguments are
494+
// for the current focused client - otherwise ignore them
495+
if ($scope.focusedClient && $scope.focusedClient === focusedClient)
496+
$scope.menu.connectionParameters = focusedClient ?
497+
ManagedClient.getArgumentModel(focusedClient) : {};
498+
499+
});
500+
489501
// Update page icon when thumbnail changes
490502
$scope.$watch('focusedClient.thumbnail.canvas', function thumbnailChanged(canvas) {
491503
iconService.setIcons(canvas);

guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
9292
$scope.$emit('guacClientFocused', focusedClient);
9393
});
9494

95+
// Notify whenever arguments of currently-focused client changes
96+
$scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() {
97+
$scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient());
98+
}, true);
99+
95100
/**
96101
* Returns a callback for guacClick that assigns or updates keyboard
97102
* focus to the given client, allowing that client to receive and

0 commit comments

Comments
 (0)