public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/6] ui: metrics: don't send digest when creating a new influxdbupd host
Date: Wed,  6 Mar 2024 12:21:00 +0100	[thread overview]
Message-ID: <20240306112104.2486728-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20240306112104.2486728-1-d.csapak@proxmox.com>

we accidentally always tried to load an existing config, even when
creating a new entry. This returned the list of all configured ones plus
the digest (which gets set by the edit window). When the digest is set,
the edit window will send it along, but that does not exist for the
create api call, so it failed.

To fix it, guard the load behind the `serverid` property, which is only
set when we edit an existing entry.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/window/InfluxDbEdit.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/www/window/InfluxDbEdit.js b/www/window/InfluxDbEdit.js
index e4467737..b1927d6a 100644
--- a/www/window/InfluxDbEdit.js
+++ b/www/window/InfluxDbEdit.js
@@ -205,14 +205,16 @@ Ext.define('PBS.window.InfluxDbUdpEdit', {
 	let me = this;
 	me.callParent();
 
-	me.load({
-	    success: function(response, options) {
-		let values = response.result.data;
-		let [_match, host, port] = /^(.*):(\d+)$/.exec(values.host) || [];
-		values.host = host;
-		values.port = port;
-		me.setValues(values);
-	    },
-	});
+	if (me.serverid) {
+	    me.load({
+		    success: function(response, options) {
+			let values = response.result.data;
+			let [_match, host, port] = /^(.*):(\d+)$/.exec(values.host) || [];
+			values.host = host;
+			values.port = port;
+			me.setValues(values);
+		    },
+	    });
+	}
     },
 });
-- 
2.39.2





  parent reply	other threads:[~2024-03-06 11:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 11:20 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] adapt to stricter api parameter checks Dominik Csapak
2024-03-06 11:20 ` [pbs-devel] [PATCH widget-toolkit 1/1] realms: don't send type and delete on creation Dominik Csapak
2024-03-06 11:20 ` [pbs-devel] [PATCH proxmox-backup 1/6] ui: prune job edit: indent fix Dominik Csapak
2024-03-06 11:21 ` Dominik Csapak [this message]
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 3/6] ui: tape backup job: don't send delete value on creation Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: prune: fix sending invalid parameters Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync job: don't send delete value on creation Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: verify " Dominik Csapak
2024-03-07  9:32 ` [pbs-devel] applied-series: [PATCH widget-toolkit/proxmox-backup] adapt to stricter api parameter checks 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=20240306112104.2486728-4-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 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