all lists on 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 manager v2 1/2] ui: add ConfirmRemoveResource window
Date: Wed, 24 Sep 2025 18:07:45 +0200	[thread overview]
Message-ID: <20250924160747.430018-7-m.koeppl@proxmox.com> (raw)
In-Reply-To: <20250924160747.430018-1-m.koeppl@proxmox.com>

Add an extended removal dialog for HA resources, which also allows
setting a purge parameter through the checkbox. By default, the purge
option is enabled, updating rules referencing the resource and deleting
any rules that only have this resource left.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 www/manager6/Makefile                        |  1 +
 www/manager6/window/ConfirmRemoveResource.js | 41 ++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 www/manager6/window/ConfirmRemoveResource.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 85f9268d1..17ae49a24 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -120,6 +120,7 @@ JSSRC= 							\
 	window/BulkAction.js				\
 	window/CephInstall.js				\
 	window/Clone.js					\
+	window/ConfirmRemoveResource.js			\
 	window/FirewallEnableEdit.js			\
 	window/FirewallLograteEdit.js			\
 	window/LoginWindow.js				\
diff --git a/www/manager6/window/ConfirmRemoveResource.js b/www/manager6/window/ConfirmRemoveResource.js
new file mode 100644
index 000000000..55b8022ee
--- /dev/null
+++ b/www/manager6/window/ConfirmRemoveResource.js
@@ -0,0 +1,41 @@
+/*
+ * ConfirmRemoveDialog window with additional checkboxes for removing resources
+ */
+Ext.define('PVE.window.ConfirmRemoveResource', {
+    extend: 'Proxmox.window.ConfirmRemoveDialog',
+    alias: 'widget.pveConfirmRemoveResource',
+
+    additionalItems: [
+        {
+            xtype: 'proxmoxcheckbox',
+            name: 'purge',
+            reference: 'purgeCheckbox',
+            boxLabel: gettext('Purge resource from referenced HA rules'),
+            padding: '5 0 0 0',
+            checked: true,
+            autoEl: {
+                tag: 'div',
+                'data-qtip': gettext(
+                    'Also removes resource from HA rules and removes rule if there are no other resources in it',
+                ),
+            },
+        },
+    ],
+
+    getText: function () {
+        let me = this;
+
+        me.text = `Are you sure you want to remove resource '${me.getItem().id}'?`;
+
+        return me.callParent();
+    },
+
+    getParams: function () {
+        let me = this;
+
+        const purgeCheckbox = me.lookupReference('purgeCheckbox');
+        me.params.purge = purgeCheckbox.checked ? 1 : 0;
+
+        return me.callParent();
+    },
+});
-- 
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:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 16:07 [pve-devel] [PATCH container/docs/ha-manager/manager/proxmox-widget-toolkit/qemu-server v2 0/8] fix #6613: update HA rules upon resource deletion Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH ha-manager v2 1/2] fix #6613: update rules containing the resource to be deleted Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH ha-manager v2 2/2] api: add purge parameter for resource deletion Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH qemu-server v2 1/1] fix #6613: pass purge param to delete_service_from_config Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH container " Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH widget-toolkit v2 1/1] window: add ConfirmRemoveDialog Michael Köppl
2025-09-24 16:07 ` Michael Köppl [this message]
2025-09-24 16:07 ` [pve-devel] [PATCH manager v2 2/2] ui: use ConfirmRemoveResource window for removing resources Michael Köppl
2025-09-24 16:07 ` [pve-devel] [PATCH docs v2 1/1] add notes about effects of purge flag for resource and guest removal 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=20250924160747.430018-7-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 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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal