{{'CLIENT.INFO_CONNECTION_SHARED' | translate}}
+ +{{link.name}} | +{{link.href}} | +
---|
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index d2f9d2623..b522568b7 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -28,7 +28,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams var ManagedClientState = $injector.get('ManagedClientState'); var ManagedFilesystem = $injector.get('ManagedFilesystem'); var ScrollState = $injector.get('ScrollState'); - var UserCredentials = $injector.get('UserCredentials'); // Required services var $location = $injector.get('$location'); @@ -435,26 +434,42 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams /** * Produces a sharing link for the current connection using the given * sharing profile. The resulting sharing link, and any required login - * information, will be displayed to the user once the various underlying - * service calls succeed. + * information, will be displayed to the user within the Guacamole menu. * * @param {SharingProfile} sharingProfile * The sharing profile to use to generate the sharing link. */ $scope.share = function share(sharingProfile) { + ManagedClient.createShareLink($scope.client, sharingProfile); + }; - // Retrieve sharing credentials for the sake of generating a share link - tunnelService.getSharingCredentials($scope.client.tunnel.uuid, sharingProfile.identifier) - .success(function sharingCredentialsReceived(sharingCredentials) { + /** + * Returns whether the current connection has any associated share links. + * + * @returns {Boolean} + * true if the current connection has at least one associated share + * link, false otherwise. + */ + $scope.isShared = function isShared() { + return ManagedClient.isShared($scope.client); + }; - // TODONT: COMPLETE HACK: Shove the share link into the clipboard - var href = UserCredentials.getLink(sharingCredentials); - $scope.client.clipboardData = { - 'type' : 'text/plain', - 'data' : href - }; + /** + * Returns the total number of share links associated with the current + * connection. + * + * @returns {Number} + * The total number of share links associated with the current + * connection. + */ + $scope.getShareLinkCount = function getShareLinkCount() { - }); + // Count total number of links within the ManagedClient's share link map + var linkCount = 0; + for (var dummy in $scope.client.shareLinks) + linkCount++; + + return linkCount; }; diff --git a/guacamole/src/main/webapp/app/client/styles/guac-menu.css b/guacamole/src/main/webapp/app/client/styles/guac-menu.css index bc96eb922..9e0fb7ca7 100644 --- a/guacamole/src/main/webapp/app/client/styles/guac-menu.css +++ b/guacamole/src/main/webapp/app/client/styles/guac-menu.css @@ -171,3 +171,31 @@ #guac-menu #devices .device.filesystem { background-image: url('images/drive.png'); } + +#guac-menu #share-links { + + padding: 1em; + border: 1px solid rgba(0, 0, 0, 0.125); + background: rgba(0, 0, 0, 0.04); + + font-size: 0.8em; + +} + +#guac-menu #share-links h3 { + padding-bottom: 0; +} + +#guac-menu #share-links th { + white-space: nowrap; +} + +#guac-menu #share-links a[href] { + + display: block; + padding: 0 1em; + + font-family: monospace; + font-weight: bold; + +} diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index 2214d5882..0580c8bbb 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -44,7 +44,7 @@