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 FOLLOW-UP manager 1/1] ui: replace SafeDestroy with ConfirmRemoveDialog
Date: Wed, 24 Sep 2025 18:17:14 +0200	[thread overview]
Message-ID: <20250924161714.434858-3-m.koeppl@proxmox.com> (raw)
In-Reply-To: <20250924161714.434858-1-m.koeppl@proxmox.com>

The ConfirmRemoveDialog offers additional customization, but covers
SafeDestroy's feature set. This is done mostly to streamline the
implementation, basing dialogs to remove guests, storage, or resources
on the same component.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 www/manager6/window/SafeDestroyGuest.js   | 26 ++++++++++++++++++++++-
 www/manager6/window/SafeDestroyStorage.js | 23 +++++++++++++++++++-
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/www/manager6/window/SafeDestroyGuest.js b/www/manager6/window/SafeDestroyGuest.js
index ee0c649c9..291702141 100644
--- a/www/manager6/window/SafeDestroyGuest.js
+++ b/www/manager6/window/SafeDestroyGuest.js
@@ -2,9 +2,14 @@
  * SafeDestroy window with additional checkboxes for removing guests
  */
 Ext.define('PVE.window.SafeDestroyGuest', {
-    extend: 'Proxmox.window.SafeDestroy',
+    extend: 'Proxmox.window.ConfirmRemoveDialog',
     alias: 'widget.pveSafeDestroyGuest',
 
+    confirmButtonText: 'Remove',
+    declineButtonText: null,
+
+    dangerous: true,
+
     additionalItems: [
         {
             xtype: 'proxmoxcheckbox',
@@ -32,8 +37,27 @@ Ext.define('PVE.window.SafeDestroyGuest', {
         },
     ],
 
+    config: {
+        text: undefined,
+        item: {
+            id: undefined,
+            formattedIdentifier: undefined,
+        },
+        taskName: undefined,
+    },
+
     note: gettext('Referenced disks will always be destroyed.'),
 
+    getText: function () {
+        let me = this;
+
+        let identifier = me.getItem().formattedIdentifier ?? me.getItem().id;
+
+        me.text = `${Proxmox.Utils.format_task_description(me.getTaskName(), identifier)}`;
+
+        return me.callParent();
+    },
+
     getParams: function () {
         let me = this;
 
diff --git a/www/manager6/window/SafeDestroyStorage.js b/www/manager6/window/SafeDestroyStorage.js
index 8dcb41317..74cfd5a8c 100644
--- a/www/manager6/window/SafeDestroyStorage.js
+++ b/www/manager6/window/SafeDestroyStorage.js
@@ -2,11 +2,16 @@
  * SafeDestroy window with additional checkboxes for removing a storage on the disk level.
  */
 Ext.define('PVE.window.SafeDestroyStorage', {
-    extend: 'Proxmox.window.SafeDestroy',
+    extend: 'Proxmox.window.ConfirmRemoveDialog',
     alias: 'widget.pveSafeDestroyStorage',
 
     showProgress: true,
 
+    confirmButtonText: 'Remove',
+    declineButtonText: null,
+
+    dangerous: true,
+
     additionalItems: [
         {
             xtype: 'proxmoxcheckbox',
@@ -28,6 +33,22 @@ Ext.define('PVE.window.SafeDestroyStorage', {
         },
     ],
 
+    config: {
+        text: undefined,
+        item: {
+            id: undefined,
+        },
+        taskName: undefined,
+    },
+
+    getText: function () {
+        let me = this;
+
+        me.text = `${Proxmox.Utils.format_task_description(me.getTaskName(), me.getItem().id)}`;
+
+        return me.callParent();
+    },
+
     getParams: function () {
         let me = this;
 
-- 
2.47.3



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

      parent reply	other threads:[~2025-09-24 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 16:17 [pve-devel] [PATCH FOLLOW-UP manager/widget-toolkit 0/2] replace SafeDestroy Michael Köppl
2025-09-24 16:17 ` [pve-devel] [PATCH FOLLOW-UP widget-toolkit 1/1] window: remove SafeDestroy Michael Köppl
2025-09-24 16:17 ` Michael Köppl [this message]

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=20250924161714.434858-3-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