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,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
title: gettext('General'),
|
|
|
|
xtype: 'inputpanel',
|
|
|
|
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'),
|
|
|
|
xtype: 'inputpanel',
|
|
|
|
column1: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Last'),
|
|
|
|
name: 'keep-last',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Daily'),
|
|
|
|
name: 'keep-daily',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Monthly'),
|
|
|
|
name: 'keep-monthly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
column2: [
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Hourly'),
|
|
|
|
name: 'keep-hourly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Weekly'),
|
|
|
|
name: 'keep-weekly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
xtype: 'proxmoxintegerfield',
|
|
|
|
fieldLabel: gettext('Keep Yearly'),
|
|
|
|
name: 'keep-yearly',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
2020-06-05 08:11:54 +00:00
|
|
|
},
|
2020-07-14 08:56:19 +00:00
|
|
|
minValue: 1,
|
|
|
|
allowBlank: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-06-05 08:11:52 +00:00
|
|
|
});
|