diff --git a/guacamole/src/main/frontend/src/app/history/services/guacHistory.js b/guacamole/src/main/frontend/src/app/history/services/guacHistory.js index 74046ef9f8..e47cb29e98 100644 --- a/guacamole/src/main/frontend/src/app/history/services/guacHistory.js +++ b/guacamole/src/main/frontend/src/app/history/services/guacHistory.js @@ -28,17 +28,12 @@ angular.module('history').factory('guacHistory', ['$injector', // Required services var localStorageService = $injector.get('localStorageService'); + var preferenceService = $injector.get('preferenceService'); var service = {}; // The parameter name for getting the history from local storage var GUAC_HISTORY_STORAGE_KEY = "GUAC_HISTORY"; - - /** - * The number of entries to allow before removing old entries based on the - * cutoff. - */ - var IDEAL_LENGTH = 6; /** * The top few recent connections, sorted in order of most recent access. @@ -77,8 +72,8 @@ angular.module('history').factory('guacHistory', ['$injector', )); // Truncate history to ideal length - if (service.recentConnections.length > IDEAL_LENGTH) - service.recentConnections.length = IDEAL_LENGTH; + if (service.recentConnections.length > preferenceService.preferences.numberOfRecentConnections) + service.recentConnections.length = preferenceService.preferences.numberOfRecentConnections; // Save updated history localStorageService.setItem(GUAC_HISTORY_STORAGE_KEY, service.recentConnections); diff --git a/guacamole/src/main/frontend/src/app/home/controllers/homeController.js b/guacamole/src/main/frontend/src/app/home/controllers/homeController.js index a6d359e7f6..92c149e6ba 100644 --- a/guacamole/src/main/frontend/src/app/home/controllers/homeController.js +++ b/guacamole/src/main/frontend/src/app/home/controllers/homeController.js @@ -31,6 +31,7 @@ angular.module('home').controller('homeController', ['$scope', '$injector', var authenticationService = $injector.get('authenticationService'); var connectionGroupService = $injector.get('connectionGroupService'); var dataSourceService = $injector.get('dataSourceService'); + var preferenceService = $injector.get('preferenceService'); var requestService = $injector.get('requestService'); /** @@ -59,6 +60,16 @@ angular.module('home').controller('homeController', ['$scope', '$injector', $scope.filteredConnectionGroupProperties = [ 'name' ]; + + /** + * Returns true if recent connections should be displayed on the Guacamole + * home page, otherwise false. + * + * @returns {!boolean} + */ + $scope.willShowRecentConnections = function willShowRecentConnections() { + return preferenceService.preferences.showRecentConnections; + }; /** * Returns whether critical data has completed being loaded. diff --git a/guacamole/src/main/frontend/src/app/home/directives/guacRecentConnections.js b/guacamole/src/main/frontend/src/app/home/directives/guacRecentConnections.js index c59ad4734e..1f16e036eb 100644 --- a/guacamole/src/main/frontend/src/app/home/directives/guacRecentConnections.js +++ b/guacamole/src/main/frontend/src/app/home/directives/guacRecentConnections.js @@ -50,6 +50,7 @@ angular.module('home').directive('guacRecentConnections', [function guacRecentCo // Required services var guacHistory = $injector.get('guacHistory'); + var preferenceService = $injector.get('preferenceService'); /** * Array of all known and visible recently-used connections. @@ -57,11 +58,21 @@ angular.module('home').directive('guacRecentConnections', [function guacRecentCo * @type RecentConnection[] */ $scope.recentConnections = []; + + /** + * Returns whether or not recent connections should be displayed. + * + * @returns {!boolean} + * true if recent connections should be displayed, otherwise false. + */ + $scope.willShowRecentConnections = function willShowRecentConnections() { + return preferenceService.preferences.showRecentConnections; + }; /** * Returns whether recent connections are available for display. * - * @returns {Boolean} + * @returns {!boolean} * true if recent connections are present, false otherwise. */ $scope.hasRecentConnections = function hasRecentConnections() { diff --git a/guacamole/src/main/frontend/src/app/home/styles/home.css b/guacamole/src/main/frontend/src/app/home/styles/home.css index 33b867a9f0..e6837f45c2 100644 --- a/guacamole/src/main/frontend/src/app/home/styles/home.css +++ b/guacamole/src/main/frontend/src/app/home/styles/home.css @@ -75,3 +75,8 @@ a.home-connection, .empty.balancer a.home-connection-group { .all-connections .connection-group.empty.balancer > .caption .icon.expand { display: none; } + +.header-app-name { + font-size: 0.85em; + box-shadow: none; +} \ No newline at end of file diff --git a/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html b/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html index 08362f66f5..96c75ec71f 100644 --- a/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html +++ b/guacamole/src/main/frontend/src/app/home/templates/guacRecentConnections.html @@ -1,4 +1,4 @@ -
{{'HOME.INFO_NO_RECENT_CONNECTIONS' | translate}}
diff --git a/guacamole/src/main/frontend/src/app/home/templates/home.html b/guacamole/src/main/frontend/src/app/home/templates/home.html index 06c0f22117..6ba553025a 100644 --- a/guacamole/src/main/frontend/src/app/home/templates/home.html +++ b/guacamole/src/main/frontend/src/app/home/templates/home.html @@ -2,12 +2,16 @@{{'SETTINGS_PREFERENCES.HELP_RECENT_CONNECTIONS' | translate}}
+{{'SETTINGS_PREFERENCES.FIELD_HEADER_SHOW_RECENT_CONNECTIONS' | translate}} | ++ |
---|---|
{{'SETTINGS_PREFERENCES.FIELD_HEADER_NUMBER_RECENT_CONNECTIONS' | translate}} | ++ |