[pbs-devel] [PATCH proxmox-backup 2/6] ui: metrics: don't send digest when creating a new influxdbupd host
Dominik Csapak
d.csapak at proxmox.com
Wed Mar 6 12:21:00 CET 2024
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 at 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
More information about the pbs-devel
mailing list