public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit v2 1/1] close #3181: ui: add formatted guest identifier to safe destroy dialog window
Date: Mon, 31 Mar 2025 15:31:53 +0200	[thread overview]
Message-ID: <20250331133154.148713-2-m.koeppl@proxmox.com> (raw)
In-Reply-To: <20250331133154.148713-1-m.koeppl@proxmox.com>

Adds a formatted guest identifier (e.g. "VMID (VM name)") to the
SafeDestroy window. The formatted identifier is only used if it is
explicitly set by the caller. Otherwise, the VMID is used, avoiding
changes in behavior for other components.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 src/window/SafeDestroy.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/window/SafeDestroy.js b/src/window/SafeDestroy.js
index c058465..a19747d 100644
--- a/src/window/SafeDestroy.js
+++ b/src/window/SafeDestroy.js
@@ -26,6 +26,7 @@ Ext.define('Proxmox.window.SafeDestroy', {
     config: {
 	item: {
 	    id: undefined,
+	    formattedIdentifier: undefined,
 	},
 	url: undefined,
 	note: undefined,
@@ -187,9 +188,13 @@ Ext.define('Proxmox.window.SafeDestroy', {
 	}
 
 	let taskName = me.getTaskName();
+	let formattedIdentifier = me.getItem().formattedIdentifier;
 	if (Ext.isDefined(taskName)) {
 	    me.lookupReference('messageCmp').setHtml(
-		Proxmox.Utils.format_task_description(taskName, itemId),
+		Proxmox.Utils.format_task_description(
+		    taskName,
+		    formattedIdentifier ? formattedIdentifier : itemId,
+		),
 	    );
 	} else {
 	    throw "no task name specified";
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2025-03-31 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 13:31 [pve-devel] [PATCH manager/widget-toolkit v2 0/2] close #3181: ui: display guest name in confirm dialogs Michael Köppl
2025-03-31 13:31 ` Michael Köppl [this message]
2025-04-04 15:04   ` [pve-devel] [PATCH widget-toolkit v2 1/1] close #3181: ui: add formatted guest identifier to safe destroy dialog window Thomas Lamprecht
2025-04-07  8:42     ` Michael Köppl
2025-03-31 13:31 ` [pve-devel] [PATCH manager v2 1/1] close #3181: ui: display guest name in confirm dialogs Michael Köppl

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=20250331133154.148713-2-m.koeppl@proxmox.com \
    --to=m.koeppl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal