From e7eb46b2a1b65de435e26d2042f8832cb40808e0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 12 Nov 2018 10:13:32 -0800 Subject: [PATCH] GUACAMOLE-723: Display connection thumbnails for all non-current active connections within the client interface. --- .../client/controllers/clientController.js | 12 ++++ .../app/client/styles/other-connections.css | 72 +++++++++++++++++++ .../webapp/app/client/templates/client.html | 14 +++- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 guacamole/src/main/webapp/app/client/styles/other-connections.css diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 83fac716c..11ded35fc 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -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. + */ + $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 diff --git a/guacamole/src/main/webapp/app/client/styles/other-connections.css b/guacamole/src/main/webapp/app/client/styles/other-connections.css new file mode 100644 index 000000000..4fb6e0596 --- /dev/null +++ b/guacamole/src/main/webapp/app/client/styles/other-connections.css @@ -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; +} diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index 004cd946c..32a64a12a 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -8,9 +8,21 @@