]>
Commit | Line | Data |
---|---|---|
bbace04b DM |
1 | Ext.define('PVE.qemu.CPUOptionsInputPanel', { |
2 | extend: 'PVE.panel.InputPanel', | |
3 | alias: 'widget.PVE.qemu.CPUOptionsInputPanel', | |
4 | ||
5 | onGetValues: function(values) { | |
6 | var me = this; | |
7 | ||
fe4f00ad TL |
8 | PVE.Utils.delete_if_default(values, 'cpulimit', '0', 0); |
9 | PVE.Utils.delete_if_default(values, 'cpuunits', '1024', 0); | |
bbace04b | 10 | |
bbace04b DM |
11 | return values; |
12 | }, | |
fe4f00ad | 13 | |
bbace04b DM |
14 | initComponent : function() { |
15 | var me = this; | |
16 | ||
17 | var items = [ | |
18 | { | |
bf96f60d | 19 | xtype: 'proxmoxintegerfield', |
bbace04b DM |
20 | name: 'vcpus', |
21 | minValue: 1, | |
22 | maxValue: me.maxvcpus, | |
23 | value: '', | |
185a77e5 | 24 | fieldLabel: gettext('VCPUs'), |
bf96f60d | 25 | deleteEmpty: true, |
bbace04b DM |
26 | allowBlank: true, |
27 | emptyText: me.maxvcpus | |
28 | }, | |
29 | { | |
30 | xtype: 'numberfield', | |
31 | name: 'cpulimit', | |
32 | minValue: 0, | |
33 | maxValue: me.maxvcpus, | |
34 | value: '', | |
35 | step: 1, | |
36 | fieldLabel: gettext('CPU limit'), | |
37 | allowBlank: true, | |
38 | emptyText: gettext('unlimited') | |
39 | }, | |
40 | { | |
bf96f60d | 41 | xtype: 'proxmoxintegerfield', |
bbace04b DM |
42 | name: 'cpuunits', |
43 | fieldLabel: gettext('CPU units'), | |
44 | minValue: 8, | |
45 | maxValue: 500000, | |
ec0bd652 | 46 | value: '1024', |
bf96f60d | 47 | deleteEmpty: true, |
bbace04b DM |
48 | allowBlank: true |
49 | } | |
50 | ]; | |
51 | ||
52 | me.items = items; | |
53 | ||
54 | me.callParent(); | |
55 | } | |
56 | }); | |
57 | ||
58 | Ext.define('PVE.qemu.CPUOptions', { | |
9fccc702 | 59 | extend: 'Proxmox.window.Edit', |
bbace04b DM |
60 | |
61 | initComponent : function() { | |
62 | var me = this; | |
63 | ||
64 | var ipanel = Ext.create('PVE.qemu.CPUOptionsInputPanel', { | |
22f2f9d6 | 65 | maxvcpus: me.maxvcpus |
bbace04b DM |
66 | }); |
67 | ||
68 | Ext.apply(me, { | |
69 | subject: gettext('CPU options'), | |
ec0bd652 | 70 | items: [ ipanel ] |
bbace04b DM |
71 | }); |
72 | ||
73 | me.callParent(); | |
74 | ||
75 | me.load(); | |
76 | } | |
77 | }); |