ui: metrics: don't send digest when creating a new influxdbupd host

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>
This commit is contained in:
Dominik Csapak 2024-03-06 12:21:00 +01:00 committed by Thomas Lamprecht
parent 38fd54fbc8
commit 19458d754e

View File

@ -205,6 +205,7 @@ Ext.define('PBS.window.InfluxDbUdpEdit', {
let me = this;
me.callParent();
if (me.serverid) {
me.load({
success: function(response, options) {
let values = response.result.data;
@ -214,5 +215,6 @@ Ext.define('PBS.window.InfluxDbUdpEdit', {
me.setValues(values);
},
});
}
},
});