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: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Last'),
|
|
|
|
name: 'keep-last',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Daily'),
|
|
|
|
name: 'keep-daily',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Monthly'),
|
|
|
|
name: 'keep-monthly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
column2: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Hourly'),
|
|
|
|
name: 'keep-hourly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Weekly'),
|
|
|
|
name: 'keep-weekly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Yearly'),
|
|
|
|
name: 'keep-yearly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
});
|
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';
|
|
|
|
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-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-07-21 17:32:25 +00:00
|
|
|
emptyText: gettext('none'),
|
2020-07-14 08:56:19 +00:00
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
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
|
|
|
});
|