]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/OSTypeEdit.js
1 Ext
.define('PVE.qemu.OSTypeInputPanel', {
2 extend
: 'PVE.panel.InputPanel',
3 alias
: 'widget.pveQemuOSTypePanel',
4 onlineHelp
: 'qm_os_settings',
8 xclass
: 'Ext.app.ViewController',
11 change
: 'onOSTypeChange'
14 onOSTypeChange: function(field
) {
15 var me
= this, ostype
= field
.getValue();
16 if (!me
.getView().insideWizard
) {
19 var targetValues
= PVE
.qemu
.OSDefaults
.getDefaults(ostype
);
21 me
.setWidget('pveBusSelector', targetValues
.busType
);
22 me
.setWidget('pveNetworkCardSelector', targetValues
.networkCard
);
23 me
.setWizardHiddenValue('qemuScsiController', targetValues
.scsihw
);
25 setWidget: function(widget
, newValue
) {
26 // changing a widget is safe only if ComponentQuery.query returns us
27 // a single value array
28 var widgets
= Ext
.ComponentQuery
.query('pveQemuCreateWizard ' + widget
);
29 if (widgets
.length
=== 1) {
30 widgets
[0].setValue(newValue
);
32 throw 'non unique widget :' + widget
+ ' in Wizard';
35 setWizardHiddenValue: function(property
, newValue
) {
36 var wizards
= Ext
.ComponentQuery
.query('pveQemuCreateWizard ');
37 if (wizards
.length
=== 1) {
38 wizards
[0][property
] = newValue
;
40 throw 'non unique wizard, unable to set ' + property
;
45 initComponent : function() {
51 html
: 'Microsoft Windows',
52 cls
:'x-form-check-group-label'
89 html
: 'Linux/' + gettext('Other OS types'),
90 cls
:'x-form-check-group-label'
105 inputValue
: 'solaris'
114 Ext
.Array
.each(me
.column1
, function(def
) {
115 if (def
.inputValue
) {
116 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
119 Ext
.Array
.each(me
.column2
, function(def
) {
120 if (def
.inputValue
) {
121 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
136 Ext
.define('PVE.qemu.OSTypeEdit', {
137 extend
: 'PVE.window.Edit',
139 initComponent : function() {
144 items
: Ext
.create('PVE.qemu.OSTypeInputPanel')
150 success: function(response
, options
) {
151 var value
= response
.result
.data
.ostype
|| 'other';
152 me
.setValues({ ostype
: value
});