]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/ProcessorEdit.js
1 Ext
.define('PVE.qemu.ProcessorInputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
3 alias
: 'widget.pveQemuProcessorPanel',
8 // defines the possible cpu flags and their labels
9 flagsAvail
: ['pcid', 'spec-ctrl'],
10 flagLabels
: ['PCID', 'SPEC-CTRL'],
12 onGetValues: function(values
) {
15 // build the cpu options:
16 me
.cpu
.cputype
= values
.cputype
;
20 me
.flagsAvail
.forEach(function(flag
) {
22 flags
.push('+' + flag
.toString());
27 me
.cpu
.flags
= flags
.length
? flags
.join(';') : undefined;
29 delete values
.cputype
;
31 var cpustring
= PVE
.Parser
.printQemuCpu(me
.cpu
);
33 // remove cputype delete request:
34 var del
= values
['delete'];
35 delete values
['delete'];
38 Ext
.Array
.remove(del
, 'cputype');
44 values
.cpu
= cpustring
;
49 var delarr
= del
.join(',');
51 values
['delete'] = delarr
;
57 initComponent : function() {
64 xtype
: 'proxmoxintegerfield',
69 fieldLabel
: gettext('Sockets'),
72 change: function(f
, value
) {
73 var sockets
= me
.down('field[name=sockets]').getValue();
74 var cores
= me
.down('field[name=cores]').getValue();
75 me
.down('field[name=totalcores]').setValue(sockets
*cores
);
80 xtype
: 'proxmoxintegerfield',
85 fieldLabel
: gettext('Cores'),
88 change: function(f
, value
) {
89 var sockets
= me
.down('field[name=sockets]').getValue();
90 var cores
= me
.down('field[name=cores]').getValue();
91 me
.down('field[name=totalcores]').setValue(sockets
*cores
);
96 xtype
: 'proxmoxcheckbox',
97 fieldLabel
: gettext('Enable NUMA'),
107 xtype
: 'CPUModelSelector',
109 value
: '__default__',
110 fieldLabel
: gettext('Type')
113 xtype
: 'displayfield',
114 fieldLabel
: gettext('Total cores'),
120 me
.flagsAvail
.forEach(function(flag
, i
) {
122 hidden
: me
.insideWizard
,
123 disabled
: me
.insideWizard
,
124 xtype
: 'proxmoxcheckbox',
125 fieldLabel
: me
.flagLabels
[i
] || flag
,
135 Ext
.define('PVE.qemu.ProcessorEdit', {
136 extend
: 'Proxmox.window.Edit',
138 initComponent : function() {
141 var ipanel
= Ext
.create('PVE.qemu.ProcessorInputPanel');
144 subject
: gettext('Processors'),
151 success: function(response
, options
) {
152 var data
= response
.result
.data
;
153 var value
= data
.cpu
;
155 var cpu
= PVE
.Parser
.parseQemuCpu(value
);
157 data
.cputype
= cpu
.cputype
;
159 var flags
= cpu
.flags
.split(';');
160 flags
.forEach(function(flag
) {
161 var sign
= flag
.substr(0,1);
162 flag
= flag
.substr(1);
163 data
[flag
] = (sign
=== '+');