ui: tape/PoolEdit: add selector for encryption keys

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-04 13:56:30 +01:00 committed by Dietmar Maurer
parent 2e4e698633
commit 5f1f7ef564
3 changed files with 50 additions and 0 deletions

View File

@ -15,6 +15,7 @@ TAPE_UI_FILES= \
tape/form/PoolSelector.js \ tape/form/PoolSelector.js \
tape/form/RetentionSelector.js \ tape/form/RetentionSelector.js \
tape/form/TapeDevicePathSelector.js \ tape/form/TapeDevicePathSelector.js \
tape/form/KeySelector.js \
tape/window/ChangerEdit.js \ tape/window/ChangerEdit.js \
tape/window/DriveEdit.js \ tape/window/DriveEdit.js \
tape/window/EncryptionEdit.js \ tape/window/EncryptionEdit.js \

View File

@ -0,0 +1,38 @@
Ext.define('PBS.form.TapeKeySelector', {
extend: 'Proxmox.form.ComboGrid',
alias: 'widget.pbsTapeKeySelector',
allowBlank: false,
displayField: 'hint',
valueField: 'fingerprint',
value: null,
multiSelect: false,
store: {
proxy: {
type: 'proxmox',
url: '/api2/json/config/tape-encryption-keys',
},
autoLoad: true,
sorter: 'hint',
},
listConfig: {
columns: [
{
text: gettext('Hint'),
dataIndex: 'hint',
sortable: true,
flex: 1,
renderer: Ext.String.htmlEncode,
},
{
text: gettext('Fingerprint'),
sortable: true,
dataIndex: 'fingerprint',
flex: 5,
},
],
},
});

View File

@ -52,6 +52,17 @@ Ext.define('PBS.TapeManagement.PoolEditWindow', {
deleteEmpty: '{!isCreate}', deleteEmpty: '{!isCreate}',
}, },
}, },
{
fieldLabel: gettext('Encryption Key'),
xtype: 'pbsTapeKeySelector',
name: 'encrypt',
allowBlank: true,
skipEmptyText: true,
autoSelect: false,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
], ],
}); });