2020-10-27 15:20:06 +00:00
|
|
|
Ext.define('PBS.panel.PruneInputPanel', {
|
|
|
|
extend: 'Proxmox.panel.InputPanel',
|
|
|
|
xtype: 'pbsPruneInputPanel',
|
|
|
|
|
|
|
|
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() {
|
|
|
|
let me = this;
|
|
|
|
me.isCreate = !!me.isCreate;
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
|
|
|
|
column1: [
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
name: 'keep-last',
|
2020-11-21 18:51:58 +00:00
|
|
|
fieldLabel: gettext('keep-last'),
|
2020-10-27 15:20:06 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
name: 'keep-daily',
|
2020-11-21 18:51:58 +00:00
|
|
|
fieldLabel: gettext('Keep Daily'),
|
2020-10-27 15:20:06 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
name: 'keep-monthly',
|
2020-11-21 18:51:58 +00:00
|
|
|
fieldLabel: gettext('Keep Monthly'),
|
2020-10-27 15:20:06 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
column2: [
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
fieldLabel: gettext('Keep Hourly'),
|
|
|
|
name: 'keep-hourly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
name: 'keep-weekly',
|
2020-11-21 18:51:58 +00:00
|
|
|
fieldLabel: gettext('Keep Weekly'),
|
2020-10-27 15:20:06 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-11-21 18:51:58 +00:00
|
|
|
xtype: 'pbsPruneKeepInput',
|
2020-10-27 15:20:06 +00:00
|
|
|
name: 'keep-yearly',
|
2020-11-21 18:51:58 +00:00
|
|
|
fieldLabel: gettext('Keep Yearly'),
|
2020-10-27 15:20:06 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
});
|
2020-06-05 08:11:52 +00:00
|
|
|
Ext.define('PBS.DataStoreEdit', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
alias: 'widget.pbsDataStoreEdit',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
|
|
|
subject: gettext('Datastore'),
|
|
|
|
isAdd: true,
|
|
|
|
|
2020-06-05 08:11:54 +00:00
|
|
|
bodyPadding: 0,
|
|
|
|
|
2020-06-05 08:11:52 +00:00
|
|
|
cbindData: function(initialConfig) {
|
|
|
|
var me = this;
|
|
|
|
|
|
|
|
let name = initialConfig.name;
|
|
|
|
let baseurl = '/api2/extjs/config/datastore';
|
|
|
|
|
|
|
|
me.isCreate = !name;
|
2020-07-21 17:32:25 +00:00
|
|
|
if (!me.isCreate) {
|
|
|
|
me.defaultFocus = 'textfield[name=comment]';
|
|
|
|
}
|
2020-06-05 08:11:52 +00:00
|
|
|
me.url = name ? baseurl + '/' + name : baseurl;
|
|
|
|
me.method = name ? 'PUT' : 'POST';
|
2020-11-11 06:49:01 +00:00
|
|
|
me.scheduleValue = name ? null : 'daily';
|
2020-06-05 08:11:52 +00:00
|
|
|
me.autoLoad = !!name;
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
|
2020-07-14 08:56:19 +00:00
|
|
|
items: {
|
|
|
|
xtype: 'tabpanel',
|
|
|
|
bodyPadding: 10,
|
2020-10-05 15:01:29 +00:00
|
|
|
listeners: {
|
|
|
|
tabchange: function(tb, newCard) {
|
|
|
|
Ext.GlobalEvents.fireEvent('proxmoxShowHelp', newCard.onlineHelp);
|
2020-10-05 15:15:28 +00:00
|
|
|
},
|
2020-10-05 15:01:29 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
items: [
|
|
|
|
{
|
|
|
|
title: gettext('General'),
|
|
|
|
xtype: 'inputpanel',
|
2020-10-05 15:01:29 +00:00
|
|
|
onlineHelp: 'datastore_intro',
|
2020-07-14 08:56:19 +00:00
|
|
|
column1: [
|
|
|
|
{
|
|
|
|
xtype: 'pmxDisplayEditField',
|
|
|
|
cbind: {
|
|
|
|
editable: '{isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
name: 'name',
|
|
|
|
allowBlank: false,
|
|
|
|
fieldLabel: gettext('Name'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'pmxDisplayEditField',
|
|
|
|
cbind: {
|
|
|
|
editable: '{isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
name: 'path',
|
|
|
|
allowBlank: false,
|
|
|
|
fieldLabel: gettext('Backing Path'),
|
|
|
|
emptyText: gettext('An absolute path'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
column2: [
|
|
|
|
{
|
2020-07-21 17:32:25 +00:00
|
|
|
xtype: 'pbsCalendarEvent',
|
2020-07-14 08:56:19 +00:00
|
|
|
name: 'gc-schedule',
|
|
|
|
fieldLabel: gettext("GC Schedule"),
|
2020-07-21 17:32:25 +00:00
|
|
|
emptyText: gettext('none'),
|
2020-07-14 08:56:19 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-11-11 06:49:01 +00:00
|
|
|
value: '{scheduleValue}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
},
|
|
|
|
{
|
2020-07-21 17:32:25 +00:00
|
|
|
xtype: 'pbsCalendarEvent',
|
2020-07-14 08:56:19 +00:00
|
|
|
name: 'prune-schedule',
|
|
|
|
fieldLabel: gettext("Prune Schedule"),
|
2020-11-11 06:49:01 +00:00
|
|
|
value: 'daily',
|
2020-07-21 17:32:25 +00:00
|
|
|
emptyText: gettext('none'),
|
2020-07-14 08:56:19 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-11-11 06:49:01 +00:00
|
|
|
value: '{scheduleValue}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
columnB: [
|
|
|
|
{
|
|
|
|
xtype: 'textfield',
|
|
|
|
name: 'comment',
|
|
|
|
fieldLabel: gettext('Comment'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: gettext('Prune Options'),
|
2020-10-27 15:20:06 +00:00
|
|
|
xtype: 'pbsPruneInputPanel',
|
|
|
|
cbind: {
|
|
|
|
isCreate: '{isCreate}',
|
|
|
|
},
|
2020-10-05 15:01:29 +00:00
|
|
|
onlineHelp: 'backup_pruning',
|
2020-07-14 08:56:19 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-06-05 08:11:52 +00:00
|
|
|
});
|