ui: tape/Backup: add namespace and recursion field for manual backup

and change the layout to two columns, because the window was getting
too tall.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-05-13 08:34:11 +02:00
parent 12d334615b
commit 80df7caded
1 changed files with 83 additions and 52 deletions

View File

@ -2,22 +2,43 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
extend: 'Proxmox.window.Edit', extend: 'Proxmox.window.Edit',
alias: 'pbsTapeBackupWindow', alias: 'pbsTapeBackupWindow',
width: 400,
subject: gettext('Backup'), subject: gettext('Backup'),
url: '/api2/extjs/tape/backup', url: '/api2/extjs/tape/backup',
method: 'POST', method: 'POST',
showTaskViewer: true, showTaskViewer: true,
isCreate: true, isCreate: true,
defaults: {
labelWidth: 150,
},
items: [ items: [
{
xtype: 'inputpanel',
column1: [
{ {
xtype: 'pbsDataStoreSelector', xtype: 'pbsDataStoreSelector',
fieldLabel: gettext('Datastore'), fieldLabel: gettext('Datastore'),
name: 'store', name: 'store',
listeners: {
change: function(_, value) {
let me = this;
if (value) {
let namespace = me.up('window').down('pbsNamespaceSelector');
namespace.setDatastore(value);
namespace.setDisabled(false);
me.up('window').down('pbsNamespaceMaxDepth').setDisabled(false);
}
},
},
},
{
xtype: 'pbsNamespaceSelector',
fieldLabel: gettext('Namespace'),
disabled: true,
name: 'ns',
},
{
xtype: 'pbsNamespaceMaxDepth',
fieldLabel: gettext('Max Depth'),
disabled: true,
name: 'max-depth',
}, },
{ {
xtype: 'pbsMediaPoolSelector', xtype: 'pbsMediaPoolSelector',
@ -29,13 +50,18 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
fieldLabel: gettext('Drive'), fieldLabel: gettext('Drive'),
name: 'drive', name: 'drive',
}, },
],
column2: [
{ {
xtype: 'proxmoxcheckbox', xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'force-media-set', name: 'force-media-set',
fieldLabel: gettext('Force new Media-Set'), fieldLabel: gettext('Force new Media-Set'),
}, },
{ {
xtype: 'proxmoxcheckbox', xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'export-media-set', name: 'export-media-set',
fieldLabel: gettext('Export Media-Set'), fieldLabel: gettext('Export Media-Set'),
listeners: { listeners: {
@ -51,11 +77,13 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
}, },
{ {
xtype: 'proxmoxcheckbox', xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'eject-media', name: 'eject-media',
fieldLabel: gettext('Eject Media'), fieldLabel: gettext('Eject Media'),
}, },
{ {
xtype: 'pmxUserSelector', xtype: 'pmxUserSelector',
labelWidth: 150,
name: 'notify-user', name: 'notify-user',
fieldLabel: gettext('Notify User'), fieldLabel: gettext('Notify User'),
emptyText: 'root@pam', emptyText: 'root@pam',
@ -65,4 +93,7 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
renderer: Ext.String.htmlEncode, renderer: Ext.String.htmlEncode,
}, },
], ],
},
],
}); });