2022-05-30 08:44:58 +00:00
|
|
|
Ext.define('PBS.Datastore.GCOptions', {
|
2020-10-27 15:20:06 +00:00
|
|
|
extend: 'Proxmox.grid.ObjectGrid',
|
2022-05-30 08:44:58 +00:00
|
|
|
alias: 'widget.pbsDatastoreGCOpts',
|
2020-10-27 15:20:06 +00:00
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
2020-11-07 15:03:07 +00:00
|
|
|
onlineHelp: 'maintenance_pruning',
|
|
|
|
|
2020-10-27 15:20:06 +00:00
|
|
|
cbindData: function(initial) {
|
|
|
|
let me = this;
|
|
|
|
|
|
|
|
me.datastore = encodeURIComponent(me.datastore);
|
|
|
|
me.url = `/api2/json/config/datastore/${me.datastore}`;
|
|
|
|
me.editorConfig = {
|
|
|
|
url: `/api2/extjs/config/datastore/${me.datastore}`,
|
|
|
|
};
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
|
|
|
|
controller: {
|
|
|
|
xclass: 'Ext.app.ViewController',
|
|
|
|
|
|
|
|
edit: function() { this.getView().run_editor(); },
|
|
|
|
|
|
|
|
garbageCollect: function() {
|
|
|
|
let me = this;
|
|
|
|
let view = me.getView();
|
|
|
|
Proxmox.Utils.API2Request({
|
|
|
|
url: `/admin/datastore/${view.datastore}/gc`,
|
|
|
|
method: 'POST',
|
|
|
|
failure: function(response) {
|
|
|
|
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
|
|
},
|
|
|
|
success: function(response, options) {
|
|
|
|
Ext.create('Proxmox.window.TaskViewer', {
|
|
|
|
upid: response.result.data,
|
|
|
|
}).show();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
tbar: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxButton',
|
|
|
|
text: gettext('Edit'),
|
|
|
|
disabled: true,
|
|
|
|
handler: 'edit',
|
|
|
|
},
|
|
|
|
'-',
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxButton',
|
2020-10-27 16:42:29 +00:00
|
|
|
text: gettext('Start Garbage Collection'),
|
2020-10-27 15:20:06 +00:00
|
|
|
selModel: null,
|
|
|
|
handler: 'garbageCollect',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
listeners: {
|
|
|
|
activate: function() { this.rstore.startUpdate(); },
|
|
|
|
destroy: function() { this.rstore.stopUpdate(); },
|
|
|
|
deactivate: function() { this.rstore.stopUpdate(); },
|
|
|
|
itemdblclick: 'edit',
|
|
|
|
},
|
|
|
|
|
|
|
|
rows: {
|
|
|
|
"gc-schedule": {
|
|
|
|
required: true,
|
|
|
|
defaultValue: Proxmox.Utils.NoneText,
|
2020-10-27 16:42:29 +00:00
|
|
|
header: gettext('Garbage Collection Schedule'),
|
2020-10-27 15:20:06 +00:00
|
|
|
editor: {
|
|
|
|
xtype: 'proxmoxWindowEdit',
|
|
|
|
title: gettext('GC Schedule'),
|
2020-11-10 10:45:43 +00:00
|
|
|
onlineHelp: 'maintenance_gc',
|
2020-10-27 15:20:06 +00:00
|
|
|
items: {
|
|
|
|
xtype: 'pbsCalendarEvent',
|
|
|
|
name: 'gc-schedule',
|
|
|
|
fieldLabel: gettext("GC Schedule"),
|
|
|
|
emptyText: Proxmox.Utils.noneText,
|
|
|
|
deleteEmpty: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-05-30 08:44:58 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
Ext.define('PBS.Datastore.PruneAndGC', {
|
|
|
|
extend: 'Ext.panel.Panel',
|
|
|
|
alias: 'widget.pbsDatastorePruneAndGC',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
|
|
|
layout: {
|
|
|
|
type: 'vbox',
|
|
|
|
align: 'stretch',
|
|
|
|
multi: true,
|
|
|
|
},
|
|
|
|
defaults: {
|
2022-05-30 13:02:05 +00:00
|
|
|
collapsible: false,
|
|
|
|
margin: '7 10 3 10',
|
2022-05-30 08:44:58 +00:00
|
|
|
},
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
xtype: 'pbsDatastoreGCOpts',
|
|
|
|
title: gettext('Garbage Collection'),
|
|
|
|
nodename: 'localhost',
|
|
|
|
cbind: {
|
|
|
|
datastore: '{datastore}',
|
2020-10-27 15:20:06 +00:00
|
|
|
},
|
|
|
|
},
|
2022-05-30 08:44:58 +00:00
|
|
|
{
|
|
|
|
xtype: 'pbsPruneJobView',
|
|
|
|
nodename: 'localhost',
|
|
|
|
flex: 1,
|
|
|
|
minHeight: 200,
|
|
|
|
cbind: {
|
|
|
|
datastore: '{datastore}',
|
2020-10-27 15:20:06 +00:00
|
|
|
},
|
|
|
|
},
|
2022-05-30 08:44:58 +00:00
|
|
|
],
|
2020-10-27 15:20:06 +00:00
|
|
|
});
|