public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Markus Frank <m.frank@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] ui: proxmox-tape key restore
Date: Wed, 13 Apr 2022 11:30:05 +0200	[thread overview]
Message-ID: <20220413093005.61074-2-m.frank@proxmox.com> (raw)
In-Reply-To: <20220413093005.61074-1-m.frank@proxmox.com>

"Restore Key With JSON" Button and Edit-Window with textarea and password
field.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 www/tape/EncryptionKeys.js | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/www/tape/EncryptionKeys.js b/www/tape/EncryptionKeys.js
index a4f91ccc..410052f7 100644
--- a/www/tape/EncryptionKeys.js
+++ b/www/tape/EncryptionKeys.js
@@ -57,6 +57,35 @@ Ext.define('PBS.TapeManagement.EncryptionPanel', {
 	    }).show();
 	},
 
+	onRestoreKeyWithJson: function() {
+	    Ext.create('Proxmox.window.Edit', {
+		title: gettext('Restore Key With JSON'),
+		isCreate: true,
+		submitText: gettext('Restore'),
+		method: 'POST',
+		url: `/api2/extjs/config`,
+		submitUrl: function(url) {
+                    return `${url}/tape-encryption-keys`;
+                },
+		items: [
+		    {
+			xtype: 'textarea',
+			fieldLabel: gettext('key-json'),
+			renderer: Ext.htmlEncode,
+			allowBlank: false,
+			name: 'key',
+		    },
+		    {
+			xtype: 'textfield',
+			inputType: 'password',
+			fieldLabel: gettext('Password'),
+			allowBlank: false,
+			name: 'password',
+		    },
+		],
+	    }).show();
+	},
+
 	reload: function() {
 	    this.getView().getStore().rstore.load();
 	},
@@ -114,6 +143,14 @@ Ext.define('PBS.TapeManagement.EncryptionPanel', {
 	    handler: 'onRestoreKey',
 	    selModel: false,
 	},
+	'-',
+	{
+	    text: gettext('Restore Key With JSON'),
+	    xtype: 'proxmoxButton',
+	    handler: 'onRestoreKeyWithJson',
+	    selModel: false,
+	},
+
     ],
     columns: [
 	{
-- 
2.30.2





  reply	other threads:[~2022-04-13  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13  9:30 [pbs-devel] [PATCH proxmox-backup] proxmox-tape: api: restore_key-code moved to tape-encryption-keys Markus Frank
2022-04-13  9:30 ` Markus Frank [this message]
2022-04-14  7:50 ` [pbs-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220413093005.61074-2-m.frank@proxmox.com \
    --to=m.frank@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal