fix diffstore issue with clusterlog

extjs cannot "convert" and id from other fields, so the ids in the
diffstore and the realstore are different and we re-add every element on
every update

to mitigate this, we generate the id (which is "uid:hostname") in the
backend, and simply use it in the frontend

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-03-10 10:12:25 +01:00 committed by Dietmar Maurer
parent 40342aa6c4
commit 0c8d740228
2 changed files with 5 additions and 14 deletions

View File

@ -132,6 +132,10 @@ __PACKAGE__->register_method({
my $res = decode_json(PVE::Cluster::get_cluster_log($loguser, $max));
foreach my $entry (@{$res->{data}}) {
$entry->{id} = "$entry->{uid}:$entry->{node}";
}
return $res->{data};
}});

View File

@ -95,20 +95,7 @@ Ext.define('PVE.RestProxy', {
{ name: 'time', type : 'date', dateFormat: 'timestamp' },
{ name: 'pri', type: 'int' },
{ name: 'pid', type: 'int' },
'node', 'user', 'tag', 'msg',
{
name: 'id',
convert: function(value, record) {
var info = record.data;
var text;
if (value) {
return value;
}
// compute unique ID
return info.uid + ':' + info.node;
}
}
'node', 'user', 'tag', 'msg', 'id'
],
idProperty: 'id'
});