proxmox-backup/www/tape/window/PoolEdit.js
Dominik Csapak 5f1f7ef564 ui: tape/PoolEdit: add selector for encryption keys
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-02-04 17:36:06 +01:00

69 lines
1.4 KiB
JavaScript

Ext.define('PBS.TapeManagement.PoolEditWindow', {
extend: 'Proxmox.window.Edit',
alias: 'widget.pbsPoolEditWindow',
mixins: ['Proxmox.Mixin.CBind'],
isCreate: true,
isAdd: true,
subject: gettext('Media Pool'),
cbindData: function(initialConfig) {
let me = this;
let poolid = initialConfig.poolid;
let baseurl = '/api2/extjs/config/media-pool';
me.isCreate = !poolid;
me.url = poolid ? `${baseurl}/${encodeURIComponent(poolid)}` : baseurl;
me.method = poolid ? 'PUT' : 'POST';
return { };
},
items: [
{
fieldLabel: gettext('Name'),
name: 'name',
xtype: 'pmxDisplayEditField',
renderer: Ext.htmlEncode,
allowBlank: false,
cbind: {
editable: '{isCreate}',
},
},
{
fieldLabel: gettext('Allocation'),
xtype: 'pbsAllocationSelector',
name: 'allocation',
skipEmptyText: true,
allowBlank: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
fieldLabel: gettext('Retention'),
xtype: 'pbsRetentionSelector',
name: 'retention',
skipEmptyText: true,
allowBlank: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
fieldLabel: gettext('Encryption Key'),
xtype: 'pbsTapeKeySelector',
name: 'encrypt',
allowBlank: true,
skipEmptyText: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
});