]>
Commit | Line | Data |
---|---|---|
cedc0418 DM |
1 | Ext.define('PVE.qemu.BiosEdit', { |
2 | extend: 'PVE.window.Edit', | |
d6dfc45b | 3 | alias: 'widget.pveQemuBiosEdit', |
cedc0418 DM |
4 | |
5 | initComponent : function() { | |
6 | var me = this; | |
7 | ||
d6dfc45b EK |
8 | var EFIHint = Ext.createWidget({ |
9 | xtype: 'displayfield', //submitValue is false, so we don't get submitted | |
10 | fieldStyle: 'background-color: LightYellow;', | |
11 | value: gettext('You need to add an EFI disk for storing the ' + | |
12 | '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', |
67fc6ddf | 20 | onlineHelp: 'chapter-qm.html#_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') { | |
27 | PVE.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 | ] }); | |
cedc0418 DM |
51 | |
52 | me.callParent(); | |
53 | ||
54 | me.load(); | |
d6dfc45b | 55 | |
cedc0418 DM |
56 | } |
57 | }); |