Merge 1.1.0 changes back to master.

This commit is contained in:
Michael Jumper
2019-06-07 09:01:40 -07:00
17 changed files with 519 additions and 9 deletions

View File

@@ -501,6 +501,13 @@
<version>27.0.1-jre</version>
</dependency>
<!-- JSTZ for TimeZone Detection -->
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jstz</artifactId>
<version>1.0.10</version>
</dependency>
</dependencies>
</project>

View File

@@ -614,6 +614,36 @@ licenses; we recommend you read them, as their terms may differ from the
terms above.
JSTZ (https://pellepim.bitbucket.io/jstz/)
------------------------------------------
Version: 1.0.10
From: 'Jon Nylander' (https://pellepim.bitbucket.io/jstz/)
License(s):
MIT (bundled/jstz-1.0.10/LICENSE)
Copyright (c) 2012 Jon Nylander, project maintained at
https://bitbucket.org/pellepim/jstimezonedetect
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Logback (http://logback.qos.ch/)
--------------------------------

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2012 Jon Nylander, project maintained at
https://bitbucket.org/pellepim/jstimezonedetect
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -95,6 +95,11 @@ public abstract class TunnelRequest {
* once for each mimetype.
*/
public static final String IMAGE_PARAMETER = "GUAC_IMAGE";
/**
* The name of the parameter specifying the timezone of the client.
*/
public static final String TIMEZONE_PARAMETER = "GUAC_TIMEZONE";
/**
* All supported object types that can be used as the destination of a
@@ -365,5 +370,16 @@ public abstract class TunnelRequest {
public List<String> getImageMimetypes() {
return getParameterValues(IMAGE_PARAMETER);
}
/**
* Returns the tz database value of the timezone declared by the client
* within the tunnel request.
*
* @return
* The tz database value of the timezone parameter as reported by
* the client.
*/
public String getTimezone() {
return getParameter(TIMEZONE_PARAMETER);
}
}

View File

@@ -166,6 +166,11 @@ public class TunnelRequestService {
List<String> imageMimetypes = request.getImageMimetypes();
if (imageMimetypes != null)
info.getImageMimetypes().addAll(imageMimetypes);
// Get the timezone value
String timezone = request.getTimezone();
if (timezone != null & !timezone.isEmpty())
info.setTimezone(timezone);
return info;
}

View File

@@ -42,6 +42,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
var authenticationService = $injector.get('authenticationService');
var connectionGroupService = $injector.get('connectionGroupService');
var connectionService = $injector.get('connectionService');
var preferenceService = $injector.get('preferenceService');
var requestService = $injector.get('requestService');
var tunnelService = $injector.get('tunnelService');
var guacAudio = $injector.get('guacAudio');
@@ -235,6 +236,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
+ "&GUAC_WIDTH=" + Math.floor(optimal_width)
+ "&GUAC_HEIGHT=" + Math.floor(optimal_height)
+ "&GUAC_DPI=" + Math.floor(optimal_dpi)
+ "&GUAC_TIMEZONE=" + encodeURIComponent(preferenceService.preferences.timezone)
+ (connectionParameters ? '&' + connectionParameters : '');
// Add audio mimetypes to connect string

View File

@@ -98,6 +98,18 @@ angular.module('settings').provider('preferenceService', ['$injector',
return language.replace(/-/g, '_');
};
/**
* Return the timezone detected for the current browser session
* by the JSTZ timezone library.
*
* @returns String
* The name of the currently-detected timezone in IANA zone key
* format (Olson time zone database).
*/
var getDetectedTimezone = function getDetectedTimezone() {
return jstz.determine().name();
};
/**
* All currently-set preferences, as name/value pairs. Each property name
@@ -128,7 +140,15 @@ angular.module('settings').provider('preferenceService', ['$injector',
*
* @type String
*/
language : getDefaultLanguageKey()
language : getDefaultLanguageKey(),
/**
* The timezone set by the user, in IANA zone key format (Olson time
* zone database).
*
* @type String
*/
timezone : getDetectedTimezone()
};

View File

@@ -18,7 +18,7 @@
*/
.preferences .update-password .form,
.preferences .language .form {
.preferences .locale .form {
padding-left: 0.5em;
border-left: 3px solid rgba(0, 0, 0, 0.125);
}

View File

@@ -1,8 +1,8 @@
<div class="preferences" ng-class="{loading: !isLoaded()}">
<!-- Language settings -->
<div class="settings section language">
<p>{{'SETTINGS_PREFERENCES.HELP_LANGUAGE' | translate}}</p>
<!-- Locale settings -->
<div class="settings section locale">
<p>{{'SETTINGS_PREFERENCES.HELP_LOCALE' | translate}}</p>
<!-- Language selection -->
<div class="form">
@@ -13,6 +13,15 @@
</tr>
</table>
</div>
<!-- Timezone selection -->
<div class="form">
<guac-form-field
field="{ 'type' : 'TIMEZONE', 'name' : 'timezone' }"
model="preferences.timezone"
namespace="'SETTINGS_PREFERENCES'">
</guac-form-field>
</div>
</div>
<!-- Password update -->

View File

@@ -85,6 +85,9 @@
<script type="text/javascript" src="webjars/angular-translate-interpolation-messageformat/2.16.0/angular-translate-interpolation-messageformat.min.js"></script>
<script type="text/javascript" src="webjars/angular-translate-loader-static-files/2.16.0/angular-translate-loader-static-files.min.js"></script>
<!-- JSTZ -->
<script type="text/javascript" src="webjars/jstz/1.0.10/dist/jstz.min.js"></script>
<!-- Polyfills for the "datalist" element, Blob and the FileSaver API -->
<script type="text/javascript" src="webjars/blob-polyfill/1.0.20150320/Blob.js"></script>
<script type="text/javascript" src="webjars/datalist-polyfill/1.14.0/datalist-polyfill.min.js"></script>

View File

@@ -419,6 +419,7 @@
"FIELD_HEADER_REMOTE_APP_ARGS" : "Parameters:",
"FIELD_HEADER_REMOTE_APP_DIR" : "Working directory:",
"FIELD_HEADER_REMOTE_APP" : "Program:",
"FIELD_HEADER_TIMEZONE" : "Timezone:",
"FIELD_HEADER_SECURITY" : "Security mode:",
"FIELD_HEADER_SERVER_LAYOUT" : "Keyboard layout:",
"FIELD_HEADER_SFTP_DIRECTORY" : "Default upload directory:",
@@ -770,6 +771,7 @@
"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:",
"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.",
@@ -777,7 +779,7 @@
"HELP_INPUT_METHOD_NONE" : "@:CLIENT.HELP_INPUT_METHOD_NONE",
"HELP_INPUT_METHOD_OSK" : "@:CLIENT.HELP_INPUT_METHOD_OSK",
"HELP_INPUT_METHOD_TEXT" : "@:CLIENT.HELP_INPUT_METHOD_TEXT",
"HELP_LANGUAGE" : "Select a different language below to change the language of all text within Guacamole. Available choices will depend on which languages are installed.",
"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_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.",