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', { ...@@ -2,11 +2,17 @@ Ext.define('PVE.grid.PendingObjectGrid', {
extend: 'Ext.grid.GridPanel', extend: 'Ext.grid.GridPanel',
alias: ['widget.pvePendingObjectGrid'], alias: ['widget.pvePendingObjectGrid'],
getObjectValue: function(key, defaultValue) { getObjectValue: function(key, defaultValue, pending) {
var me = this; var me = this;
var rec = me.store.getById(key); var rec = me.store.getById(key);
if (rec) { if (rec) {
if (pending && rec.data['pending']) {
return rec.data['pending'];
}else if (rec.data.value) {
return rec.data.value; return rec.data.value;
}else {
return defaultValue;
}
} }
return defaultValue; return defaultValue;
}, },
...@@ -30,8 +36,11 @@ Ext.define('PVE.grid.PendingObjectGrid', { ...@@ -30,8 +36,11 @@ Ext.define('PVE.grid.PendingObjectGrid', {
if (renderer) { if (renderer) {
current = renderer(value, metaData, record, rowIndex, colIndex, store); current = renderer(value, metaData, record, rowIndex, colIndex, store);
if(record.data['pending']){ if(record.data['pending'] || rowdef.multiValues){
pending = renderer(record.data['pending'], metaData, record, rowIndex, colIndex, store); pending = renderer(record.data['pending'], metaData, record, rowIndex, colIndex, store, 1);
}
if(pending == current) {
pending = undefined;
} }
}else{ }else{
current = value; current = value;
......
...@@ -61,14 +61,17 @@ Ext.define('PVE.qemu.HardwareView', { ...@@ -61,14 +61,17 @@ Ext.define('PVE.qemu.HardwareView', {
'PVE.qemu.ProcessorEdit' : undefined, 'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor', tdCls: 'pve-itype-icon-processor',
defaultValue: 1, defaultValue: 1,
renderer: function(value, metaData, record, rowIndex, colIndex, store) { multiValues: 1,
var model = me.getObjectValue('cpu'); renderer: function(value, metaData, record, rowIndex, colIndex, store, pending) {
var cores = me.getObjectValue('cores');
var sockets = me.getObjectValue('sockets', 1, pending);
var model = me.getObjectValue('cpu', undefined, pending);
var cores = me.getObjectValue('cores', undefined, pending);
var res = ''; var res = '';
if (!cores || (cores <= 1)) { if (!cores || (cores <= 1)) {
res = value; res = sockets;
} else { } else {
res = (value*cores) + ' (' + value + ' sockets, ' + cores + ' cores)'; res = (sockets*cores) + ' (' + sockets + ' sockets, ' + cores + ' cores)';
} }
if (model) { if (model) {
res += ' [' + 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