diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js index 9d5914910..fda9e28a3 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageConnectionController.js @@ -35,6 +35,7 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i // Required services var $location = $injector.get('$location'); var $routeParams = $injector.get('$routeParams'); + var $translate = $injector.get('$translate'); var authenticationService = $injector.get('authenticationService'); var guacNotification = $injector.get('guacNotification'); var connectionService = $injector.get('connectionService'); @@ -100,6 +101,13 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i */ $scope.parameters = null; + /** + * The date format for use within the connection history. + * + * @type String + */ + $scope.historyDateFormat = null; + /** * The usage history of the connection being modified. * @@ -150,6 +158,7 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i && $scope.rootGroup !== null && $scope.connection !== null && $scope.parameters !== null + && $scope.historyDateFormat !== null && $scope.historyEntryWrappers !== null && $scope.permissions !== null && $scope.canSaveConnection !== null @@ -199,7 +208,12 @@ angular.module('manage').controller('manageConnectionController', ['$scope', '$i protocolService.getProtocols().success(function protocolsReceived(protocols) { $scope.protocols = protocols; }); - + + // Get history date format + $translate('MANAGE_CONNECTION.FORMAT_HISTORY_START').then(function historyDateFormatReceived(historyDateFormat) { + $scope.historyDateFormat = historyDateFormat; + }); + // If we are editing an existing connection, pull its data if (identifier) { diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js b/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js index ac56335d8..f89f19a32 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js @@ -32,6 +32,8 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj var SortOrder = $injector.get('SortOrder'); // Required services + var $filter = $injector.get('$filter'); + var $translate = $injector.get('$translate'); var activeConnectionService = $injector.get('activeConnectionService'); var authenticationService = $injector.get('authenticationService'); var connectionGroupService = $injector.get('connectionGroupService'); @@ -62,7 +64,7 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj */ $scope.wrapperOrder = new SortOrder([ 'activeConnection.username', - 'activeConnection.startDate', + 'startDate', 'activeConnection.remoteHost', 'name' ]); @@ -74,6 +76,7 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj */ $scope.filteredWrapperProperties = [ 'activeConnection.username', + 'startDate', 'activeConnection.remoteHost', 'name' ]; @@ -94,6 +97,13 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj */ var connections = null; + /** + * The date format for use for session-related dates. + * + * @type String + */ + var sessionDateFormat = null; + /** * Map of all currently-selected active connection wrappers by identifier. * @@ -143,7 +153,7 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj var wrapActiveConnections = function wrapActiveConnections() { // Abort if not all required data is available - if (!activeConnections || !connections) + if (!activeConnections || !connections || !sessionDateFormat) return; // Wrap all active connections for sake of display @@ -155,6 +165,7 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj $scope.wrappers.push(new ActiveConnectionWrapper( connection.name, + $filter('date')(activeConnection.startDate, sessionDateFormat), activeConnection )); @@ -192,6 +203,17 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj }); + // Get session date format + $translate('MANAGE_SESSION.FORMAT_STARTDATE').then(function sessionDateFormatReceived(retrievedSessionDateFormat) { + + // Store received date format + sessionDateFormat = retrievedSessionDateFormat; + + // Attempt to produce wrapped list of active connections + wrapActiveConnections(); + + }); + /** * Returns whether critical data has completed being loaded. * @@ -201,8 +223,9 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj */ $scope.isLoaded = function isLoaded() { - return $scope.wrappers !== null - && $scope.permissions !== null; + return $scope.wrappers !== null + && $scope.sessionDateFormat !== null + && $scope.permissions !== null; }; diff --git a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html index 41c8db37b..7cdfabe8e 100644 --- a/guacamole/src/main/webapp/app/manage/templates/manageConnection.html +++ b/guacamole/src/main/webapp/app/manage/templates/manageConnection.html @@ -97,7 +97,7 @@ THE SOFTWARE.