ui: move prune input panel into own file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-14 18:51:54 +02:00
parent 5d05f334f1
commit e3cda36ba5
3 changed files with 101 additions and 100 deletions

View File

@ -50,6 +50,7 @@ JSSRC= \
form/VerifyOutdatedAfter.js \ form/VerifyOutdatedAfter.js \
data/RunningTasksStore.js \ data/RunningTasksStore.js \
button/TaskButton.js \ button/TaskButton.js \
panel/PrunePanel.js \
config/UserView.js \ config/UserView.js \
config/TokenView.js \ config/TokenView.js \
config/RemoteView.js \ config/RemoteView.js \

100
www/panel/PrunePanel.js Normal file
View File

@ -0,0 +1,100 @@
Ext.define('PBS.panel.PruneInputPanel', {
extend: 'Proxmox.panel.InputPanel',
xtype: 'pbsPruneInputPanel',
mixins: ['Proxmox.Mixin.CBind'],
onlineHelp: 'maintenance_pruning',
// show/hide dry-run field
dryrun: false,
cbindData: function() {
let me = this;
me.isCreate = !!me.isCreate;
return {
ns: me.ns ?? '',
};
},
onGetValues: function(values) {
if (values.ns === '') {
delete values.ns;
}
return values;
},
column1: [
{
xtype: 'pbsPruneKeepInput',
name: 'keep-last',
fieldLabel: gettext('Keep Last'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-daily',
fieldLabel: gettext('Keep Daily'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-monthly',
fieldLabel: gettext('Keep Monthly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
column2: [
{
xtype: 'pbsPruneKeepInput',
fieldLabel: gettext('Keep Hourly'),
name: 'keep-hourly',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-weekly',
fieldLabel: gettext('Keep Weekly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-yearly',
fieldLabel: gettext('Keep Yearly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [
{
xtype: 'proxmoxcheckbox',
name: 'dry-run',
fieldLabel: gettext('Dry Run'),
cbind: {
hidden: '{!dryrun}',
disabled: '{!dryrun}',
},
},
{
xtype: 'proxmoxtextfield',
name: 'ns',
hidden: true,
cbind: {
value: '{ns}',
},
},
],
});

View File

@ -1,103 +1,3 @@
Ext.define('PBS.panel.PruneInputPanel', {
extend: 'Proxmox.panel.InputPanel',
xtype: 'pbsPruneInputPanel',
mixins: ['Proxmox.Mixin.CBind'],
onlineHelp: 'maintenance_pruning',
// show/hide dry-run field
dryrun: false,
cbindData: function() {
let me = this;
me.isCreate = !!me.isCreate;
return {
ns: me.ns ?? '',
};
},
onGetValues: function(values) {
if (values.ns === '') {
delete values.ns;
}
return values;
},
column1: [
{
xtype: 'pbsPruneKeepInput',
name: 'keep-last',
fieldLabel: gettext('Keep Last'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-daily',
fieldLabel: gettext('Keep Daily'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-monthly',
fieldLabel: gettext('Keep Monthly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
column2: [
{
xtype: 'pbsPruneKeepInput',
fieldLabel: gettext('Keep Hourly'),
name: 'keep-hourly',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-weekly',
fieldLabel: gettext('Keep Weekly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pbsPruneKeepInput',
name: 'keep-yearly',
fieldLabel: gettext('Keep Yearly'),
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [
{
xtype: 'proxmoxcheckbox',
name: 'dry-run',
fieldLabel: gettext('Dry Run'),
cbind: {
hidden: '{!dryrun}',
disabled: '{!dryrun}',
},
},
{
xtype: 'proxmoxtextfield',
name: 'ns',
hidden: true,
cbind: {
value: '{ns}',
},
},
],
});
Ext.define('PBS.DataStoreEdit', { Ext.define('PBS.DataStoreEdit', {
extend: 'Proxmox.window.Edit', extend: 'Proxmox.window.Edit',
alias: 'widget.pbsDataStoreEdit', alias: 'widget.pbsDataStoreEdit',