mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 05:52:21 +00:00
Fix 2718: GUI: handle localtime option correctly
The backend treats an undefined value and 0 differently. If the option is undefined, it will still be set for Windows in config_to_command. Replace the checkbox with a combobox covering all options. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
baed2b7c41
commit
0beff18b8e
@ -273,6 +273,13 @@ Ext.define('PVE.Utils', { utilities: {
|
|||||||
return fa.join(', ');
|
return fa.join(', ');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
render_localtime: function(value) {
|
||||||
|
if (value === '__default__') {
|
||||||
|
return Proxmox.Utils.defaultText + ' (' + gettext('Enabled for Windows') + ')';
|
||||||
|
}
|
||||||
|
return Proxmox.Utils.format_boolean(value);
|
||||||
|
},
|
||||||
|
|
||||||
render_qga_features: function(value) {
|
render_qga_features: function(value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')';
|
return Proxmox.Utils.defaultText + ' (' + Proxmox.Utils.disabledText + ')';
|
||||||
|
@ -212,17 +212,20 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
},
|
},
|
||||||
localtime: {
|
localtime: {
|
||||||
header: gettext('Use local time for RTC'),
|
header: gettext('Use local time for RTC'),
|
||||||
defaultValue: false,
|
defaultValue: '__default__',
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: PVE.Utils.render_localtime,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'proxmoxWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Use local time for RTC'),
|
subject: gettext('Use local time for RTC'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxKVComboBox',
|
||||||
name: 'localtime',
|
name: 'localtime',
|
||||||
uncheckedValue: 0,
|
value: '__default__',
|
||||||
defaultValue: 0,
|
comboItems: [
|
||||||
deleteDefaultValue: true,
|
['__default__', PVE.Utils.render_localtime('__default__')],
|
||||||
|
[1, PVE.Utils.render_localtime(1)],
|
||||||
|
[0, PVE.Utils.render_localtime(0)],
|
||||||
|
],
|
||||||
labelWidth: 140,
|
labelWidth: 140,
|
||||||
fieldLabel: gettext('Use local time for RTC')
|
fieldLabel: gettext('Use local time for RTC')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user