public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options'
@ 2021-05-12 14:42 Dominik Csapak
  2021-05-12 19:24 ` Thomas Lamprecht
  2021-05-25  5:52 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2021-05-12 14:42 UTC (permalink / raw)
  To: pbs-devel

for now only http-proxy lives there, but we will add more options later,
such as
* email from
* default gui language

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/Makefile                 |  1 +
 www/SystemConfiguration.js   |  5 +++++
 www/config/NodeOptionView.js | 42 ++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 www/config/NodeOptionView.js

diff --git a/www/Makefile b/www/Makefile
index f0b795ca..517cbd23 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -54,6 +54,7 @@ JSSRC=							\
 	config/VerifyView.js				\
 	config/WebauthnView.js				\
 	config/CertificateView.js			\
+	config/NodeOptionView.js			\
 	window/ACLEdit.js				\
 	window/AddTfaRecovery.js			\
 	window/AddTotp.js				\
diff --git a/www/SystemConfiguration.js b/www/SystemConfiguration.js
index 025e0273..211c9c08 100644
--- a/www/SystemConfiguration.js
+++ b/www/SystemConfiguration.js
@@ -65,6 +65,11 @@ Ext.define('PBS.SystemConfiguration', {
 		},
 	    ],
 	},
+	{
+	    title: gettext('Options'),
+	    itemId: 'options',
+	    xtype: 'pbsNodeOptionView',
+	},
     ],
 
     initComponent: function() {
diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
new file mode 100644
index 00000000..beeea35f
--- /dev/null
+++ b/www/config/NodeOptionView.js
@@ -0,0 +1,42 @@
+Ext.define('PBS.NodeOptionView', {
+    extend: 'Proxmox.grid.ObjectGrid',
+    alias: 'widget.pbsNodeOptionView',
+
+    monStoreErrors: true,
+
+    url: `/api2/json/nodes/${Proxmox.NodeName}/config`,
+    editorConfig: {
+	url: `/api2/extjs/nodes/${Proxmox.NodeName}/config`,
+    },
+    interval: 5000,
+    cwidth1: 200,
+
+    listeners: {
+	itemdblclick: function() { this.run_editor() },
+    },
+
+    tbar: [
+	{
+	    text: gettext('Edit'),
+	    xtype: 'proxmoxButton',
+	    disabled: true,
+	    handler: function() { this.up('grid').run_editor(); },
+	}
+    ],
+
+    initComponent: function() {
+	let me = this;
+
+	me.add_text_row('http-proxy', gettext('HTTP proxy'), {
+	    defaultValue: Proxmox.Utils.noneText,
+	    vtype: 'HttpProxy',
+	    deleteEmpty: true,
+	});
+
+	me.callParent();
+
+	me.on('activate', me.rstore.startUpdate);
+	me.on('destroy', me.rstore.stopUpdate);
+	me.on('deactivate', me.rstore.stopUpdate);
+    },
+});
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options'
  2021-05-12 14:42 [pbs-devel] [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options' Dominik Csapak
@ 2021-05-12 19:24 ` Thomas Lamprecht
  2021-05-25  5:52 ` [pbs-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-05-12 19:24 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

On 12.05.21 16:42, Dominik Csapak wrote:
> for now only http-proxy lives there, but we will add more options later,
> such as
> * email from
> * default gui language
> 

that combination of quite general names, configuration and options, both meaning 
basically the same general thing, is really confusing..

I'll see if I can come up with a better name or alternative placing..

> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/Makefile                 |  1 +
>  www/SystemConfiguration.js   |  5 +++++
>  www/config/NodeOptionView.js | 42 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+)
>  create mode 100644 www/config/NodeOptionView.js
> 
> diff --git a/www/Makefile b/www/Makefile
> index f0b795ca..517cbd23 100644
> --- a/www/Makefile
> +++ b/www/Makefile
> @@ -54,6 +54,7 @@ JSSRC=							\
>  	config/VerifyView.js				\
>  	config/WebauthnView.js				\
>  	config/CertificateView.js			\
> +	config/NodeOptionView.js			\
>  	window/ACLEdit.js				\
>  	window/AddTfaRecovery.js			\
>  	window/AddTotp.js				\
> diff --git a/www/SystemConfiguration.js b/www/SystemConfiguration.js
> index 025e0273..211c9c08 100644
> --- a/www/SystemConfiguration.js
> +++ b/www/SystemConfiguration.js
> @@ -65,6 +65,11 @@ Ext.define('PBS.SystemConfiguration', {
>  		},
>  	    ],
>  	},
> +	{
> +	    title: gettext('Options'),
> +	    itemId: 'options',
> +	    xtype: 'pbsNodeOptionView',
> +	},
>      ],
>  
>      initComponent: function() {
> diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
> new file mode 100644
> index 00000000..beeea35f
> --- /dev/null
> +++ b/www/config/NodeOptionView.js
> @@ -0,0 +1,42 @@
> +Ext.define('PBS.NodeOptionView', {
> +    extend: 'Proxmox.grid.ObjectGrid',
> +    alias: 'widget.pbsNodeOptionView',
> +
> +    monStoreErrors: true,
> +
> +    url: `/api2/json/nodes/${Proxmox.NodeName}/config`,
> +    editorConfig: {
> +	url: `/api2/extjs/nodes/${Proxmox.NodeName}/config`,
> +    },
> +    interval: 5000,
> +    cwidth1: 200,
> +
> +    listeners: {
> +	itemdblclick: function() { this.run_editor() },
> +    },
> +
> +    tbar: [
> +	{
> +	    text: gettext('Edit'),
> +	    xtype: 'proxmoxButton',
> +	    disabled: true,
> +	    handler: function() { this.up('grid').run_editor(); },
> +	}
> +    ],
> +
> +    initComponent: function() {
> +	let me = this;
> +
> +	me.add_text_row('http-proxy', gettext('HTTP proxy'), {
> +	    defaultValue: Proxmox.Utils.noneText,
> +	    vtype: 'HttpProxy',
> +	    deleteEmpty: true,
> +	});
> +
> +	me.callParent();
> +
> +	me.on('activate', me.rstore.startUpdate);
> +	me.on('destroy', me.rstore.stopUpdate);
> +	me.on('deactivate', me.rstore.stopUpdate);
> +    },
> +});
> 





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options'
  2021-05-12 14:42 [pbs-devel] [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options' Dominik Csapak
  2021-05-12 19:24 ` Thomas Lamprecht
@ 2021-05-25  5:52 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-05-25  5:52 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

On 12.05.21 16:42, Dominik Csapak wrote:
> for now only http-proxy lives there, but we will add more options later,
> such as
> * email from
> * default gui language
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/Makefile                 |  1 +
>  www/SystemConfiguration.js   |  5 +++++
>  www/config/NodeOptionView.js | 42 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+)
>  create mode 100644 www/config/NodeOptionView.js
> 
>

applied, thanks! But reworked it to a more static declaration in and avoided
introducing the slightly weird, over-general `Configuration -> Options` tab,
I just added it to the existing `Authentication` one for now, fits there OK
enough and solving the Configuration/Administration weirdness needs more thought
and a major release, as I'd like to avoid reshuffling components in a stable one.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 14:42 [pbs-devel] [PATCH proxmox-backup] ui: add node options under 'Configuration -> Options' Dominik Csapak
2021-05-12 19:24 ` Thomas Lamprecht
2021-05-25  5:52 ` [pbs-devel] applied: " Thomas Lamprecht

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