GUACAMOLE-724: Add indicator showing whether a tiled connection is shared.

This commit is contained in:
Michael Jumper
2021-06-27 21:31:02 -07:00
parent 0ea12ca5aa
commit 7d5b6c6898
4 changed files with 31 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
function guacTiledClientsController($scope, $injector, $element) {
// Required types
var ManagedClient = $injector.get('ManagedClient');
var ManagedClientGroup = $injector.get('ManagedClientGroup');
/**
@@ -146,6 +147,21 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
return Math.floor(100 / $scope.clientGroup.rows) + '%';
};
/**
* Returns whether the given ManagedClient has any associated share
* links.
*
* @param {ManagedClient} client
* The ManagedClient to test.
*
* @returns {Boolean}
* true if the given ManagedClient has at least one associated
* share link, false otherwise.
*/
$scope.isShared = function isShared(client) {
return ManagedClient.isShared(client);
};
}];
return directive;

View File

@@ -58,3 +58,12 @@
.tiled-client-list li.client-tile .main {
flex: 1;
}
.tiled-client-list .client-tile-shared-indicator {
display: none;
max-height: 1em;
}
.tiled-client-list .shared .client-tile-shared-indicator {
display: inline;
}

View File

@@ -3,10 +3,13 @@
<li class="client-tile"
ng-repeat="client in clientGroup.clients"
ng-style="{ 'width' : getTileWidth(), 'height' : getTileHeight() }"
ng-class="{ 'focused' : client.clientProperties.focused }"
ng-class="{
'focused' : client.clientProperties.focused,
'shared' : isShared(client)
}"
guac-click="getFocusAssignmentCallback(client)">
<h3>{{ client.title }}</h3>
<h3><img class="client-tile-shared-indicator" src="images/share-white.svg"> {{ client.title }}</h3>
<guac-client client="client" emulate-absolute-mouse="emulateAbsoluteMouse"></guac-client>
<!-- Client-specific status/error dialog -->

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><g transform="matrix(.58084 0 0 .59932 29.139 12.2)"><path d="M-7 4.625v59.25" style="fill:none;fill-rule:evenodd;stroke:#fff;stroke-width:10.16935631;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/><path d="M-5.778 34.144c24.641 7.382 21.575-11.481 31.525-21.51" style="fill:none;fill-rule:evenodd;stroke:#fff;stroke-width:10.16935635;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/><ellipse cy="-1.76" cx="-7.997" style="fill:none;stroke:#fff;stroke-width:8.47446346;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" rx="8.465" ry="8.228"/><ellipse cy="6" cx="27.113" style="fill:none;stroke:#fff;stroke-width:8.47446346;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" rx="8.465" ry="8.228"/><ellipse cy="69.483" cx="-7.256" style="fill:none;stroke:#fff;stroke-width:8.47446346;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" rx="8.465" ry="8.228"/></g></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB