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', {
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: {
type: 'proxmox',
url: "/api2/json/config/datastore"
url: "/api2/json/config/datastore",
},
idProperty: 'name'
idProperty: 'name',
});
Ext.define('PBS.DataStoreConfig', {
@ -133,6 +136,53 @@ Ext.define('PBS.DataStoreConfig', {
dataIndex: 'path',
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'),
sortable: false,

View File

@ -6,6 +6,8 @@ Ext.define('PBS.DataStoreEdit', {
subject: gettext('Datastore'),
isAdd: true,
bodyPadding: 0,
cbindData: function(initialConfig) {
var me = this;
@ -21,6 +23,11 @@ Ext.define('PBS.DataStoreEdit', {
items: [
{
xtype: 'tabpanel',
bodyPadding: 10,
items: [
{
title: gettext('General'),
xtype: 'inputpanel',
column1: [
{
@ -32,9 +39,6 @@ Ext.define('PBS.DataStoreEdit', {
allowBlank: false,
fieldLabel: gettext('Name'),
},
],
column2: [
{
xtype: 'pmxDisplayEditField',
cbind: {
@ -47,6 +51,25 @@ Ext.define('PBS.DataStoreEdit', {
},
],
column2: [
{
xtype: 'proxmoxtextfield',
name: 'gc-schedule',
fieldLabel: gettext("GC Schedule"),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'proxmoxtextfield',
name: 'prune-schedule',
fieldLabel: gettext("Prune Schedule"),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [
{
xtype: 'textfield',
@ -54,6 +77,78 @@ Ext.define('PBS.DataStoreEdit', {
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,
},
],
}
]
}
],
});