public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH widget-toolkit/proxmox-backup] ui: fix deleting dns servers
@ 2024-03-01  9:03 Dominik Csapak
  2024-03-01  9:03 ` [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values Dominik Csapak
  2024-03-01  9:03 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries Dominik Csapak
  0 siblings, 2 replies; 5+ messages in thread
From: Dominik Csapak @ 2024-03-01  9:03 UTC (permalink / raw)
  To: pbs-devel

by enabling 'deleteEmpty' for those form fields in pbs

will look into modifying the pve/pmg code to behave similarly as pbs
(possibly with an opt in flag), but this should be an immediate fix
for pbs for now.

when pve/pmg behaves similarly, we could drop the optional setting of
that again

proxmox-widget-toolkit:

Dominik Csapak (1):
  dns: optionally send delete for optional values

 src/node/DNSEdit.js | 6 ++++++
 src/node/DNSView.js | 4 ++++
 2 files changed, 10 insertions(+)

proxmox-backup:

Dominik Csapak (1):
  ui: fix deleting of optional dns server entries

 www/SystemConfiguration.js | 1 +
 1 file changed, 1 insertion(+)

-- 
2.30.2





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

* [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values
  2024-03-01  9:03 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] ui: fix deleting dns servers Dominik Csapak
@ 2024-03-01  9:03 ` Dominik Csapak
  2024-03-01 11:43   ` [pbs-devel] applied: " Thomas Lamprecht
  2024-03-01  9:03 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries Dominik Csapak
  1 sibling, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2024-03-01  9:03 UTC (permalink / raw)
  To: pbs-devel

pbs only deletes the optional values here when they are sent with the
'delete' parameter, in contrast to pve/pmg that don't have a delete
parameter currently and always use the parameters as source of truth.

So to handle that, optionally set deleteEmpty if set from outside

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/node/DNSEdit.js | 6 ++++++
 src/node/DNSView.js | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/src/node/DNSEdit.js b/src/node/DNSEdit.js
index 0b1135e..c895d9b 100644
--- a/src/node/DNSEdit.js
+++ b/src/node/DNSEdit.js
@@ -2,6 +2,9 @@ Ext.define('Proxmox.node.DNSEdit', {
     extend: 'Proxmox.window.Edit',
     alias: ['widget.proxmoxNodeDNSEdit'],
 
+    // pbs needs this set to true
+    deleteEmpty: false,
+
     initComponent: function() {
 	let me = this;
 
@@ -21,6 +24,7 @@ Ext.define('Proxmox.node.DNSEdit', {
                 fieldLabel: gettext('DNS server') + " 1",
 		vtype: 'IP64Address',
 		skipEmptyText: true,
+		deleteEmpty: me.deleteEmpty,
                 name: 'dns1',
 	    },
 	    {
@@ -28,6 +32,7 @@ Ext.define('Proxmox.node.DNSEdit', {
 		fieldLabel: gettext('DNS server') + " 2",
 		vtype: 'IP64Address',
 		skipEmptyText: true,
+		deleteEmpty: me.deleteEmpty,
                 name: 'dns2',
 	    },
 	    {
@@ -35,6 +40,7 @@ Ext.define('Proxmox.node.DNSEdit', {
                 fieldLabel: gettext('DNS server') + " 3",
 		vtype: 'IP64Address',
 		skipEmptyText: true,
+		deleteEmpty: me.deleteEmpty,
                 name: 'dns3',
 	    },
 	];
diff --git a/src/node/DNSView.js b/src/node/DNSView.js
index 4782f9c..b57da85 100644
--- a/src/node/DNSView.js
+++ b/src/node/DNSView.js
@@ -2,6 +2,9 @@ Ext.define('Proxmox.node.DNSView', {
     extend: 'Proxmox.grid.ObjectGrid',
     alias: ['widget.proxmoxNodeDNSView'],
 
+    // pbs needs this set to true
+    deleteEmpty: false,
+
     initComponent: function() {
 	let me = this;
 
@@ -12,6 +15,7 @@ Ext.define('Proxmox.node.DNSView', {
 	let run_editor = () => Ext.create('Proxmox.node.DNSEdit', {
 	    autoShow: true,
 	    nodename: me.nodename,
+	    deleteEmpty: me.deleteEmpty,
 	});
 
 	Ext.apply(me, {
-- 
2.30.2





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

* [pbs-devel] [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries
  2024-03-01  9:03 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] ui: fix deleting dns servers Dominik Csapak
  2024-03-01  9:03 ` [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values Dominik Csapak
@ 2024-03-01  9:03 ` Dominik Csapak
  2024-03-04 13:53   ` [pbs-devel] applied: " Thomas Lamprecht
  1 sibling, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2024-03-01  9:03 UTC (permalink / raw)
  To: pbs-devel

by setting the new 'deleteEmpty' parameter on the dns view

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/SystemConfiguration.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/www/SystemConfiguration.js b/www/SystemConfiguration.js
index 860d85c0..e94fe7ca 100644
--- a/www/SystemConfiguration.js
+++ b/www/SystemConfiguration.js
@@ -31,6 +31,7 @@ Ext.define('PBS.SystemConfiguration', {
 		},
 		{
 		    xtype: 'proxmoxNodeDNSView',
+		    deleteEmpty: true,
 		    title: gettext('DNS'),
 		    nodename: 'localhost',
 		},
-- 
2.30.2





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

* [pbs-devel] applied: Re: [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values
  2024-03-01  9:03 ` [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values Dominik Csapak
@ 2024-03-01 11:43   ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2024-03-01 11:43 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

On 01/03/2024 10:03, Dominik Csapak wrote:
> pbs only deletes the optional values here when they are sent with the
> 'delete' parameter, in contrast to pve/pmg that don't have a delete
> parameter currently and always use the parameters as source of truth.
> 
> So to handle that, optionally set deleteEmpty if set from outside
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/node/DNSEdit.js | 6 ++++++
>  src/node/DNSView.js | 4 ++++
>  2 files changed, 10 insertions(+)
> 
>

applied, with a follow up for the comment to avoid coupling this to a
specific downstream dependency, that just will get outdated and has not
much use on its own anyway here, thanks!




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

* [pbs-devel] applied: [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries
  2024-03-01  9:03 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries Dominik Csapak
@ 2024-03-04 13:53   ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2024-03-04 13:53 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

Am 01/03/2024 um 10:03 schrieb Dominik Csapak:
> by setting the new 'deleteEmpty' parameter on the dns view
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/SystemConfiguration.js | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied, but amended the commit message with some details about what
was actually wrong, thanks!




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

end of thread, other threads:[~2024-03-04 13:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01  9:03 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] ui: fix deleting dns servers Dominik Csapak
2024-03-01  9:03 ` [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values Dominik Csapak
2024-03-01 11:43   ` [pbs-devel] applied: " Thomas Lamprecht
2024-03-01  9:03 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: fix deleting of optional dns server entries Dominik Csapak
2024-03-04 13:53   ` [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