While the format_task_description function is used in other parts of the
UI, this still leaves these use cases intact. The guest name is an
optional addition in parantheses.

Signed-off-by: Michael Köppl <m.koe...@proxmox.com>
---
 src/Utils.js              | 8 ++++++--
 src/window/SafeDestroy.js | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/Utils.js b/src/Utils.js
index c873c85..a64d07f 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -716,7 +716,7 @@ utilities: {
        }
     },
 
-    format_task_description: function(type, id) {
+    format_task_description: function(type, id, name) {
        let farray = Proxmox.Utils.task_desc_table[type];
        let text;
        if (!farray) {
@@ -731,7 +731,11 @@ utilities: {
        let prefix = farray[0];
        text = farray[1];
        if (prefix && id !== undefined) {
-           return prefix + ' ' + id + ' - ' + text;
+           let fullText = prefix + ' ' + id;
+           if (name) {
+               fullText += " (" + name + ")";
+           }
+           return fullText + " - " + text;
        }
        return text;
     },
diff --git a/src/window/SafeDestroy.js b/src/window/SafeDestroy.js
index c058465..d980a52 100644
--- a/src/window/SafeDestroy.js
+++ b/src/window/SafeDestroy.js
@@ -187,9 +187,10 @@ Ext.define('Proxmox.window.SafeDestroy', {
        }
 
        let taskName = me.getTaskName();
+       const itemName = me.getItem().name;
        if (Ext.isDefined(taskName)) {
            me.lookupReference('messageCmp').setHtml(
-               Proxmox.Utils.format_task_description(taskName, itemId),
+               Proxmox.Utils.format_task_description(taskName, itemId, 
itemName),
            );
        } 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 via email to