[pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for encryption keys

Dominik Csapak d.csapak at proxmox.com
Thu Feb 4 13:56:30 CET 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/Makefile                 |  1 +
 www/tape/form/KeySelector.js | 38 ++++++++++++++++++++++++++++++++++++
 www/tape/window/PoolEdit.js  | 11 +++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 www/tape/form/KeySelector.js

diff --git a/www/Makefile b/www/Makefile
index 7ee79f8a..8391e68f 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -15,6 +15,7 @@ TAPE_UI_FILES=						\
 	tape/form/PoolSelector.js			\
 	tape/form/RetentionSelector.js			\
 	tape/form/TapeDevicePathSelector.js		\
+	tape/form/KeySelector.js			\
 	tape/window/ChangerEdit.js			\
 	tape/window/DriveEdit.js			\
 	tape/window/EncryptionEdit.js			\
diff --git a/www/tape/form/KeySelector.js b/www/tape/form/KeySelector.js
new file mode 100644
index 00000000..8a461a7b
--- /dev/null
+++ b/www/tape/form/KeySelector.js
@@ -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,
+	    },
+	],
+    },
+});
diff --git a/www/tape/window/PoolEdit.js b/www/tape/window/PoolEdit.js
index 4ab13530..6f91d25e 100644
--- a/www/tape/window/PoolEdit.js
+++ b/www/tape/window/PoolEdit.js
@@ -52,6 +52,17 @@ Ext.define('PBS.TapeManagement.PoolEditWindow', {
 		deleteEmpty: '{!isCreate}',
 	    },
 	},
+	{
+	    fieldLabel: gettext('Encryption Key'),
+	    xtype: 'pbsTapeKeySelector',
+	    name: 'encrypt',
+	    allowBlank: true,
+	    skipEmptyText: true,
+	    autoSelect: false,
+	    cbind: {
+		deleteEmpty: '{!isCreate}',
+	    },
+	},
     ],
 });
 
-- 
2.20.1






More information about the pbs-devel mailing list