www/DataStoreConfig.js: add button to start GC

This commit is contained in:
Dietmar Maurer 2019-04-01 08:08:34 +02:00
parent 49d123ee3a
commit ad281d1bd9
2 changed files with 21 additions and 5 deletions

View File

@ -282,7 +282,6 @@ fn api_method_prune() -> ApiMethod {
)
}
// this is just a test for mutability/mutex handling - will remove later
fn start_garbage_collection(
param: Value,
_info: &ApiMethod,

View File

@ -26,6 +26,24 @@ Ext.define('PBS.DataStoreConfig', {
store.load();
};
var sm = Ext.create('Ext.selection.RowModel', {});
var gc_btn = new Proxmox.button.Button({
text: gettext('Start GC'),
disabled: true,
selModel: sm,
handler: function() {
var rec = sm.getSelection()[0];
Proxmox.Utils.API2Request({
url: '/admin/datastore/' + rec.data.name + '/gc',
method: 'POST',
failure: function(response) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
}
});
}
});
var tbar = [
{
text: gettext('Create'),
@ -35,12 +53,11 @@ Ext.define('PBS.DataStoreConfig', {
//win.on('destroy', reload);
//win.show();
}
}
},
gc_btn
//edit_btn, remove_btn
];
var sm = Ext.create('Ext.selection.RowModel', {});
Proxmox.Utils.monStoreErrors(me, store);
Ext.apply(me, {