]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/DisplayEdit.js
ui: qemu: make DisplayEdit declarative and drop DisplaySelector
[pve-manager.git] / www / manager6 / qemu / DisplayEdit.js
1 Ext.define('PVE.qemu.DisplayEdit', {
2 extend: 'Proxmox.window.Edit',
3
4 vmconfig: undefined,
5
6 subject: gettext('Display'),
7 width: 350,
8
9 items: [{
10 name: 'vga',
11 xtype: 'proxmoxKVComboBox',
12 value: '__default__',
13 fieldLabel: gettext('Graphic card'),
14 comboItems: PVE.Utils.kvm_vga_driver_array(),
15 validator: function() {
16 var v = this.getValue();
17 var cfg = this.up('proxmoxWindowEdit').vmconfig || {};
18
19 if (v.match(/^serial\d+$/) && (!cfg[v] || cfg[v] !== 'socket')) {
20 var fmt = gettext("Serial interface '{0}' is not correctly configured.");
21 return Ext.String.format(fmt, v);
22 }
23 return true;
24 }
25 }],
26
27 initComponent : function() {
28 var me = this;
29
30 me.callParent();
31
32 me.load({
33 success: function(response) {
34 me.vmconfig = response.result.data;
35 me.setValues(me.vmconfig);
36 }
37 });
38 }
39 });