mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-10-18 22:39:47 +00:00
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:
parent
14066c09ce
commit
bccfb43f9f
@ -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 \
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
31
www/manager6/window/SafeDestroyStorage.js
Normal file
31
www/manager6/window/SafeDestroyStorage.js
Normal 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();
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue
Block a user