ui: encryption keys: always enable tape encryption restore button

Restoring a tape key should not require an existing tape key to select,
since it will be a new key, not overwriting the existing one.
(In the tape backup -> encryption keys view it's also always enabled)

To do that, remove the disabled/enableFn properties, but then the
component must be a 'button' (a proxmoxButton needs a record for it
to be enabled).

To make it a bit clearer that it does not have anything to do with the
listed keys, rename it to 'Restore Tape Key' and move it over to the
right of the toolbar.

While touching this, rename 'restoreEncryptionKey' to
'restoreTapeEncryptionKey' to make it also clearer in the code what it
does.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20260424115215.2377890-1-d.csapak@proxmox.com
This commit is contained in:
Dominik Csapak 2026-04-24 13:52:09 +02:00 committed by Thomas Lamprecht
parent ea86e2697d
commit ffe55e23eb

View File

@ -112,7 +112,7 @@ Ext.define('PBS.config.EncryptionKeysView', {
}).show();
},
restoreEncryptionKey: function () {
restoreTapeEncryptionKey: function () {
Ext.create('Proxmox.window.Edit', {
title: gettext('Restore Key'),
isCreate: true,
@ -275,13 +275,11 @@ Ext.define('PBS.config.EncryptionKeysView', {
(item.data.type === 'sync' && !!item.data['archived-at']) ||
item.data.type === 'tape',
},
'-',
'->',
{
text: gettext('Restore Key'),
xtype: 'proxmoxButton',
handler: 'restoreEncryptionKey',
disabled: true,
enableFn: (item) => item.data.type === 'tape',
text: gettext('Restore Tape Key'),
xtype: 'button',
handler: 'restoreTapeEncryptionKey',
},
],