Fix save and history of credentials for panes

This commit is contained in:
GogoVega 2024-06-24 17:55:23 +02:00
parent cb0c484579
commit eab512ef22
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -131,9 +131,13 @@
} }
} }
if (node._def.credentials) { if (node._def.credentials) {
var credDefinition = node._def.credentials; const credsDefinition = node._def.credentials;
var credsChanged = updateNodeCredentials(node,credDefinition,this.inputClass); const credsChanged = updateNodeCredentials(node, credsDefinition, this.inputClass);
editState.changed = editState.changed || credsChanged;
if (credsChanged) {
editState.changed = true;
editState.changes.credentials = node.credentials._;
}
} }
} }
} }
@ -178,11 +182,14 @@
var value = input.val(); var value = input.val();
if (credDefinition[cred].type == 'password') { if (credDefinition[cred].type == 'password') {
node.credentials['has_' + cred] = (value !== ""); node.credentials['has_' + cred] = (value !== "");
if (value == '__PWRD__') {
// Skip if the credential has not changed
if ((value === '__PWRD__' && node.credentials._['has_' + cred] === true) ||
(value === "" && node.credentials._['has_' + cred] === false)) {
continue; continue;
} }
changed = true;
changed = true;
} }
node.credentials[cred] = value; node.credentials[cred] = value;
if (value != node.credentials._[cred]) { if (value != node.credentials._[cred]) {
@ -193,6 +200,4 @@
} }
return changed; return changed;
} }
})(); })();