]>
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
: 'chapter-qm.html#_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
);
30 setWidget: function(widget
, newValue
) {
31 // changing a widget is safe only if ComponentQuery.query returns us
32 // a single value array
33 var widgets
= Ext
.ComponentQuery
.query('pveQemuCreateWizard ' + widget
);
34 if (widgets
.length
=== 1) {
35 widgets
[0].setValue(newValue
);
37 throw 'non unique widget :' + widget
+ ' in Wizard';
42 initComponent : function() {
48 html
: 'Microsoft Windows',
49 cls
:'x-form-check-group-label'
81 html
: 'Linux/' + gettext('Other OS types'),
82 cls
:'x-form-check-group-label'
106 Ext
.Array
.each(me
.column1
, function(def
) {
107 if (def
.inputValue
) {
108 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
111 Ext
.Array
.each(me
.column2
, function(def
) {
112 if (def
.inputValue
) {
113 def
.boxLabel
= PVE
.Utils
.render_kvm_ostype(def
.inputValue
);
128 Ext
.define('PVE.qemu.OSTypeEdit', {
129 extend
: 'PVE.window.Edit',
131 initComponent : function() {
136 items
: Ext
.create('PVE.qemu.OSTypeInputPanel')
142 success: function(response
, options
) {
143 var value
= response
.result
.data
.ostype
|| 'other';
144 me
.setValues({ ostype
: value
});