From ad9091d0d11b602a5f37a1bd3071a61939282d11 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 18 May 2021 18:17:55 +0200 Subject: [PATCH] ui: ha/Group Edit: use simple map+join to serialize nodes-prio Signed-off-by: Thomas Lamprecht --- www/manager6/ha/GroupEdit.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/www/manager6/ha/GroupEdit.js b/www/manager6/ha/GroupEdit.js index 3fb190b0..2c42de6b 100644 --- a/www/manager6/ha/GroupEdit.js +++ b/www/manager6/ha/GroupEdit.js @@ -123,19 +123,9 @@ Ext.define('PVE.ha.GroupInputPanel', { }; update_nodefield = function(selected) { - var nodes = ''; - var first_iteration = true; - Ext.Array.each(selected, function(record) { - if (!first_iteration) { - nodes += ','; - } - first_iteration = false; - - nodes += record.data.node; - if (record.data.priority) { - nodes += ':' + record.data.priority; - } - }); + let nodes = selected + .map(({ data }) => data.node + (data.priority ? `:${data.priority}` : '')) + .join(','); // nodefield change listener calls us again, which results in a // endless recursion, suspend the event temporary to avoid this