From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values
Date: Fri, 1 Mar 2024 10:03:40 +0100 [thread overview]
Message-ID: <20240301090341.1342682-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20240301090341.1342682-1-d.csapak@proxmox.com>
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
next prev parent reply other threads:[~2024-03-01 9:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2024-03-01 11:43 ` [pbs-devel] applied: Re: [PATCH widget-toolkit 1/1] dns: optionally send delete for optional values 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240301090341.1342682-2-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal