2021-01-28 11:59:46 +00:00
|
|
|
Ext.define('PBS.TapeManagement.PoolEditWindow', {
|
|
|
|
extend: 'Proxmox.window.Edit',
|
|
|
|
alias: 'widget.pbsPoolEditWindow',
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
|
2021-03-28 11:29:00 +00:00
|
|
|
onlineHelp: 'tape_media_pool_config',
|
|
|
|
|
2021-01-28 11:59:46 +00:00
|
|
|
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 { };
|
|
|
|
},
|
|
|
|
|
2021-03-02 10:43:25 +00:00
|
|
|
items: {
|
|
|
|
xtype: 'inputpanel',
|
|
|
|
column1: [
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Name'),
|
|
|
|
name: 'name',
|
|
|
|
xtype: 'pmxDisplayEditField',
|
|
|
|
renderer: Ext.htmlEncode,
|
|
|
|
allowBlank: false,
|
|
|
|
cbind: {
|
|
|
|
editable: '{isCreate}',
|
|
|
|
},
|
2021-01-28 11:59:46 +00:00
|
|
|
},
|
2021-03-02 10:43:25 +00:00
|
|
|
{
|
2021-03-28 11:28:36 +00:00
|
|
|
fieldLabel: gettext('Allocation Policy'),
|
2021-03-02 10:43:25 +00:00
|
|
|
xtype: 'pbsAllocationSelector',
|
|
|
|
name: 'allocation',
|
|
|
|
skipEmptyText: true,
|
|
|
|
allowBlank: true,
|
|
|
|
autoSelect: false,
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
2021-01-28 11:59:46 +00:00
|
|
|
},
|
2021-03-02 10:43:25 +00:00
|
|
|
{
|
2021-03-28 11:28:36 +00:00
|
|
|
fieldLabel: gettext('Retention Policy'),
|
2021-03-02 10:43:25 +00:00
|
|
|
xtype: 'pbsRetentionSelector',
|
|
|
|
name: 'retention',
|
|
|
|
skipEmptyText: true,
|
|
|
|
allowBlank: true,
|
|
|
|
autoSelect: false,
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
2021-01-28 11:59:46 +00:00
|
|
|
},
|
2021-03-02 10:43:25 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
column2: [
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Encryption Key'),
|
|
|
|
xtype: 'pbsTapeKeySelector',
|
|
|
|
name: 'encrypt',
|
|
|
|
allowBlank: true,
|
|
|
|
skipEmptyText: true,
|
|
|
|
autoSelect: false,
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
2021-02-04 12:56:30 +00:00
|
|
|
},
|
2021-03-02 10:43:25 +00:00
|
|
|
],
|
2021-01-28 11:59:46 +00:00
|
|
|
|
2021-03-02 10:43:25 +00:00
|
|
|
columnB: [
|
|
|
|
{
|
|
|
|
fieldLabel: gettext('Comment'),
|
|
|
|
xtype: 'proxmoxtextfield',
|
|
|
|
name: 'comment',
|
|
|
|
cbind: {
|
|
|
|
deleteEmpty: '{!isCreate}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|