mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-07 19:08:35 +00:00

since KVCombobox expects __default__ as default value change to this in DisplayEdit HDEdit KeyboardEdit ProcessorEdit Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
51 lines
980 B
JavaScript
51 lines
980 B
JavaScript
Ext.define('PVE.qemu.DisplayEdit', {
|
|
extend: 'PVE.window.Edit',
|
|
|
|
vmconfig: undefined,
|
|
|
|
initComponent : function() {
|
|
var me = this;
|
|
|
|
var displayField;
|
|
|
|
var validateDisplay = function() {
|
|
/*jslint confusion: true */
|
|
var val = displayField.getValue();
|
|
|
|
if (me.vmconfig && val.match(/^serial\d+$/)) {
|
|
if (me.vmconfig[val] && me.vmconfig[val] === 'socket') {
|
|
return true;
|
|
}
|
|
return "Serial interface '" + val + "' is not correctly configured.";
|
|
}
|
|
|
|
return true;
|
|
};
|
|
|
|
displayField = Ext.createWidget('DisplaySelector', {
|
|
name: 'vga',
|
|
value: '__default__',
|
|
fieldLabel: gettext('Graphic card'),
|
|
validator: validateDisplay
|
|
});
|
|
|
|
Ext.apply(me, {
|
|
subject: gettext('Display'),
|
|
width: 350,
|
|
items: displayField
|
|
});
|
|
|
|
me.callParent();
|
|
|
|
me.load({
|
|
success: function(response, options) {
|
|
var values = response.result.data;
|
|
|
|
me.vmconfig = values;
|
|
|
|
me.setValues(values);
|
|
}
|
|
});
|
|
}
|
|
});
|