]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/window/SafeDestroy.js
drop jslint lines
[pve-manager.git] / www / manager6 / window / SafeDestroy.js
index f89d0fa75c24f0052ca613426caabc3429398e72..cc32f6e0767e8cf5661ef4b7cedd5d3e160c0827 100644 (file)
@@ -1,5 +1,5 @@
 /* Popup a message window
- * where the user has to manually enter the ressource ID
+ * where the user has to manually enter the resource ID
  * to enable the destroy button
  */
 Ext.define('PVE.window.SafeDestroy', {
@@ -26,6 +26,10 @@ Ext.define('PVE.window.SafeDestroy', {
 
     getParams: function() {
        var me = this;
+       var purgeCheckbox = me.lookupReference('purgeCheckbox');
+       if (purgeCheckbox.checked) {
+           me.params.purge = 1;
+       }
        if (Ext.Object.isEmpty(me.params)) {
            return '';
        }
@@ -121,6 +125,17 @@ Ext.define('PVE.window.SafeDestroy', {
                    labelWidth: 300,
                    hideTrigger: true,
                    allowBlank: false
+               },
+               {
+                   xtype: 'proxmoxcheckbox',
+                   name: 'purge',
+                   reference: 'purgeCheckbox',
+                   boxLabel: gettext('Purge'),
+                   checked: false,
+                   autoEl: {
+                       tag: 'div',
+                       'data-qtip': gettext('Remove from replication and backup jobs')
+                   }
                }
            ]
        }
@@ -157,12 +172,20 @@ Ext.define('PVE.window.SafeDestroy', {
            msg = Proxmox.Utils.format_task_description('vzdestroy', item.id);
        } else if (item.type === 'CephPool') {
            msg = Proxmox.Utils.format_task_description('cephdestroypool', item.id);
+       } else if (item.type === 'Image') {
+           msg = Proxmox.Utils.format_task_description('unknownimgdel', item.id);
        } else {
            throw "unknown item type specified";
        }
 
        messageCmp.setHtml(msg);
 
+       if (!(item.type === 'VM' || item.type === 'CT')) {
+           let purgeCheckbox = me.lookupReference('purgeCheckbox');
+           purgeCheckbox.setDisabled(true);
+           purgeCheckbox.setHidden(true);
+       }
+
        var confirmField = me.lookupReference('confirmField');
        msg = gettext('Please enter the ID to confirm') +
            ' (' + item.id + ')';