mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
GUACAMOLE-723: Sort connections in panel by last use.
This commit is contained in:
@@ -492,6 +492,12 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Update last used timestamp when the active client changes
|
||||||
|
$scope.$watch('client', function clientChanged(client) {
|
||||||
|
if (client)
|
||||||
|
client.lastUsed = new Date().getTime();
|
||||||
|
});
|
||||||
|
|
||||||
// Update page icon when thumbnail changes
|
// Update page icon when thumbnail changes
|
||||||
$scope.$watch('client.thumbnail.canvas', function thumbnailChanged(canvas) {
|
$scope.$watch('client.thumbnail.canvas', function thumbnailChanged(canvas) {
|
||||||
iconService.setIcons(canvas);
|
iconService.setIcons(canvas);
|
||||||
|
@@ -6,12 +6,12 @@
|
|||||||
|
|
||||||
<!-- List of connection thumbnails -->
|
<!-- List of connection thumbnails -->
|
||||||
<ul class="client-panel-connection-list">
|
<ul class="client-panel-connection-list">
|
||||||
<li ng-repeat="client in clients" class="client-panel-connection">
|
<li ng-repeat="client in clients | toArray | orderBy: [ '-value.lastUsed', 'value.title' ]" class="client-panel-connection">
|
||||||
<a href="#/client/{{client.id}}">
|
<a href="#/client/{{client.value.id}}">
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<guac-thumbnail client="client"></guac-thumbnail>
|
<guac-thumbnail client="client.value"></guac-thumbnail>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">{{ client.title }}</div>
|
<div class="name">{{ client.value.title }}</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -79,6 +79,16 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
|||||||
*/
|
*/
|
||||||
this.id = template.id;
|
this.id = template.id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that the connection was last brought to the foreground of
|
||||||
|
* the current tab, as the number of milliseconds elapsed since
|
||||||
|
* midnight of January 1, 1970 UTC. If the connection has not yet been
|
||||||
|
* viewed, this will be 0.
|
||||||
|
*
|
||||||
|
* @type Number
|
||||||
|
*/
|
||||||
|
this.lastUsed = template.lastUsed || 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actual underlying Guacamole client.
|
* The actual underlying Guacamole client.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user