]>
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: function(field
, value
) {
13 if (!me
.getView().insideWizard
) {
19 if (PVE
.qemu
.OSDefaults
[value
.ostype
]) {
20 targetValues
= PVE
.qemu
.OSDefaults
[value
.ostype
];
22 targetValues
= PVE
.qemu
.OSDefaults
.generic
;
25 me
.setWidget('pveBusSelector', targetValues
.busType
);
26 me
.setWidget('pveNetworkCardSelector', targetValues
.networkCard
);
27 me
.setWizardHiddenValue('qemuScsiController', targetValues
.scsihw
);
31 setWidget: function(widget
, newValue
) {
32 // changing a widget is safe only if ComponentQuery.query returns us
33 // a single value array
34 var widgets
= Ext
.ComponentQuery
.query('pveQemuCreateWizard ' + widget
);
35 if (widgets
.length
=== 1) {
36 widgets
[0].setValue(newValue
);
38 throw 'non unique widget :' + widget
+ ' in Wizard';
41 setWizardHiddenValue: function(property
, newValue
) {
42 var wizards
= Ext
.ComponentQuery
.query('pveQemuCreateWizard ');
43 if (wizards
.length
=== 1) {
44 wizards
[0][property
] = newValue
;
46 throw 'non unique wizard, unable to set ' + property
;
51 initComponent : function() {
57 html
: 'Microsoft Windows',
58 cls
:'x-form-check-group-label'
95 html
: 'Linux/' + gettext('Other OS types'),
96 cls
:'x-form-check-group-label'
111 inputValue
: 'solaris'
120 Ext
.Array
.each(me
.column1
, function(def
) {
121 if (def
.inputValue
) {
122 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
125 Ext
.Array
.each(me
.column2
, function(def
) {
126 if (def
.inputValue
) {
127 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
142 Ext
.define('PVE.qemu.OSTypeEdit', {
143 extend
: 'PVE.window.Edit',
145 initComponent : function() {
150 items
: Ext
.create('PVE.qemu.OSTypeInputPanel')
156 success: function(response
, options
) {
157 var value
= response
.result
.data
.ostype
|| 'other';
158 me
.setValues({ ostype
: value
});