From 0c8d740228e284d8fa1e3746f0fde9f7ac7ab65c Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 10 Mar 2017 10:12:25 +0100 Subject: [PATCH] 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 --- PVE/API2/Cluster.pm | 4 ++++ www/manager6/data/PVEProxy.js | 15 +-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm index b6ccd38d..6ce86de4 100644 --- a/PVE/API2/Cluster.pm +++ b/PVE/API2/Cluster.pm @@ -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}; }}); diff --git a/www/manager6/data/PVEProxy.js b/www/manager6/data/PVEProxy.js index b66eeb68..a3b0b721 100644 --- a/www/manager6/data/PVEProxy.js +++ b/www/manager6/data/PVEProxy.js @@ -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' });