GUACAMOLE-723: Display connection thumbnails for all non-current active connections within the client interface.

This commit is contained in:
Michael Jumper
2018-11-12 10:13:32 -08:00
parent 57cdd2b483
commit e7eb46b2a1
3 changed files with 97 additions and 1 deletions

View File

@@ -267,6 +267,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
*/
$scope.client = guacClientManager.getManagedClient($routeParams.id, $routeParams.params);
/**
* All active clients which are not the current client ($scope.client).
* Each key is the ID of the connection used by that client.
*
* @type Object.<String, ManagedClient>
*/
$scope.otherClients = (function getOtherClients(clients) {
var otherClients = angular.extend({}, clients);
delete otherClients[$scope.client.id];
return otherClients;
})(guacClientManager.getManagedClients());
/**
* Map of data source identifier to the root connection group of that data
* source, or null if the connection group hierarchy has not yet been

View File

@@ -0,0 +1,72 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#other-connections {
text-align: right;
position: absolute;
right: 0;
bottom: 0;
/* Render above modal status */
z-index: 20;
}
#other-connections .connection {
display: inline-block;
position: relative;
margin: 1em;
border: 1px solid white;
background: black;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
opacity: 0.5;
transition: opacity 0.25s;
width: 192px;
max-width: 30vw;
}
#other-connections .connection .name {
position: absolute;
padding: 0.25em 0.5em;
left: 0;
right: 0;
bottom: 0;
text-align: left;
color: white;
background: rgba(0, 0, 0, 0.5);
font-size: 0.75em;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#other-connections .connection:hover {
opacity: 1;
}

View File

@@ -8,9 +8,21 @@
<!-- Central portion of view -->
<div class="client-body" guac-touch-drag="clientDrag" guac-touch-pinch="clientPinch">
<!-- Client -->
<!-- Client for current connection -->
<guac-client client="client"></guac-client>
<!-- All other active connections -->
<div id="other-connections">
<div ng-repeat="otherClient in otherClients" class="connection">
<a href="#/client/{{otherClient.id}}">
<div class="thumbnail">
<guac-thumbnail client="otherClient"></guac-thumbnail>
</div>
<div class="name">{{ otherClient.title }}</div>
</a>
</div>
</div>
</div>
<!-- Bottom portion of view -->