ui: node: storage removal: add checkbox for cleaning up disks

and factor out a SafeDestroyStorage sub-class to avoid duplication.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2021-10-25 15:47:54 +02:00 committed by Fabian Grünbichler
parent 14066c09ce
commit bccfb43f9f
6 changed files with 36 additions and 8 deletions

View File

@ -105,6 +105,7 @@ JSSRC= \
window/Prune.js \
window/Restore.js \
window/SafeDestroyGuest.js \
window/SafeDestroyStorage.js \
window/Settings.js \
window/Snapshot.js \
window/StartupEdit.js \

View File

@ -90,10 +90,9 @@ Ext.define('PVE.node.Directorylist', {
throw "no directory name specified";
}
Ext.create('Proxmox.window.SafeDestroy', {
Ext.create('PVE.window.SafeDestroyStorage', {
url: `/nodes/${view.nodename}/disks/directory/${dirName}`,
item: { id: dirName },
showProgress: true,
taskName: 'dirremove',
taskDone: () => { view.reload(); },
}).show();

View File

@ -76,10 +76,9 @@ Ext.define('PVE.node.LVMList', {
throw "no volume group specified";
}
Ext.create('Proxmox.window.SafeDestroy', {
Ext.create('PVE.window.SafeDestroyStorage', {
url: `/nodes/${view.nodename}/disks/lvm/${volumeGroup}`,
item: { id: volumeGroup },
showProgress: true,
taskName: 'lvmremove',
taskDone: () => { view.reload(); },
}).show();

View File

@ -80,11 +80,10 @@ Ext.define('PVE.node.LVMThinList', {
throw "no volume group specified";
}
Ext.create('Proxmox.window.SafeDestroy', {
Ext.create('PVE.window.SafeDestroyStorage', {
url: `/nodes/${view.nodename}/disks/lvmthin/${thinPool}`,
params: { 'volume-group': volumeGroup },
item: { id: `${volumeGroup}/${thinPool}` },
showProgress: true,
taskName: 'lvmthinremove',
taskDone: () => { view.reload(); },
}).show();

View File

@ -321,10 +321,9 @@ Ext.define('PVE.node.ZFSList', {
throw "no pool specified";
}
Ext.create('Proxmox.window.SafeDestroy', {
Ext.create('PVE.window.SafeDestroyStorage', {
url: `/nodes/${view.nodename}/disks/zfs/${pool}`,
item: { id: pool },
showProgress: true,
taskName: 'zfsremove',
taskDone: () => { view.reload(); },
}).show();

View File

@ -0,0 +1,31 @@
/*
* SafeDestroy window with additional checkboxes for removing a storage on the disk level.
*/
Ext.define('PVE.window.SafeDestroyStorage', {
extend: 'Proxmox.window.SafeDestroy',
alias: 'widget.pveSafeDestroyStorage',
showProgress: true,
additionalItems: [
{
xtype: 'proxmoxcheckbox',
name: 'wipeDisks',
reference: 'wipeDisksCheckbox',
boxLabel: gettext('Cleanup Disks'),
checked: true,
autoEl: {
tag: 'div',
'data-qtip': gettext('Wipe labels and other left-overs'),
},
},
],
getParams: function() {
let me = this;
me.params['cleanup-disks'] = me.lookupReference('wipeDisksCheckbox').checked ? 1 : 0;
return me.callParent();
},
});