ui: improve media pool config grid - add comment field

This commit is contained in:
Dietmar Maurer 2021-03-02 11:43:25 +01:00
parent db04d10d14
commit 6c92449702
2 changed files with 80 additions and 47 deletions

View File

@ -1,6 +1,15 @@
Ext.define('pbs-model-media-pool', { Ext.define('pbs-model-media-pool', {
extend: 'Ext.data.Model', extend: 'Ext.data.Model',
fields: ['name', 'allocation', 'retention', 'template', 'encrypt'], fields: [
'name', 'allocation', 'retention', 'template', 'encrypt', 'comment',
{
name: 'encryption',
type: 'bool',
calculate: function(data) {
return !!data.encrypt;
},
},
],
idProperty: 'name', idProperty: 'name',
}); });
@ -102,18 +111,26 @@ Ext.define('PBS.TapeManagement.PoolPanel', {
{ {
text: gettext('Allocation'), text: gettext('Allocation'),
dataIndex: 'allocation', dataIndex: 'allocation',
flex: 1,
}, },
{ {
text: gettext('Retention'), text: gettext('Retention'),
dataIndex: 'retention', dataIndex: 'retention',
flex: 1, },
{
text: gettext('Encryption'),
dataIndex: 'encryption',
renderer: Proxmox.Utils.format_boolean,
}, },
{ {
text: gettext('Encryption Fingerprint'), text: gettext('Encryption Fingerprint'),
dataIndex: 'encrypt', dataIndex: 'encrypt',
hidden: true,
flex: 3,
},
{
text: gettext('Comment'),
dataIndex: 'comment',
flex: 3, flex: 3,
}, },
], ],
}); });

View File

@ -19,50 +19,66 @@ Ext.define('PBS.TapeManagement.PoolEditWindow', {
return { }; return { };
}, },
items: [ items: {
{ xtype: 'inputpanel',
fieldLabel: gettext('Name'), column1: [
name: 'name', {
xtype: 'pmxDisplayEditField', fieldLabel: gettext('Name'),
renderer: Ext.htmlEncode, name: 'name',
allowBlank: false, xtype: 'pmxDisplayEditField',
cbind: { renderer: Ext.htmlEncode,
editable: '{isCreate}', allowBlank: false,
cbind: {
editable: '{isCreate}',
},
}, },
}, {
{ fieldLabel: gettext('Allocation'),
fieldLabel: gettext('Allocation'), xtype: 'pbsAllocationSelector',
xtype: 'pbsAllocationSelector', name: 'allocation',
name: 'allocation', skipEmptyText: true,
skipEmptyText: true, allowBlank: true,
allowBlank: true, autoSelect: false,
autoSelect: false, cbind: {
cbind: { deleteEmpty: '{!isCreate}',
deleteEmpty: '{!isCreate}', },
}, },
}, {
{ fieldLabel: gettext('Retention'),
fieldLabel: gettext('Retention'), xtype: 'pbsRetentionSelector',
xtype: 'pbsRetentionSelector', name: 'retention',
name: 'retention', skipEmptyText: true,
skipEmptyText: true, allowBlank: true,
allowBlank: true, autoSelect: false,
autoSelect: false, cbind: {
cbind: { deleteEmpty: '{!isCreate}',
deleteEmpty: '{!isCreate}', },
}, },
}, ],
{
fieldLabel: gettext('Encryption Key'),
xtype: 'pbsTapeKeySelector',
name: 'encrypt',
allowBlank: true,
skipEmptyText: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
});
column2: [
{
fieldLabel: gettext('Encryption Key'),
xtype: 'pbsTapeKeySelector',
name: 'encrypt',
allowBlank: true,
skipEmptyText: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
columnB: [
{
fieldLabel: gettext('Comment'),
xtype: 'proxmoxtextfield',
name: 'comment',
cbind: {
deleteEmpty: '{!isCreate}',
},
},
],
},
});