proxmox-backup/www/tape/window/EncryptionEdit.js
Dominik Csapak 2e4e698633 ui: tape: add EncryptionPanel to add/remove encryption keys
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-02-04 17:35:46 +01:00

53 lines
1.2 KiB
JavaScript

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,
},
],
});