From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 73FED1FF0AA for ; Tue, 03 Nov 2026 10:27:47 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2F9EF2184A; Tue, 03 Nov 2026 10:27:40 +0100 (CET) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 1/3] ui: lxc/qemu: rename button label 'Edit' to 'Attach' for unused disks Date: Tue, 3 Nov 2026 10:27:28 +0100 Message-ID: <20261103092730.21635-2-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261103092730.21635-1-e.huhsovitz@proxmox.com> References: <20261103092730.21635-1-e.huhsovitz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793698054812 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.441 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: JTFZR4ALO3HLHRNMM6Q4RBPOMDH22QZB X-Message-ID-Hash: JTFZR4ALO3HLHRNMM6Q4RBPOMDH22QZB X-MailFrom: e.huhsovitz@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 CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently, adding an unused (detached) disk requires the user to select the disk and click the generic "Edit" button. This is confusing, because: (1) The "Edit" label does not implicitly convey the action of adding/attaching the disk. (2) The action to make a disk unused is explicitly labeled "Detach", so a user expects a contrary "Attach" button. Harmonize the UI terminology by dynamically changing the "Edit" button label to "Attach" when an unused disk is selected. This mirrors the existing behavior of the "Remove" button, which changes to "Detach" for used disks. To prevent the toolbar from moving when switching between labels of different lengths, change the edit button to a proxmoxAltTextButton. Signed-off-by: Elias Huhsovitz --- www/manager6/lxc/Resources.js | 7 +++++-- www/manager6/qemu/HardwareView.js | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js index df513bb7..40321d03 100644 --- a/www/manager6/lxc/Resources.js +++ b/www/manager6/lxc/Resources.js @@ -217,15 +217,17 @@ Ext.define('PVE.lxc.RessourceView', { }); }; - var edit_btn = new Proxmox.button.Button({ + let edit_btn = new Proxmox.button.AltText({ text: gettext('Edit'), + defaultText: gettext('Edit'), + altText: gettext('Attach'), selModel: me.selModel, disabled: true, enableFn: function (rec) { if (!rec) { return false; } - var rowdef = rows[rec.data.key]; + let rowdef = rows[rec.data.key]; return !!rowdef.editor; }, handler: function () { @@ -332,6 +334,7 @@ Ext.define('PVE.lxc.RessourceView', { } } edit_btn.setDisabled(noedit); + edit_btn.setText(isUnusedDisk ? edit_btn.altText : edit_btn.defaultText); volumeaction_btn.setDisabled(!isDisk || !diskCap); move_menuitem.setDisabled(isUnusedDisk); diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index 8b932995..3eebd05f 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -472,8 +472,10 @@ Ext.define('PVE.qemu.HardwareView', { } }; - let edit_btn = new Proxmox.button.Button({ + let edit_btn = new Proxmox.button.AltText({ text: gettext('Edit'), + defaultText: gettext('Edit'), + altText: gettext('Attach'), selModel: sm, disabled: true, handler: run_editor, @@ -818,6 +820,10 @@ Ext.define('PVE.qemu.HardwareView', { (isDisk && !diskCap), ); + edit_btn.setText( + isUnusedDisk && !isCloudInit ? edit_btn.altText : edit_btn.defaultText, + ); + diskaction_btn.setDisabled( pending || !diskCap || isCloudInit || !(isDisk || isEfi || tpmMoveable), ); -- 2.47.3