ui: datastore/Content: add 'Prune All' button
since the api call always starts a real worker, we cannot have a preview. It would also be very hard to show that for all groups in a non-confusing way. We reuse the pbsPruneInputPanel and add the dry-run field there conditionally. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
9805207aa5
commit
afbf2e10f3
@ -340,6 +340,35 @@ Ext.define('PBS.DataStoreContent', {
|
||||
});
|
||||
},
|
||||
|
||||
pruneAll: function() {
|
||||
let me = this;
|
||||
let view = me.getView();
|
||||
|
||||
if (!view.datastore) return;
|
||||
|
||||
Ext.create('Proxmox.window.Edit', {
|
||||
title: `Prune Datastore '${view.datastore}'`,
|
||||
onlineHelp: 'maintenance_pruning',
|
||||
|
||||
method: 'POST',
|
||||
submitText: "Prune",
|
||||
autoShow: true,
|
||||
isCreate: true,
|
||||
showTaskViewer: true,
|
||||
|
||||
taskDone: () => me.reload(),
|
||||
|
||||
url: `/api2/extjs/admin/datastore/${view.datastore}/prune-datastore`,
|
||||
|
||||
items: [
|
||||
{
|
||||
xtype: 'pbsPruneInputPanel',
|
||||
dryrun: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
|
||||
onVerify: function(view, rI, cI, item, e, rec) {
|
||||
let me = this;
|
||||
view = me.getView();
|
||||
@ -865,6 +894,11 @@ Ext.define('PBS.DataStoreContent', {
|
||||
confirmMsg: gettext('Do you want to verify all snapshots now?'),
|
||||
handler: 'verifyAll',
|
||||
},
|
||||
{
|
||||
xtype: 'proxmoxButton',
|
||||
text: gettext('Prune All'),
|
||||
handler: 'pruneAll',
|
||||
},
|
||||
'->',
|
||||
{
|
||||
xtype: 'tbtext',
|
||||
|
Reference in New Issue
Block a user