]>
Commit | Line | Data |
---|---|---|
da97bd3d AL |
1 | Ext.define('PVE.qemu.AudioInputPanel', { |
2 | extend: 'Proxmox.panel.InputPanel', | |
3 | xtype: 'pveAudioInputPanel', | |
4 | ||
700434b2 TL |
5 | // FIXME: enable once we bumped doc-gen so this ref is included |
6 | //onlineHelp: 'qm_audio_device', | |
da97bd3d AL |
7 | |
8 | onGetValues: function(values) { | |
9 | var ret = PVE.Parser.printPropertyString(values); | |
10 | if (ret === '') { | |
11 | return { | |
f6710aac | 12 | 'delete': 'audio0', |
da97bd3d AL |
13 | }; |
14 | } | |
15 | return { | |
f6710aac | 16 | audio0: ret, |
da97bd3d AL |
17 | }; |
18 | }, | |
19 | ||
20 | items: [{ | |
21 | name: 'device', | |
22 | xtype: 'proxmoxKVComboBox', | |
23 | value: 'ich9-intel-hda', | |
24 | fieldLabel: gettext('Audio Device'), | |
25 | comboItems: [ | |
26 | ['ich9-intel-hda', 'ich9-intel-hda'], | |
27 | ['intel-hda', 'intel-hda'], | |
f6710aac TL |
28 | ['AC97', 'AC97'], |
29 | ], | |
da97bd3d AL |
30 | }, { |
31 | name: 'driver', | |
bf14dcd8 | 32 | xtype: 'proxmoxKVComboBox', |
da97bd3d | 33 | value: 'spice', |
da97bd3d | 34 | fieldLabel: gettext('Backend Driver'), |
bf14dcd8 | 35 | comboItems: [ |
7a077bb5 TL |
36 | ['spice', 'SPICE'], |
37 | ['none', `${Proxmox.Utils.NoneText} (${gettext('Dummy Device')})`], | |
f6710aac TL |
38 | ], |
39 | }], | |
da97bd3d AL |
40 | }); |
41 | ||
42 | Ext.define('PVE.qemu.AudioEdit', { | |
43 | extend: 'Proxmox.window.Edit', | |
44 | ||
45 | vmconfig: undefined, | |
46 | ||
47 | subject: gettext('Audio Device'), | |
48 | ||
49 | items: [{ | |
f6710aac | 50 | xtype: 'pveAudioInputPanel', |
da97bd3d AL |
51 | }], |
52 | ||
8058410f | 53 | initComponent: function() { |
da97bd3d AL |
54 | var me = this; |
55 | ||
56 | me.callParent(); | |
57 | ||
58 | me.load({ | |
59 | success: function(response) { | |
60 | me.vmconfig = response.result.data; | |
61 | ||
62 | var audio0 = me.vmconfig.audio0; | |
63 | if (audio0) { | |
64 | me.setValues(PVE.Parser.parsePropertyString(audio0)); | |
65 | } | |
f6710aac | 66 | }, |
da97bd3d | 67 | }); |
f6710aac | 68 | }, |
da97bd3d | 69 | }); |