[pve-devel] [PATCH manager 3/7] ui: add SafeDestroyGuest window

Fabian Ebner f.ebner at proxmox.com
Mon Apr 19 15:14:37 CEST 2021


The purge parameter is always explicitly set, which is different from the
existing behavior, but it does not rely on what the default in the backend is.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Dependency bump for proxmox-widget-toolkit is needed.

 www/manager6/Makefile                   |  1 +
 www/manager6/window/SafeDestroyGuest.js | 30 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 www/manager6/window/SafeDestroyGuest.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index a2f7be6d..6fc4cde5 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -100,6 +100,7 @@ JSSRC= 							\
 	window/Prune.js					\
 	window/Restore.js				\
 	window/SafeDestroy.js				\
+	window/SafeDestroyGuest.js			\
 	window/Settings.js				\
 	window/Snapshot.js				\
 	window/StartupEdit.js				\
diff --git a/www/manager6/window/SafeDestroyGuest.js b/www/manager6/window/SafeDestroyGuest.js
new file mode 100644
index 00000000..d6121594
--- /dev/null
+++ b/www/manager6/window/SafeDestroyGuest.js
@@ -0,0 +1,30 @@
+/*
+ * SafeDestroy window with additional checkboxes for removing guests
+ */
+Ext.define('PVE.window.SafeDestroyGuest', {
+    extend: 'Proxmox.window.SafeDestroy',
+    alias: 'proxmoxSafeDestroy',
+
+    additionalItems: [
+	{
+	    xtype: 'proxmoxcheckbox',
+	    name: 'purge',
+	    reference: 'purgeCheckbox',
+	    boxLabel: gettext('Purge'),
+	    checked: false,
+	    autoEl: {
+		tag: 'div',
+		'data-qtip': gettext('Remove from replication and backup jobs'),
+	    },
+	},
+    ],
+
+    getParams: function() {
+	let me = this;
+
+	const purgeCheckbox = me.lookupReference('purgeCheckbox');
+	me.params.purge = purgeCheckbox.checked ? 1 : 0;
+
+	return me.callParent();
+    },
+});
-- 
2.20.1






More information about the pve-devel mailing list