mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +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
|
||||
$scope.$watch('client.thumbnail.canvas', function thumbnailChanged(canvas) {
|
||||
iconService.setIcons(canvas);
|
||||
|
@@ -6,12 +6,12 @@
|
||||
|
||||
<!-- List of connection thumbnails -->
|
||||
<ul class="client-panel-connection-list">
|
||||
<li ng-repeat="client in clients" class="client-panel-connection">
|
||||
<a href="#/client/{{client.id}}">
|
||||
<li ng-repeat="client in clients | toArray | orderBy: [ '-value.lastUsed', 'value.title' ]" class="client-panel-connection">
|
||||
<a href="#/client/{{client.value.id}}">
|
||||
<div class="thumbnail">
|
||||
<guac-thumbnail client="client"></guac-thumbnail>
|
||||
<guac-thumbnail client="client.value"></guac-thumbnail>
|
||||
</div>
|
||||
<div class="name">{{ client.title }}</div>
|
||||
<div class="name">{{ client.value.title }}</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -79,6 +79,16 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user