ui: tape: add Edit Windows

includes edit windows for
* Drives
* Changers
* Media Pools
* Labeling Media
* Making new Tape Backups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-01-28 12:59:46 +01:00
committed by Dietmar Maurer
parent c72fdb53ae
commit 80a3749088
6 changed files with 286 additions and 0 deletions

View File

@ -0,0 +1,50 @@
Ext.define('PBS.TapeManagement.ChangerEditWindow', {
extend: 'Proxmox.window.Edit',
alias: 'widget.pbsChangerEditWindow',
mixins: ['Proxmox.Mixin.CBind'],
isCreate: true,
isAdd: true,
subject: gettext('Changer'),
cbindData: function(initialConfig) {
let me = this;
let changerid = initialConfig.changerid;
let baseurl = '/api2/extjs/config/changer';
me.isCreate = !changerid;
me.url = changerid ? `${baseurl}/${encodeURIComponent(changerid)}` : baseurl;
me.method = changerid ? 'PUT' : 'POST';
return { };
},
items: [
{
fieldLabel: gettext('Name'),
name: 'name',
xtype: 'pmxDisplayEditField',
renderer: Ext.htmlEncode,
allowBlank: false,
cbind: {
editable: '{isCreate}',
},
},
{
fieldLabel: gettext('Path'),
xtype: 'pbsTapeDevicePathSelector',
type: 'changers',
name: 'path',
allowBlank: false,
},
{
fieldLabel: gettext('Import-Export Slots'),
xtype: 'proxmoxtextfield',
name: 'export-slots',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
});