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 E16FA1FF0B7 for ; Fri, 30 Oct 2026 13:43:08 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E9260214FD; Fri, 30 Oct 2026 13:43:05 +0100 (CET) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH manager] ui: qemu: rename button label 'Edit' to 'Attach' for unused disks Date: Fri, 30 Oct 2026 13:42:35 +0100 Message-ID: <20261030124235.124337-1-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793364177972 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.463 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: M7DOPJ3L4I4A24OYIYAYNDJNSW3FR2EQ X-Message-ID-Hash: M7DOPJ3L4I4A24OYIYAYNDJNSW3FR2EQ 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 jittering when switching between labels of different lengths, apply the same maximum-width calculation hack on render that is already used for the remove button. Signed-off-by: Elias Huhsovitz --- www/manager6/qemu/HardwareView.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index 8b932995..3a59658a 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -474,9 +474,26 @@ Ext.define('PVE.qemu.HardwareView', { let edit_btn = new Proxmox.button.Button({ text: gettext('Edit'), + defaultText: gettext('Edit'), + altText: gettext('Attach'), selModel: sm, disabled: true, handler: run_editor, + listeners: { + render: function (btn) { + // hack: calculate the max button width on first display to prevent the whole + // toolbar to move when we switch between the "Edit" and "Attach" labels + var def = btn.getSize().width; + + btn.setText(btn.altText); + var alt = btn.getSize().width; + + btn.setText(btn.defaultText); + + var optimal = alt > def ? alt : def; + btn.setSize({ width: optimal }); + }, + }, }); let runEfiEnroll = function () { @@ -818,6 +835,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