[pve-devel] [PATCH manager v2 2/3] ui: ObjectPendingGrid: slightly refactor renderValue
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Sep 1 15:38:43 CEST 2017
On 09/01/2017 11:31 AM, Fabian Grünbichler wrote:
> On Thu, Aug 31, 2017 at 02:26:00PM +0200, Thomas Lamprecht wrote:
>> ---
>>
>> new in v2
>>
>> www/manager6/grid/PendingObjectGrid.js | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/www/manager6/grid/PendingObjectGrid.js b/www/manager6/grid/PendingObjectGrid.js
>> index d5702f2e..43889456 100644
>> --- a/www/manager6/grid/PendingObjectGrid.js
>> +++ b/www/manager6/grid/PendingObjectGrid.js
>> @@ -52,7 +52,7 @@ Ext.define('PVE.grid.PendingObjectGrid', {
>> pending = renderer(record.data.pending, metaData, record, rowIndex, colIndex, store, true);
>> }
>> if (pending == current) {
>> - pending = undefined;
>> + pending = '';
>> }
>> } else {
>> current = value || '';
>> @@ -64,10 +64,9 @@ Ext.define('PVE.grid.PendingObjectGrid', {
>> }
>>
>> if (pending || pendingdelete) {
>> - return current + '<div style="color:red">' + (pending || '') + pendingdelete + '</div>';
>> - } else {
>> - return current;
>> + current += '<div style="color:red">' + pending + pendingdelete + '</div>';
>
> this leads to
>
> old value
> undefined (orange)
> old value (orange, strikethrough)
>
> needs further discussion on how and where to handle that pesky undefined
> ;)
>
That would be a small fix, in the case where no special renderer was configured pending
could become possibly undefined too:
if (renderer) {
[..]
} else {
current = value || '';
pending = record.data.pending; // this would need the same as above: || ''
}
But wWe saw that the current handling of this with multiKeys (Processors and Boot
entries) is quite flawed. If a change and a delete are pending at the same time on
properties combined with multikey, you have no idea what happens, as a user. E.g.
delete sockets and set core to pending:
[PENDING]
cores: 1
delete: cores
# for bonus point make numa and cpu type pending too...
All gets stroked-through and the changes go under
So this need another approach to address those issues too.
>> }
>> + return current;
>> },
>>
>> initComponent : function() {
>> --
>> 2.11.0
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel at pve.proxmox.com
>> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
More information about the pve-devel
mailing list