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,67 +2,98 @@ 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: 'pbsDataStoreSelector', xtype: 'inputpanel',
fieldLabel: gettext('Datastore'), column1: [
name: 'store', {
}, xtype: 'pbsDataStoreSelector',
{ fieldLabel: gettext('Datastore'),
xtype: 'pbsMediaPoolSelector', name: 'store',
fieldLabel: gettext('Media Pool'), listeners: {
name: 'pool', change: function(_, value) {
}, let me = this;
{ if (value) {
xtype: 'pbsDriveSelector', let namespace = me.up('window').down('pbsNamespaceSelector');
fieldLabel: gettext('Drive'), namespace.setDatastore(value);
name: 'drive', namespace.setDisabled(false);
}, me.up('window').down('pbsNamespaceMaxDepth').setDisabled(false);
{ }
xtype: 'proxmoxcheckbox', },
name: 'force-media-set', },
fieldLabel: gettext('Force new Media-Set'),
},
{
xtype: 'proxmoxcheckbox',
name: 'export-media-set',
fieldLabel: gettext('Export Media-Set'),
listeners: {
change: function(cb, value) {
let me = this;
let eject = me.up('window').down('proxmoxcheckbox[name=eject-media]');
if (value) {
eject.setValue(false);
}
eject.setDisabled(!!value);
}, },
}, {
}, xtype: 'pbsNamespaceSelector',
{ fieldLabel: gettext('Namespace'),
xtype: 'proxmoxcheckbox', disabled: true,
name: 'eject-media', name: 'ns',
fieldLabel: gettext('Eject Media'), },
}, {
{ xtype: 'pbsNamespaceMaxDepth',
xtype: 'pmxUserSelector', fieldLabel: gettext('Max Depth'),
name: 'notify-user', disabled: true,
fieldLabel: gettext('Notify User'), name: 'max-depth',
emptyText: 'root@pam', },
value: null, {
allowBlank: true, xtype: 'pbsMediaPoolSelector',
skipEmptyText: true, fieldLabel: gettext('Media Pool'),
renderer: Ext.String.htmlEncode, name: 'pool',
},
{
xtype: 'pbsDriveSelector',
fieldLabel: gettext('Drive'),
name: 'drive',
},
],
column2: [
{
xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'force-media-set',
fieldLabel: gettext('Force new Media-Set'),
},
{
xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'export-media-set',
fieldLabel: gettext('Export Media-Set'),
listeners: {
change: function(cb, value) {
let me = this;
let eject = me.up('window').down('proxmoxcheckbox[name=eject-media]');
if (value) {
eject.setValue(false);
}
eject.setDisabled(!!value);
},
},
},
{
xtype: 'proxmoxcheckbox',
labelWidth: 150,
name: 'eject-media',
fieldLabel: gettext('Eject Media'),
},
{
xtype: 'pmxUserSelector',
labelWidth: 150,
name: 'notify-user',
fieldLabel: gettext('Notify User'),
emptyText: 'root@pam',
value: null,
allowBlank: true,
skipEmptyText: true,
renderer: Ext.String.htmlEncode,
},
],
}, },
], ],
}); });