]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/CreateWizard.js
1 Ext
.define('PVE.qemu.CreateWizard', {
2 extend
: 'PVE.window.Wizard',
3 alias
: 'widget.pveQemuCreateWizard',
4 mixins
: ['Proxmox.Mixin.CBind'],
19 subject
: gettext('Virtual Machine'),
24 title
: gettext('General'),
25 onlineHelp
: 'qm_general_settings',
28 xtype
: 'pveNodeSelector',
31 selectCurNode
: '{!nodename}',
32 preferredValue
: '{nodename}',
37 fieldLabel
: gettext('Node'),
39 onlineValidator
: true,
42 xtype
: 'pveGuestIDSelector',
47 validateExists
: false,
54 fieldLabel
: gettext('Name'),
60 xtype
: 'pvePoolSelector',
61 fieldLabel
: gettext('Resource Pool'),
69 xtype
: 'proxmoxcheckbox',
73 deleteDefaultValue
: true,
74 fieldLabel
: gettext('Start at boot'),
84 fieldLabel
: gettext('Start/Shutdown order'),
92 fieldLabel
: gettext('Startup delay'),
100 fieldLabel
: gettext('Shutdown timeout'),
103 onGetValues: function(values
) {
104 ['name', 'pool', 'onboot', 'agent'].forEach(function(field
) {
105 if (!values
[field
]) {
106 delete values
[field
];
110 var res
= PVE
.Parser
.printStartup({
117 values
.startup
= res
;
134 title
: gettext('OS'),
137 xtype
: 'pveQemuCDInputPanel',
139 nodename
: '{nodename}',
145 xtype
: 'pveQemuOSTypePanel',
151 xtype
: 'pveQemuSystemPanel',
152 title
: gettext('System'),
157 xtype
: 'pveMultiHDPanel',
159 nodename
: '{nodename}',
161 title
: gettext('Disks'),
164 xtype
: 'pveQemuProcessorPanel',
166 title
: gettext('CPU'),
169 xtype
: 'pveQemuMemoryPanel',
171 title
: gettext('Memory'),
174 xtype
: 'pveQemuNetworkInputPanel',
176 nodename
: '{nodename}',
178 title
: gettext('Network'),
182 title
: gettext('Confirm'),
195 { header
: 'Key', width
: 150, dataIndex
: 'key' },
196 { header
: 'Value', flex
: 1, dataIndex
: 'value' },
202 xtype
: 'proxmoxcheckbox',
206 boxLabel
: gettext('Start after created'),
210 show: function(panel
) {
211 var kv
= this.up('window').getValues();
213 Ext
.Object
.each(kv
, function(key
, value
) {
214 if (key
=== 'delete') { // ignore
217 data
.push({ key
: key
, value
: value
});
220 var summarystore
= panel
.down('grid').getStore();
221 summarystore
.suspendEvents();
222 summarystore
.removeAll();
223 summarystore
.add(data
);
225 summarystore
.resumeEvents();
226 summarystore
.fireEvent('refresh');
229 onSubmit: function() {
230 var wizard
= this.up('window');
231 var kv
= wizard
.getValues();
234 var nodename
= kv
.nodename
;
237 Proxmox
.Utils
.API2Request({
238 url
: '/nodes/' + nodename
+ '/qemu',
239 waitMsgTarget
: wizard
,
242 success: function(response
) {
245 failure: function(response
, opts
) {
246 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);