From: Elias Huhsovitz <e.huhsovitz@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Elias Huhsovitz <e.huhsovitz@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 [thread overview]
Message-ID: <20261103092730.21635-2-e.huhsovitz@proxmox.com> (raw)
In-Reply-To: <20261103092730.21635-1-e.huhsovitz@proxmox.com>
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 <e.huhsovitz@proxmox.com>
---
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
next prev parent reply other threads:[~2026-11-03 9:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 9:27 [PATCH manager v2 0/3] ui: lxc/qemu: reduce ambiguity when attaching unused disk Elias Huhsovitz
2026-11-03 9:27 ` Elias Huhsovitz [this message]
2026-11-03 9:27 ` [PATCH manager v2 2/3] ui: lxc/qemu: convert buttons displaying altText to proxmoxAltTextButton Elias Huhsovitz
2026-11-03 9:27 ` [PATCH manager v2 3/3] ui: qemu: re-order buttons in hardware tab to match lxc layout Elias Huhsovitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261103092730.21635-2-e.huhsovitz@proxmox.com \
--to=e.huhsovitz@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.