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:
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) {
|
onVerify: function(view, rI, cI, item, e, rec) {
|
||||||
let me = this;
|
let me = this;
|
||||||
view = me.getView();
|
view = me.getView();
|
||||||
@ -865,6 +894,11 @@ Ext.define('PBS.DataStoreContent', {
|
|||||||
confirmMsg: gettext('Do you want to verify all snapshots now?'),
|
confirmMsg: gettext('Do you want to verify all snapshots now?'),
|
||||||
handler: 'verifyAll',
|
handler: 'verifyAll',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxButton',
|
||||||
|
text: gettext('Prune All'),
|
||||||
|
handler: 'pruneAll',
|
||||||
|
},
|
||||||
'->',
|
'->',
|
||||||
{
|
{
|
||||||
xtype: 'tbtext',
|
xtype: 'tbtext',
|
||||||
|
@ -6,6 +6,9 @@ Ext.define('PBS.panel.PruneInputPanel', {
|
|||||||
|
|
||||||
onlineHelp: 'maintenance_pruning',
|
onlineHelp: 'maintenance_pruning',
|
||||||
|
|
||||||
|
// show/hide dry-run field
|
||||||
|
dryrun: false,
|
||||||
|
|
||||||
cbindData: function() {
|
cbindData: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
me.isCreate = !!me.isCreate;
|
me.isCreate = !!me.isCreate;
|
||||||
@ -65,6 +68,18 @@ Ext.define('PBS.panel.PruneInputPanel', {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
columnB: [
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxcheckbox',
|
||||||
|
name: 'dry-run',
|
||||||
|
fieldLabel: gettext('Dry Run'),
|
||||||
|
cbind: {
|
||||||
|
hidden: '{!dryrun}',
|
||||||
|
disabled: '{!dryrun}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
});
|
});
|
||||||
Ext.define('PBS.DataStoreEdit', {
|
Ext.define('PBS.DataStoreEdit', {
|
||||||
extend: 'Proxmox.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
Loading…
Reference in New Issue
Block a user