Commit a368ac3e authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

fix pending cpu rendering

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent 93ebca24
......@@ -2,11 +2,17 @@ Ext.define('PVE.grid.PendingObjectGrid', {
extend: 'Ext.grid.GridPanel',
alias: ['widget.pvePendingObjectGrid'],
getObjectValue: function(key, defaultValue) {
getObjectValue: function(key, defaultValue, pending) {
var me = this;
var rec = me.store.getById(key);
if (rec) {
return rec.data.value;
if (pending && rec.data['pending']) {
return rec.data['pending'];
}else if (rec.data.value) {
return rec.data.value;
}else {
return defaultValue;
}
}
return defaultValue;
},
......@@ -30,8 +36,11 @@ Ext.define('PVE.grid.PendingObjectGrid', {
if (renderer) {
current = renderer(value, metaData, record, rowIndex, colIndex, store);
if(record.data['pending']){
pending = renderer(record.data['pending'], metaData, record, rowIndex, colIndex, store);
if(record.data['pending'] || rowdef.multiValues){
pending = renderer(record.data['pending'], metaData, record, rowIndex, colIndex, store, 1);
}
if(pending == current) {
pending = undefined;
}
}else{
current = value;
......
......@@ -61,14 +61,17 @@ Ext.define('PVE.qemu.HardwareView', {
'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor',
defaultValue: 1,
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
var model = me.getObjectValue('cpu');
var cores = me.getObjectValue('cores');
multiValues: 1,
renderer: function(value, metaData, record, rowIndex, colIndex, store, pending) {
var sockets = me.getObjectValue('sockets', 1, pending);
var model = me.getObjectValue('cpu', undefined, pending);
var cores = me.getObjectValue('cores', undefined, pending);
var res = '';
if (!cores || (cores <= 1)) {
res = value;
res = sockets;
} else {
res = (value*cores) + ' (' + value + ' sockets, ' + cores + ' cores)';
res = (sockets*cores) + ' (' + sockets + ' sockets, ' + cores + ' cores)';
}
if (model) {
res += ' [' + model + ']';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment