mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-724: Restore sorting client panel by last used timestamp.
Sorting by last used (rather than relying on internal sorting) ensures that the DOM is only modified as necessary and that CSS animations only affect client groups that are newly visible in the panel.
This commit is contained in:
@@ -307,6 +307,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
if (managedClientGroup) {
|
if (managedClientGroup) {
|
||||||
$scope.clientGroup = managedClientGroup;
|
$scope.clientGroup = managedClientGroup;
|
||||||
$scope.clientGroup.attached = true;
|
$scope.clientGroup.attached = true;
|
||||||
|
$scope.clientGroup.lastUsed = new Date().getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<!-- List of connection thumbnails -->
|
<!-- List of connection thumbnails -->
|
||||||
<ul class="client-panel-connection-list">
|
<ul class="client-panel-connection-list">
|
||||||
<li ng-repeat="clientGroup in clientGroups"
|
<li ng-repeat="clientGroup in clientGroups | orderBy: '-lastUsed'"
|
||||||
ng-if="!clientGroup.attached"
|
ng-if="!clientGroup.attached"
|
||||||
ng-class="{ 'needs-attention' : hasStatusUpdate(clientGroup) }"
|
ng-class="{ 'needs-attention' : hasStatusUpdate(clientGroup) }"
|
||||||
class="client-panel-connection">
|
class="client-panel-connection">
|
||||||
|
@@ -38,6 +38,16 @@ angular.module('client').factory('ManagedClientGroup', ['$injector', function de
|
|||||||
// Use empty object by default
|
// Use empty object by default
|
||||||
template = template || {};
|
template = template || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time that this group 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 group has not yet been
|
||||||
|
* viewed, this will be 0.
|
||||||
|
*
|
||||||
|
* @type Number
|
||||||
|
*/
|
||||||
|
this.lastUsed = template.lastUsed || 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this ManagedClientGroup is currently attached to the client
|
* Whether this ManagedClientGroup is currently attached to the client
|
||||||
* interface (true) or is running in the background (false).
|
* interface (true) or is running in the background (false).
|
||||||
|
Reference in New Issue
Block a user