]>
Commit | Line | Data |
---|---|---|
cedc0418 | 1 | Ext.define('PVE.qemu.BiosEdit', { |
9fccc702 | 2 | extend: 'Proxmox.window.Edit', |
d6dfc45b | 3 | alias: 'widget.pveQemuBiosEdit', |
e7d6f694 | 4 | onlineHelp: 'qm_bios_and_uefi', |
cedc0418 DM |
5 | |
6 | initComponent : function() { | |
7 | var me = this; | |
8 | ||
d6dfc45b EK |
9 | var EFIHint = Ext.createWidget({ |
10 | xtype: 'displayfield', //submitValue is false, so we don't get submitted | |
f71b7c28 | 11 | userCls: 'pmx-hint', |
53633613 | 12 | value: gettext('You need to add an EFI disk for storing the EFI settings. See the online help for details.'), |
6f6bb9c2 | 13 | hidden: true |
d6dfc45b EK |
14 | }); |
15 | ||
cedc0418 DM |
16 | Ext.applyIf(me, { |
17 | subject: 'BIOS', | |
d6dfc45b | 18 | items: [ { |
cedc0418 | 19 | xtype: 'pveQemuBiosSelector', |
c8802a60 | 20 | onlineHelp: 'qm_bios_and_uefi', |
cedc0418 | 21 | name: 'bios', |
ca6372bd | 22 | value: '__default__', |
d6dfc45b EK |
23 | fieldLabel: 'BIOS', |
24 | listeners: { | |
25 | 'change' : function(field, newValue) { | |
26 | if (newValue == 'ovmf') { | |
e7ade592 | 27 | Proxmox.Utils.API2Request({ |
d6dfc45b EK |
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 | ] }); | |
cedc0418 DM |
51 | |
52 | me.callParent(); | |
53 | ||
54 | me.load(); | |
d6dfc45b | 55 | |
cedc0418 DM |
56 | } |
57 | }); |