* [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys
@ 2021-02-04 12:56 Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for " Dominik Csapak
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-02-04 12:56 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/Makefile | 2 +
www/tape/EncryptionKeys.js | 96 +++++++++++++++++++++++++++++++
www/tape/TapeManagement.js | 5 ++
www/tape/window/EncryptionEdit.js | 52 +++++++++++++++++
4 files changed, 155 insertions(+)
create mode 100644 www/tape/EncryptionKeys.js
create mode 100644 www/tape/window/EncryptionEdit.js
diff --git a/www/Makefile b/www/Makefile
index b24783ca..7ee79f8a 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -17,6 +17,7 @@ TAPE_UI_FILES= \
tape/form/TapeDevicePathSelector.js \
tape/window/ChangerEdit.js \
tape/window/DriveEdit.js \
+ tape/window/EncryptionEdit.js \
tape/window/LabelMedia.js \
tape/window/PoolEdit.js \
tape/window/TapeBackup.js \
@@ -25,6 +26,7 @@ TAPE_UI_FILES= \
tape/ChangerConfig.js \
tape/ChangerStatus.js \
tape/DriveConfig.js \
+ tape/EncryptionKeys.js \
tape/PoolConfig.js \
tape/TapeInventory.js \
tape/TapeManagement.js \
diff --git a/www/tape/EncryptionKeys.js b/www/tape/EncryptionKeys.js
new file mode 100644
index 00000000..6f2644d2
--- /dev/null
+++ b/www/tape/EncryptionKeys.js
@@ -0,0 +1,96 @@
+Ext.define('pbs-tape-encryption-keys', {
+ extend: 'Ext.data.Model',
+ fields: [
+ 'fingerprint', 'hint', 'kdf', 'modified',
+ {
+ name: 'created',
+ type: 'date',
+ dateFormat: 'timestamp',
+ },
+ ],
+ idProperty: 'fingerprint',
+});
+
+Ext.define('PBS.TapeManagement.EncryptionPanel', {
+ extend: 'Ext.grid.Panel',
+ alias: 'widget.pbsEncryptionKeys',
+
+ controller: {
+ xclass: 'Ext.app.ViewController',
+
+ onAdd: function() {
+ let me = this;
+ Ext.create('PBS.TapeManagement.EncryptionEditWindow', {
+ listeners: {
+ destroy: function() {
+ me.reload();
+ },
+ },
+ }).show();
+ },
+
+ reload: function() {
+ this.getView().getStore().rstore.load();
+ },
+
+ stopStore: function() {
+ this.getView().getStore().rstore.stopUpdate();
+ },
+
+ startStore: function() {
+ this.getView().getStore().rstore.startUpdate();
+ },
+ },
+
+ listeners: {
+ beforedestroy: 'stopStore',
+ deactivate: 'stopStore',
+ activate: 'startStore',
+ },
+
+ store: {
+ type: 'diff',
+ rstore: {
+ type: 'update',
+ storeid: 'proxmox-tape-encryption-keys',
+ model: 'pbs-tape-encryption-keys',
+ proxy: {
+ type: 'proxmox',
+ url: "/api2/json/config/tape-encryption-keys",
+ },
+ },
+ sorters: 'hint',
+ },
+
+ tbar: [
+ {
+ text: gettext('Add'),
+ xtype: 'proxmoxButton',
+ handler: 'onAdd',
+ selModel: false,
+ },
+ '-',
+ {
+ xtype: 'proxmoxStdRemoveButton',
+ baseurl: '/api2/extjs/config/tape-encryption-keys',
+ callback: 'reload',
+ },
+ ],
+ columns: [
+ {
+ text: gettext('Hint'),
+ dataIndex: 'hint',
+ flex: 1,
+ },
+ {
+ text: gettext('Fingerprint'),
+ dataIndex: 'fingerprint',
+ flex: 4,
+ },
+ {
+ text: gettext('Created'),
+ dataIndex: 'created',
+ flex: 2,
+ },
+ ],
+});
diff --git a/www/tape/TapeManagement.js b/www/tape/TapeManagement.js
index e558620a..127c431b 100644
--- a/www/tape/TapeManagement.js
+++ b/www/tape/TapeManagement.js
@@ -41,5 +41,10 @@ Ext.define('PBS.TapeManagement', {
itemId: 'pools',
xtype: 'pbsMediaPoolPanel',
},
+ {
+ title: gettext('Encryption Keys'),
+ itemId: 'encryption-keys',
+ xtype: 'pbsEncryptionKeys',
+ },
],
});
diff --git a/www/tape/window/EncryptionEdit.js b/www/tape/window/EncryptionEdit.js
new file mode 100644
index 00000000..06d5ddc7
--- /dev/null
+++ b/www/tape/window/EncryptionEdit.js
@@ -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,
+ },
+ ],
+});
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for encryption keys
2021-02-04 12:56 [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dominik Csapak
@ 2021-02-04 12:56 ` Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 3/4] ui: tape/PoolConfig: add flex to columns Dominik Csapak
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-02-04 12:56 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Dominik Csapak <d.csapak@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 3/4] ui: tape/PoolConfig: add flex to columns
2021-02-04 12:56 [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for " Dominik Csapak
@ 2021-02-04 12:56 ` Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 4/4] ui: tape/ChangerStatus: add 'is labeled' column for tapes Dominik Csapak
2021-02-04 16:43 ` [pbs-devel] applied: [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dietmar Maurer
3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-02-04 12:56 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/tape/PoolConfig.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/www/tape/PoolConfig.js b/www/tape/PoolConfig.js
index 56ace147..6c4e8732 100644
--- a/www/tape/PoolConfig.js
+++ b/www/tape/PoolConfig.js
@@ -97,18 +97,22 @@ Ext.define('PBS.TapeManagement.PoolPanel', {
{
text: gettext('Name'),
dataIndex: 'name',
+ flex: 1,
},
{
text: gettext('Allocation'),
dataIndex: 'allocation',
+ flex: 1,
},
{
text: gettext('Retention'),
dataIndex: 'retention',
+ flex: 1,
},
{
text: gettext('Encryption Fingerprint'),
dataIndex: 'encrypt',
+ flex: 3,
},
],
});
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 4/4] ui: tape/ChangerStatus: add 'is labeled' column for tapes
2021-02-04 12:56 [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for " Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 3/4] ui: tape/PoolConfig: add flex to columns Dominik Csapak
@ 2021-02-04 12:56 ` Dominik Csapak
2021-02-04 16:43 ` [pbs-devel] applied: [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dietmar Maurer
3 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-02-04 12:56 UTC (permalink / raw)
To: pbs-devel
so that a user can see if a tape in a library is not yet labeled
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/tape/ChangerStatus.js | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index f7e1b1f4..97294b72 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -377,19 +377,31 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
try {
Proxmox.Utils.setErrorMask(view, true);
Proxmox.Utils.setErrorMask(me.lookup('content'));
- let status = await PBS.Async.api2({
+ let status_fut = PBS.Async.api2({
url: `/api2/extjs/tape/changer/${encodeURIComponent(changer)}/status`,
});
- let drives = await PBS.Async.api2({
+ let drives_fut = PBS.Async.api2({
url: `/api2/extjs/tape/drive?changer=${encodeURIComponent(changer)}`,
});
+ let tapes_fut = PBS.Async.api2({
+ url: '/api2/extjs/tape/media/list',
+ });
+
+ let [status, drives, tapes_list] = await Promise.all([status_fut, drives_fut, tapes_fut]);
+
let data = {
slot: [],
'import-export': [],
drive: [],
};
+ let tapes = {};
+
+ for (const tape of tapes_list.result.data) {
+ tapes[tape['label-text']] = true;
+ }
+
let drive_entries = {};
for (const entry of drives.result.data) {
@@ -403,6 +415,8 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
entry = Ext.applyIf(entry, drive_entries[entry['entry-id']]);
}
+ entry['is-labeled'] = !!tapes[entry['label-text']];
+
data[type].push(entry);
}
@@ -520,6 +534,22 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
flex: 1,
renderer: (value) => value || '',
},
+ {
+ text: gettext('Labeled'),
+ dataIndex: 'is-labeled',
+ width: 80,
+ renderer: function(value, mD, record) {
+ if (!record.data['label-text']) {
+ return "";
+ }
+
+ if (record.data['label-text'].startsWith("CLN")) {
+ return "";
+ }
+
+ return Proxmox.Utils.format_boolean(value);
+ },
+ },
{
text: gettext('Actions'),
xtype: 'actioncolumn',
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys
2021-02-04 12:56 [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dominik Csapak
` (2 preceding siblings ...)
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 4/4] ui: tape/ChangerStatus: add 'is labeled' column for tapes Dominik Csapak
@ 2021-02-04 16:43 ` Dietmar Maurer
3 siblings, 0 replies; 5+ messages in thread
From: Dietmar Maurer @ 2021-02-04 16:43 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Dominik Csapak
applied all 4 patches
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-02-04 16:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 12:56 [pbs-devel] [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 2/4] ui: tape/PoolEdit: add selector for " Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 3/4] ui: tape/PoolConfig: add flex to columns Dominik Csapak
2021-02-04 12:56 ` [pbs-devel] [PATCH proxmox-backup 4/4] ui: tape/ChangerStatus: add 'is labeled' column for tapes Dominik Csapak
2021-02-04 16:43 ` [pbs-devel] applied: [PATCH proxmox-backup 1/4] ui: tape: add EncryptionPanel to add/remove encryption keys Dietmar Maurer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox