ui: add gc/prune schedule and options available in the ui

by adding them as columns for the config view,
and as a seperate tab on the edit window (this is done to not show
too many options at once)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-05 10:11:54 +02:00 committed by Dietmar Maurer
parent e53a4c4577
commit 1278aeec36
2 changed files with 177 additions and 32 deletions

View File

@ -10,12 +10,15 @@ Ext.define('pbs-datastore-list', {
Ext.define('pbs-data-store-config', { Ext.define('pbs-data-store-config', {
extend: 'Ext.data.Model', extend: 'Ext.data.Model',
fields: [ 'name', 'path', 'comment' ], fields: [
'name', 'path', 'comment', 'gc-schedule', 'prune-schedule', 'keep-last',
'keep-hourly', 'keep-daily', 'keep-weekly', 'keep-monthly', 'keep-yearly',
],
proxy: { proxy: {
type: 'proxmox', type: 'proxmox',
url: "/api2/json/config/datastore" url: "/api2/json/config/datastore",
}, },
idProperty: 'name' idProperty: 'name',
}); });
Ext.define('PBS.DataStoreConfig', { Ext.define('PBS.DataStoreConfig', {
@ -133,6 +136,53 @@ Ext.define('PBS.DataStoreConfig', {
dataIndex: 'path', dataIndex: 'path',
flex: 1, flex: 1,
}, },
{
header: gettext('GC Schedule'),
sortable: false,
width: 120,
dataIndex: 'gc-schedule',
},
{
header: gettext('Prune Schedule'),
sortable: false,
width: 120,
dataIndex: 'prune-schedule',
},
{
header: gettext('Keep'),
columns: [
{
text: gettext('Last'),
dataIndex: 'keep-last',
width: 70,
},
{
text: gettext('Hourly'),
dataIndex: 'keep-hourly',
width: 70,
},
{
text: gettext('Daily'),
dataIndex: 'keep-daily',
width: 70,
},
{
text: gettext('Weekly'),
dataIndex: 'keep-weekly',
width: 70,
},
{
text: gettext('Monthly'),
dataIndex: 'keep-monthly',
width: 70,
},
{
text: gettext('Yearly'),
dataIndex: 'keep-yearly',
width: 70,
},
]
},
{ {
header: gettext('Comment'), header: gettext('Comment'),
sortable: false, sortable: false,

View File

@ -6,6 +6,8 @@ Ext.define('PBS.DataStoreEdit', {
subject: gettext('Datastore'), subject: gettext('Datastore'),
isAdd: true, isAdd: true,
bodyPadding: 0,
cbindData: function(initialConfig) { cbindData: function(initialConfig) {
var me = this; var me = this;
@ -21,39 +23,132 @@ Ext.define('PBS.DataStoreEdit', {
items: [ items: [
{ {
xtype: 'inputpanel', xtype: 'tabpanel',
column1: [ bodyPadding: 10,
items: [
{ {
xtype: 'pmxDisplayEditField', title: gettext('General'),
cbind: { xtype: 'inputpanel',
editable: '{isCreate}', column1: [
}, {
name: 'name', xtype: 'pmxDisplayEditField',
allowBlank: false, cbind: {
fieldLabel: gettext('Name'), editable: '{isCreate}',
}, },
], name: 'name',
allowBlank: false,
fieldLabel: gettext('Name'),
},
{
xtype: 'pmxDisplayEditField',
cbind: {
editable: '{isCreate}',
},
name: 'path',
allowBlank: false,
fieldLabel: gettext('Backing Path'),
emptyText: gettext('An absolute path'),
},
],
column2: [ column2: [
{ {
xtype: 'pmxDisplayEditField', xtype: 'proxmoxtextfield',
cbind: { name: 'gc-schedule',
editable: '{isCreate}', fieldLabel: gettext("GC Schedule"),
}, cbind: {
name: 'path', deleteEmpty: '{!isCreate}',
allowBlank: false, },
fieldLabel: gettext('Backing Path'), },
emptyText: gettext('An absolute path'), {
}, xtype: 'proxmoxtextfield',
], name: 'prune-schedule',
fieldLabel: gettext("Prune Schedule"),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [ columnB: [
{ {
xtype: 'textfield', xtype: 'textfield',
name: 'comment', name: 'comment',
fieldLabel: gettext('Comment'), fieldLabel: gettext('Comment'),
},
],
}, },
], {
title: gettext('Prune Options'),
xtype: 'inputpanel',
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,
},
],
}
]
} }
], ],
}); });