From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D3ED81FF141 for ; Mon, 30 Mar 2026 16:47:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AB23D2A8C; Mon, 30 Mar 2026 16:47:11 +0200 (CEST) From: =?UTF-8?q?Michael=20K=C3=B6ppl?= To: pve-devel@lists.proxmox.com Subject: [PATCH manager 4/5] ui: cluster info: move initialization of items to initComponent Date: Mon, 30 Mar 2026 16:43:20 +0200 Message-ID: <20260330144321.321072-5-m.koeppl@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260330144321.321072-1-m.koeppl@proxmox.com> References: <20260330144321.321072-1-m.koeppl@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774881748447 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.091 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: NWEZ3JOFG2N35V4UJWXZ77VJLYMDWXGC X-Message-ID-Hash: NWEZ3JOFG2N35V4UJWXZ77VJLYMDWXGC X-MailFrom: m.koeppl@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This allows conditionally adding items to the form. Signed-off-by: Michael Köppl --- Preparatory patch, no functional changes intended. www/manager6/dc/ClusterEdit.js | 102 +++++++++++++++++---------------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/www/manager6/dc/ClusterEdit.js b/www/manager6/dc/ClusterEdit.js index 109325855..aff1515ab 100644 --- a/www/manager6/dc/ClusterEdit.js +++ b/www/manager6/dc/ClusterEdit.js @@ -57,58 +57,64 @@ Ext.define('PVE.ClusterInfoWindow', { totem: {}, }, - items: [ - { - xtype: 'component', - border: false, - padding: '10 10 10 10', - html: gettext('Copy the Join Information here and use it on the node you want to add.'), - }, - { - xtype: 'container', - layout: 'form', - border: false, - padding: '0 10 10 10', - items: [ - { - xtype: 'textfield', - fieldLabel: gettext('IP Address'), - cbind: { - value: '{joinInfo.ipAddress}', - }, - editable: false, - }, - { - xtype: 'textfield', - fieldLabel: gettext('Fingerprint'), - cbind: { - value: '{joinInfo.fingerprint}', + initComponent: function () { + var me = this; + + var joinInfo = me.joinInfo; + + me.items = []; + + me.items.push( + { + xtype: 'component', + border: false, + padding: '10 10 10 10', + html: gettext( + 'Copy the Join Information here and use it on the node you want to add.', + ), + }, + { + xtype: 'container', + layout: 'form', + border: false, + padding: '0 10 10 10', + items: [ + { + xtype: 'textfield', + fieldLabel: gettext('IP Address'), + value: joinInfo.ipAddress, + editable: false, }, - editable: false, - }, - { - xtype: 'textarea', - inputId: 'pveSerializedClusterInfo', - fieldLabel: gettext('Join Information'), - grow: true, - cbind: { - joinInfo: '{joinInfo}', + { + xtype: 'textfield', + fieldLabel: gettext('Fingerprint'), + value: joinInfo.fingerprint, + editable: false, }, - editable: false, - listeners: { - afterrender: function (field) { - if (!field.joinInfo) { - return; - } - var jsons = Ext.JSON.encode(field.joinInfo); - var base64s = Ext.util.Base64.encode(jsons); - field.setValue(base64s); + { + xtype: 'textarea', + inputId: 'pveSerializedClusterInfo', + fieldLabel: gettext('Join Information'), + grow: true, + joinInfo: joinInfo, + editable: false, + listeners: { + afterrender: function (field) { + if (!field.joinInfo) { + return; + } + var jsons = Ext.JSON.encode(field.joinInfo); + var base64s = Ext.util.Base64.encode(jsons); + field.setValue(base64s); + }, }, }, - }, - ], - }, - ], + ], + }, + ); + + me.callParent(); + }, dockedItems: [ { dock: 'bottom', -- 2.47.3