]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/ProcessorEdit.js
bc17e1527c1da05ed4f925db8100ba95f8e779b8
1 Ext
.define('PVE.qemu.ProcessorInputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
3 alias
: 'widget.pveQemuProcessorPanel',
9 xclass
: 'Ext.app.ViewController',
11 updateCores: function() {
12 var me
= this.getView();
13 var sockets
= me
.down('field[name=sockets]').getValue();
14 var cores
= me
.down('field[name=cores]').getValue();
15 me
.down('field[name=totalcores]').setValue(sockets
*cores
);
16 var vcpus
= me
.down('field[name=vcpus]');
17 vcpus
.setMaxValue(sockets
*cores
);
18 vcpus
.setEmptyText(sockets
*cores
);
23 'field[name=sockets]': {
26 'field[name=cores]': {
32 onGetValues: function(values
) {
35 if (Array
.isArray(values
['delete'])) {
36 values
['delete'] = values
['delete'].join(',');
39 PVE
.Utils
.delete_if_default(values
, 'cpulimit', '0', 0);
40 PVE
.Utils
.delete_if_default(values
, 'cpuunits', '1024', 0);
42 // build the cpu options:
43 me
.cpu
.cputype
= values
.cputype
;
46 me
.cpu
.flags
= values
.flags
;
51 delete values
.cputype
;
53 var cpustring
= PVE
.Parser
.printQemuCpu(me
.cpu
);
55 // remove cputype delete request:
56 var del
= values
['delete'];
57 delete values
['delete'];
60 Ext
.Array
.remove(del
, 'cputype');
66 values
.cpu
= cpustring
;
71 var delarr
= del
.join(',');
73 values
['delete'] = delarr
;
83 xtype
: 'proxmoxintegerfield',
88 fieldLabel
: gettext('Sockets'),
92 xtype
: 'proxmoxintegerfield',
97 fieldLabel
: gettext('Cores'),
104 xtype
: 'CPUModelSelector',
106 fieldLabel
: gettext('Type')
109 xtype
: 'displayfield',
110 fieldLabel
: gettext('Total cores'),
118 xtype
: 'proxmoxintegerfield',
123 fieldLabel
: gettext('VCPUs'),
129 xtype
: 'numberfield',
132 maxValue
: 128, // api maximum
135 fieldLabel
: gettext('CPU limit'),
137 emptyText
: gettext('unlimited')
143 xtype
: 'proxmoxintegerfield',
145 fieldLabel
: gettext('CPU units'),
153 xtype
: 'proxmoxcheckbox',
154 fieldLabel
: gettext('Enable NUMA'),
162 text
: 'Extra CPU Flags:'
165 xtype
: 'vmcpuflagselector',
171 Ext
.define('PVE.qemu.ProcessorEdit', {
172 extend
: 'Proxmox.window.Edit',
176 initComponent : function() {
179 var ipanel
= Ext
.create('PVE.qemu.ProcessorInputPanel');
182 subject
: gettext('Processors'),
189 success: function(response
, options
) {
190 var data
= response
.result
.data
;
191 var value
= data
.cpu
;
193 var cpu
= PVE
.Parser
.parseQemuCpu(value
);
195 data
.cputype
= cpu
.cputype
;
197 data
.flags
= cpu
.flags
;