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..6ebd3de7fd 100644 --- a/guacamole/src/main/frontend/src/app/history/services/guacHistory.js +++ b/guacamole/src/main/frontend/src/app/history/services/guacHistory.js @@ -28,6 +28,7 @@ angular.module('history').factory('guacHistory', ['$injector', // Required services var localStorageService = $injector.get('localStorageService'); + var preferenceService = $injector.get('preferenceService'); var service = {}; @@ -38,7 +39,7 @@ angular.module('history').factory('guacHistory', ['$injector', * The number of entries to allow before removing old entries based on the * cutoff. */ - var IDEAL_LENGTH = 6; + var IDEAL_LENGTH = preferenceService.preferences.numberOfRecentConnections || 6; /** * The top few recent connections, sorted in order of most recent access. 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..0a9c2a5014 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,10 @@ angular.module('home').controller('homeController', ['$scope', '$injector', $scope.filteredConnectionGroupProperties = [ 'name' ]; + + $scope.showRecentConnections = function() { + 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..bab1a9ef81 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,6 +58,16 @@ 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.showRecentConnections = function showRecentConnections() { + return preferenceService.preferences.showRecentConnections; + }; /** * Returns whether recent connections are available for display. 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..f64bfd16cf 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..e5dbaed219 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 @@
+
+

{{'APP.NAME' | translate}}

+ +
+ -
+

{{'HOME.SECTION_HEADER_RECENT_CONNECTIONS' | translate}}

-
- +
diff --git a/guacamole/src/main/frontend/src/app/index/styles/headers.css b/guacamole/src/main/frontend/src/app/index/styles/headers.css index b4d96f66bd..245fa398cd 100644 --- a/guacamole/src/main/frontend/src/app/index/styles/headers.css +++ b/guacamole/src/main/frontend/src/app/index/styles/headers.css @@ -42,7 +42,7 @@ h2 { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.125); background: rgba(0, 0, 0, 0.04); - margin-bottom: 1em; + margin-bottom: 0; margin-top: 0; border-top: none; width: 100%; @@ -80,7 +80,7 @@ h2 { .header ~ * .header, .header ~ .header { - margin-top: 1em; + margin-top: 0; border-top: 1px solid rgba(0, 0, 0, 0.125); } diff --git a/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js b/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js index 4656631de3..347c751774 100644 --- a/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js +++ b/guacamole/src/main/frontend/src/app/settings/directives/guacSettingsPreferences.js @@ -258,7 +258,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe // Fetch the user record userService.getUser(dataSource, username).then(function saveUserData(user) { $scope.user = user; - }) + }); // Fetch all user preference attribute forms defined schemaService.getUserPreferenceAttributes(dataSource).then(function saveAttributes(attributes) { diff --git a/guacamole/src/main/frontend/src/app/settings/services/preferenceService.js b/guacamole/src/main/frontend/src/app/settings/services/preferenceService.js index 9c4d5fc945..e56f47075f 100644 --- a/guacamole/src/main/frontend/src/app/settings/services/preferenceService.js +++ b/guacamole/src/main/frontend/src/app/settings/services/preferenceService.js @@ -142,6 +142,20 @@ angular.module('settings').provider('preferenceService', ['$injector', */ language : getDefaultLanguageKey(), + /** + * The number of recent connections to display. + * + * @type Integer + */ + numberOfRecentConnections: 6, + + /** + * Whether or not to show the "Recent Connections" section. + * + * @type Boolean + */ + showRecentConnections : true, + /** * The timezone set by the user, in IANA zone key format (Olson time * zone database). diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsPreferences.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsPreferences.html index 7c154df893..c73d1a89c1 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsPreferences.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsPreferences.html @@ -88,6 +88,24 @@

{{'SETTINGS_PREFERENCES.SECTION_HEADER_DEFAULT_MOUSE_MODE' |

+ + +

{{'SETTINGS_PREFERENCES.SECTION_HEADER_RECENT_CONNECTIONS' | translate}}

+
+

{{'SETTINGS_PREFERENCES.HELP_RECENT_CONNECTIONS' | translate}}

+
+ + + + + + + + + +
{{'SETTINGS_PREFERENCES.FIELD_HEADER_SHOW_RECENT_CONNECTIONS' | translate}}
{{'SETTINGS_PREFERENCES.FIELD_HEADER_NUMBER_RECENT_CONNECTIONS' | translate}}
+
+
diff --git a/guacamole/src/main/frontend/src/translations/en.json b/guacamole/src/main/frontend/src/translations/en.json index a3071b4c5e..0d4f8e6265 100644 --- a/guacamole/src/main/frontend/src/translations/en.json +++ b/guacamole/src/main/frontend/src/translations/en.json @@ -1021,13 +1021,15 @@ "ERROR_PASSWORD_BLANK" : "@:APP.ERROR_PASSWORD_BLANK", "ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH", - "FIELD_HEADER_LANGUAGE" : "Display language:", - "FIELD_HEADER_PASSWORD" : "Password:", - "FIELD_HEADER_PASSWORD_OLD" : "Current Password:", - "FIELD_HEADER_PASSWORD_NEW" : "New Password:", - "FIELD_HEADER_PASSWORD_NEW_AGAIN" : "Confirm New Password:", - "FIELD_HEADER_TIMEZONE" : "Timezone:", - "FIELD_HEADER_USERNAME" : "Username:", + "FIELD_HEADER_LANGUAGE" : "Display language:", + "FIELD_HEADER_NUMBER_RECENT_CONNECTIONS" : "Number of Recent Connections to show:", + "FIELD_HEADER_PASSWORD" : "Password:", + "FIELD_HEADER_PASSWORD_OLD" : "Current Password:", + "FIELD_HEADER_PASSWORD_NEW" : "New Password:", + "FIELD_HEADER_PASSWORD_NEW_AGAIN" : "Confirm New Password:", + "FIELD_HEADER_SHOW_RECENT_CONNECTIONS" : "Display Recent Connections:", + "FIELD_HEADER_TIMEZONE" : "Timezone:", + "FIELD_HEADER_USERNAME" : "Username:", "HELP_DEFAULT_INPUT_METHOD" : "The default input method determines how keyboard events are received by Guacamole. Changing this setting may be necessary when using a mobile device, or when typing through an IME. This setting can be overridden on a per-connection basis within the Guacamole menu.", "HELP_DEFAULT_MOUSE_MODE" : "The default mouse emulation mode determines how the remote mouse will behave in new connections with respect to touches. This setting can be overridden on a per-connection basis within the Guacamole menu.", @@ -1037,6 +1039,7 @@ "HELP_LOCALE" : "Options below are related to the locale of the user and will impact how various parts of the interface are displayed.", "HELP_MOUSE_MODE_ABSOLUTE" : "@:CLIENT.HELP_MOUSE_MODE_ABSOLUTE", "HELP_MOUSE_MODE_RELATIVE" : "@:CLIENT.HELP_MOUSE_MODE_RELATIVE", + "HELP_RECENT_CONNECTIONS" : "Here you can enable or disable recent conections in the Guacamole Home Page, and adjust the number of recent connections that will be displayed.", "HELP_UPDATE_PASSWORD" : "If you wish to change your password, enter your current password and the desired new password below, and click \"Update Password\". The change will take effect immediately.", "INFO_PASSWORD_CHANGED" : "Password changed.", @@ -1048,6 +1051,7 @@ "SECTION_HEADER_DEFAULT_INPUT_METHOD" : "Default Input Method", "SECTION_HEADER_DEFAULT_MOUSE_MODE" : "Default Mouse Emulation Mode", + "SECTION_HEADER_RECENT_CONNECTIONS" : "Recent Connections Preferences", "SECTION_HEADER_UPDATE_PASSWORD" : "Change Password" },