* [pve-devel] [PATCH widget-toolkit/manager] move PBSEncryptionCheckbox to proxmox-widget-toolkit
@ 2020-10-28 15:22 Stoiko Ivanov
2020-10-28 15:22 ` [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager Stoiko Ivanov
2020-10-28 15:22 ` [pve-devel] [PATCH manager 1/1] remove pbsEncryptionCheckbox Stoiko Ivanov
0 siblings, 2 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2020-10-28 15:22 UTC (permalink / raw)
To: pve-devel
This patchset is in preparation for adding PBS-integration to PMG.
It requires a versioned dependency from pve-mangager on proxmox-widget-toolkit
(and a Breaks in the other direction)
Tested by applying both patches and editing my configured PBS storages.
proxmox-widget-toolkit:
Stoiko Ivanov (1):
move pbsEncryptionCheckbox from pve-manager
src/Makefile | 1 +
src/form/PBSEncryptionCheckbox.js | 63 +++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
create mode 100644 src/form/PBSEncryptionCheckbox.js
pve-manager:
Stoiko Ivanov (1):
remove pbsEncryptionCheckbox
www/manager6/storage/PBSEdit.js | 62 ---------------------------------
1 file changed, 62 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager
2020-10-28 15:22 [pve-devel] [PATCH widget-toolkit/manager] move PBSEncryptionCheckbox to proxmox-widget-toolkit Stoiko Ivanov
@ 2020-10-28 15:22 ` Stoiko Ivanov
2020-10-28 16:09 ` Thomas Lamprecht
2020-10-28 15:22 ` [pve-devel] [PATCH manager 1/1] remove pbsEncryptionCheckbox Stoiko Ivanov
1 sibling, 1 reply; 4+ messages in thread
From: Stoiko Ivanov @ 2020-10-28 15:22 UTC (permalink / raw)
To: pve-devel
for reuse in PMG
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/Makefile | 1 +
src/form/PBSEncryptionCheckbox.js | 63 +++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
create mode 100644 src/form/PBSEncryptionCheckbox.js
diff --git a/src/Makefile b/src/Makefile
index cd0bf26..3e10e9d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -31,6 +31,7 @@ JSSRC= \
form/RoleSelector.js \
form/DiskSelector.js \
form/MultiDiskSelector.js \
+ form/PBSEncryptionCheckbox.js \
button/Button.js \
button/HelpButton.js \
grid/ObjectGrid.js \
diff --git a/src/form/PBSEncryptionCheckbox.js b/src/form/PBSEncryptionCheckbox.js
new file mode 100644
index 0000000..35c6950
--- /dev/null
+++ b/src/form/PBSEncryptionCheckbox.js
@@ -0,0 +1,63 @@
+Ext.define('Proxmox.form.PBSEncryptionCheckbox', {
+ extend: 'Ext.form.field.Checkbox',
+ xtype: 'pbsEncryptionCheckbox',
+
+ inputValue: true,
+
+ viewModel: {
+ data: {
+ value: null,
+ originalValue: null,
+ },
+ formulas: {
+ blabel: (get) => {
+ let v = get('value');
+ let original = get('originalValue');
+ if (!get('isCreate') && original) {
+ if (!v) {
+ return gettext('Warning: Existing encryption key will be deleted!');
+ }
+ return gettext('Active');
+ } else {
+ return gettext('Auto-generate a client encryption key, saved privately on cluster filesystem');
+ }
+ },
+ },
+ },
+
+ bind: {
+ value: '{value}',
+ boxLabel: '{blabel}',
+ },
+ resetOriginalValue: function() {
+ let me = this;
+ let vm = me.getViewModel();
+ vm.set('originalValue', me.value);
+
+ me.callParent(arguments);
+ },
+
+ getSubmitData: function() {
+ let me = this;
+ let val = me.getSubmitValue();
+ if (!me.isCreate) {
+ if (val === null) {
+ return { 'delete': 'encryption-key' };
+ } else if (val && !!val !== !!me.originalValue) {
+ return { 'encryption-key': 'autogen' };
+ }
+ } else if (val) {
+ return { 'encryption-key': 'autogen' };
+ }
+ return null;
+ },
+
+ initComponent: function() {
+ let me = this;
+ me.callParent();
+
+ let vm = me.getViewModel();
+ vm.set('isCreate', me.isCreate);
+ },
+});
+
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH manager 1/1] remove pbsEncryptionCheckbox
2020-10-28 15:22 [pve-devel] [PATCH widget-toolkit/manager] move PBSEncryptionCheckbox to proxmox-widget-toolkit Stoiko Ivanov
2020-10-28 15:22 ` [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager Stoiko Ivanov
@ 2020-10-28 15:22 ` Stoiko Ivanov
1 sibling, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2020-10-28 15:22 UTC (permalink / raw)
To: pve-devel
it got moved to proxmox-widget-toolkit for reuse in PMG
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
www/manager6/storage/PBSEdit.js | 62 ---------------------------------
1 file changed, 62 deletions(-)
diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
index 841b5218..58d38b34 100644
--- a/www/manager6/storage/PBSEdit.js
+++ b/www/manager6/storage/PBSEdit.js
@@ -1,65 +1,3 @@
-Ext.define('Proxmox.form.PBSEncryptionCheckbox', {
- extend: 'Ext.form.field.Checkbox',
- xtype: 'pbsEncryptionCheckbox',
-
- inputValue: true,
-
- viewModel: {
- data: {
- value: null,
- originalValue: null,
- },
- formulas: {
- blabel: (get) => {
- let v = get('value');
- let original = get('originalValue');
- if (!get('isCreate') && original) {
- if (!v) {
- return gettext('Warning: Existing encryption key will be deleted!');
- }
- return gettext('Active');
- } else {
- return gettext('Auto-generate a client encryption key, saved privately on cluster filesystem');
- }
- },
- },
- },
-
- bind: {
- value: '{value}',
- boxLabel: '{blabel}',
- },
- resetOriginalValue: function() {
- let me = this;
- let vm = me.getViewModel();
- vm.set('originalValue', me.value);
-
- me.callParent(arguments);
- },
-
- getSubmitData: function() {
- let me = this;
- let val = me.getSubmitValue();
- if (!me.isCreate) {
- if (val === null) {
- return { 'delete': 'encryption-key' };
- } else if (val && !!val !== !!me.originalValue) {
- return { 'encryption-key': 'autogen' };
- }
- } else if (val) {
- return { 'encryption-key': 'autogen' };
- }
- return null;
- },
-
- initComponent: function() {
- let me = this;
- me.callParent();
-
- let vm = me.getViewModel();
- vm.set('isCreate', me.isCreate);
- },
-});
Ext.define('PVE.storage.PBSInputPanel', {
extend: 'PVE.panel.StorageBase',
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager
2020-10-28 15:22 ` [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager Stoiko Ivanov
@ 2020-10-28 16:09 ` Thomas Lamprecht
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2020-10-28 16:09 UTC (permalink / raw)
To: Proxmox VE development discussion, Stoiko Ivanov
On 28.10.20 16:22, Stoiko Ivanov wrote:
> for reuse in PMG
>
I'd rather fix this first in PVE, currently it provides a horrendous UX...
We want to:
* allow uploading a key
* explicitly warn about the importance when auto-generating one and provide
and easy download and paper-key button.
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> src/Makefile | 1 +
> src/form/PBSEncryptionCheckbox.js | 63 +++++++++++++++++++++++++++++++
> 2 files changed, 64 insertions(+)
> create mode 100644 src/form/PBSEncryptionCheckbox.js
>
> diff --git a/src/Makefile b/src/Makefile
> index cd0bf26..3e10e9d 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -31,6 +31,7 @@ JSSRC= \
> form/RoleSelector.js \
> form/DiskSelector.js \
> form/MultiDiskSelector.js \
> + form/PBSEncryptionCheckbox.js \
> button/Button.js \
> button/HelpButton.js \
> grid/ObjectGrid.js \
> diff --git a/src/form/PBSEncryptionCheckbox.js b/src/form/PBSEncryptionCheckbox.js
> new file mode 100644
> index 0000000..35c6950
> --- /dev/null
> +++ b/src/form/PBSEncryptionCheckbox.js
> @@ -0,0 +1,63 @@
> +Ext.define('Proxmox.form.PBSEncryptionCheckbox', {
> + extend: 'Ext.form.field.Checkbox',
> + xtype: 'pbsEncryptionCheckbox',
> +
> + inputValue: true,
> +
> + viewModel: {
> + data: {
> + value: null,
> + originalValue: null,
> + },
> + formulas: {
> + blabel: (get) => {
> + let v = get('value');
> + let original = get('originalValue');
> + if (!get('isCreate') && original) {
> + if (!v) {
> + return gettext('Warning: Existing encryption key will be deleted!');
> + }
> + return gettext('Active');
> + } else {
> + return gettext('Auto-generate a client encryption key, saved privately on cluster filesystem');
PMG has no cluster filesystem?
> + }
> + },
> + },
> + },
> +
> + bind: {
> + value: '{value}',
> + boxLabel: '{blabel}',
> + },
> + resetOriginalValue: function() {
> + let me = this;
> + let vm = me.getViewModel();
> + vm.set('originalValue', me.value);
> +
> + me.callParent(arguments);
> + },
> +
> + getSubmitData: function() {
> + let me = this;
> + let val = me.getSubmitValue();
> + if (!me.isCreate) {
> + if (val === null) {
> + return { 'delete': 'encryption-key' };
> + } else if (val && !!val !== !!me.originalValue) {
> + return { 'encryption-key': 'autogen' };
> + }
> + } else if (val) {
> + return { 'encryption-key': 'autogen' };
> + }
> + return null;
> + },
> +
> + initComponent: function() {
> + let me = this;
> + me.callParent();
> +
> + let vm = me.getViewModel();
> + vm.set('isCreate', me.isCreate);
> + },
> +});
> +
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-28 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 15:22 [pve-devel] [PATCH widget-toolkit/manager] move PBSEncryptionCheckbox to proxmox-widget-toolkit Stoiko Ivanov
2020-10-28 15:22 ` [pve-devel] [PATCH widget-toolkit 1/1] move pbsEncryptionCheckbox from pve-manager Stoiko Ivanov
2020-10-28 16:09 ` Thomas Lamprecht
2020-10-28 15:22 ` [pve-devel] [PATCH manager 1/1] remove pbsEncryptionCheckbox Stoiko Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox