]> git.proxmox.com Git - pve-manager-legacy.git/blob - www/manager/qemu/DisplayEdit.js
allow to use serial terminal as display
[pve-manager-legacy.git] / www / manager / qemu / DisplayEdit.js
1 Ext.define('PVE.qemu.DisplayEdit', {
2 extend: 'PVE.window.Edit',
3
4 vmconfig: undefined,
5
6 initComponent : function() {
7 var me = this;
8
9 var displayField;
10
11 var validateDisplay = function() {
12 var val = displayField.getValue();
13
14 if (me.vmconfig && val.match(/^serial\d+$/)) {
15 if (me.vmconfig[val] && me.vmconfig[val] === 'socket') {
16 return true;
17 }
18 return "Serial interface '" + val + "' is not correctly configured.";
19 }
20
21 return true;
22 };
23
24 displayField = Ext.createWidget('DisplaySelector', {
25 name: 'vga',
26 value: '',
27 fieldLabel: gettext('Graphic card'),
28 validator: validateDisplay
29 });
30
31 Ext.apply(me, {
32 subject: gettext('Display'),
33 width: 350,
34 items: displayField
35 });
36
37 me.callParent();
38
39 me.load({
40 success: function(response, options) {
41 var values = response.result.data;
42
43 me.vmconfig = values;
44
45 me.setValues(values);
46 }
47 });
48 }
49 });