ui: tape: add EncryptionPanel to add/remove encryption keys
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
02dce8cad0
commit
2e4e698633
52
www/tape/window/EncryptionEdit.js
Normal file
52
www/tape/window/EncryptionEdit.js
Normal file
@ -0,0 +1,52 @@
|
||||
Ext.define('PBS.TapeManagement.EncryptionEditWindow', {
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: 'widget.pbsEncryptionEditWindow',
|
||||
mixins: ['Proxmox.Mixin.CBind'],
|
||||
|
||||
isCreate: true,
|
||||
isAdd: true,
|
||||
subject: gettext('Encryption Key'),
|
||||
cbindData: function(initialConfig) {
|
||||
let me = this;
|
||||
|
||||
let fingerprint = initialConfig.fingerprint;
|
||||
let baseurl = '/api2/extjs/config/tape-encryption-keys';
|
||||
|
||||
me.isCreate = !fingerprint;
|
||||
me.url = fingerprint ? `${baseurl}/${encodeURIComponent(fingerprint)}` : baseurl;
|
||||
me.method = fingerprint ? 'PUT' : 'POST';
|
||||
|
||||
return { };
|
||||
},
|
||||
|
||||
items: [
|
||||
{
|
||||
fieldLabel: gettext('Hint'),
|
||||
name: 'hint',
|
||||
xtype: 'pmxDisplayEditField',
|
||||
renderer: Ext.htmlEncode,
|
||||
allowBlank: false,
|
||||
cbind: {
|
||||
editable: '{isCreate}',
|
||||
},
|
||||
},
|
||||
{
|
||||
xtype: 'textfield',
|
||||
inputType: 'password',
|
||||
fieldLabel: gettext('Password'),
|
||||
name: 'password',
|
||||
minLength: 5,
|
||||
allowBlank: false,
|
||||
},
|
||||
{
|
||||
xtype: 'textfield',
|
||||
inputType: 'password',
|
||||
submitValue: false,
|
||||
fieldLabel: gettext('Confirm Password'),
|
||||
minLength: 5,
|
||||
vtype: 'password',
|
||||
initialPassField: 'password',
|
||||
allowBlank: false,
|
||||
},
|
||||
],
|
||||
});
|
Reference in New Issue
Block a user