]>
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
: 'pveQemuHDInputPanel',
159 nodename
: '{nodename}',
161 title
: gettext('Hard Disk'),
166 xtype
: 'pveQemuProcessorPanel',
168 title
: gettext('CPU'),
171 xtype
: 'pveQemuMemoryPanel',
173 title
: gettext('Memory'),
176 xtype
: 'pveQemuNetworkInputPanel',
178 nodename
: '{nodename}',
180 title
: gettext('Network'),
184 title
: gettext('Confirm'),
197 { header
: 'Key', width
: 150, dataIndex
: 'key' },
198 { header
: 'Value', flex
: 1, dataIndex
: 'value' },
204 xtype
: 'proxmoxcheckbox',
208 boxLabel
: gettext('Start after created'),
212 show: function(panel
) {
213 var kv
= this.up('window').getValues();
215 Ext
.Object
.each(kv
, function(key
, value
) {
216 if (key
=== 'delete') { // ignore
219 data
.push({ key
: key
, value
: value
});
222 var summarystore
= panel
.down('grid').getStore();
223 summarystore
.suspendEvents();
224 summarystore
.removeAll();
225 summarystore
.add(data
);
227 summarystore
.resumeEvents();
228 summarystore
.fireEvent('refresh');
231 onSubmit: function() {
232 var wizard
= this.up('window');
233 var kv
= wizard
.getValues();
236 var nodename
= kv
.nodename
;
239 Proxmox
.Utils
.API2Request({
240 url
: '/nodes/' + nodename
+ '/qemu',
241 waitMsgTarget
: wizard
,
244 success: function(response
) {
247 failure: function(response
, opts
) {
248 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);