From faacb77fb428734b2175d16e93d451c9d662417f Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 3 Jul 2021 16:06:14 +0200 Subject: [PATCH] node: repo: avoid using IDs on elements, as that breaks easily on clusters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Anything where more instances can exist, even if only for a very short time, must NOT use `id` as that needs to be unique in all current instances of components/elements of the whole gui. Here it broke most of the gui when switching between node, as the new nodes repo gui was instantiated before the old ones was completely destroyed, so there where (at least) two elements with the same id -> 💥 boom. Signed-off-by: Thomas Lamprecht --- src/node/APTRepositories.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js index 87ac022..c4848a0 100644 --- a/src/node/APTRepositories.js +++ b/src/node/APTRepositories.js @@ -159,7 +159,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', { }, { text: gettext('Add'), - id: 'addButton', + name: 'addRepo', disabled: true, repoInfo: undefined, handler: function(button, event, record) { @@ -192,7 +192,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', { text: gettext('Enable'), defaultText: gettext('Enable'), altText: gettext('Disable'), - id: 'repoEnableButton', + name: 'repoEnable', disabled: true, bind: { text: '{enableButtonText}', @@ -602,9 +602,9 @@ Ext.define('Proxmox.node.APTRepositories', { let me = this; let vm = me.getViewModel(); - let addButton = me.down('#addButton'); - addButton.repoInfo = []; + let addButton = me.down('button[name=addRepo]'); + addButton.repoInfo = []; for (const standardRepo of standardRepos) { const handle = standardRepo.handle; const status = standardRepo.status; -- 2.39.2