]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/QemuBiosEdit.js
use windowEdit from widget toolkit
[pve-manager.git] / www / manager6 / qemu / QemuBiosEdit.js
1 Ext.define('PVE.qemu.BiosEdit', {
2 extend: 'Proxmox.window.Edit',
3 alias: 'widget.pveQemuBiosEdit',
4
5 initComponent : function() {
6 var me = this;
7
8 var EFIHint = Ext.createWidget({
9 xtype: 'displayfield', //submitValue is false, so we don't get submitted
10 userCls: 'pve-hint',
11 value: 'You need to add an EFI disk for storing the ' +
12 'EFI settings. See the online help for details.',
13 hidden: true
14 });
15
16 Ext.applyIf(me, {
17 subject: 'BIOS',
18 items: [ {
19 xtype: 'pveQemuBiosSelector',
20 onlineHelp: 'qm_bios_and_uefi',
21 name: 'bios',
22 value: '__default__',
23 fieldLabel: 'BIOS',
24 listeners: {
25 'change' : function(field, newValue) {
26 if (newValue == 'ovmf') {
27 Proxmox.Utils.API2Request({
28 url : me.url,
29 method : 'GET',
30 failure : function(response, opts) {
31 Ext.Msg.alert(gettext('Error'), response.htmlStatus);
32 },
33 success : function(response, opts) {
34 var vmConfig = response.result.data;
35 // there can be only one
36 if (!vmConfig.efidisk0) {
37 EFIHint.setVisible(true);
38 }
39 }
40 });
41 } else {
42 if (EFIHint.isVisible()) {
43 EFIHint.setVisible(false);
44 }
45 }
46 }
47 }
48 },
49 EFIHint
50 ] });
51
52 me.callParent();
53
54 me.load();
55
56 }
57 });