]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: add SafeDestroyGuest window
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 19 Apr 2021 13:14:37 +0000 (15:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Apr 2021 10:48:41 +0000 (12:48 +0200)
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@proxmox.com>
www/manager6/Makefile
www/manager6/window/SafeDestroyGuest.js [new file with mode: 0644]

index a2f7be6d462f61d6b4d67bbcacb7cf30baad14d7..6fc4cde54285b071aa0de56da965302c3f58956d 100644 (file)
@@ -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 (file)
index 0000000..d612159
--- /dev/null
@@ -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();
+    },
+});