diff --git a/.vscode/settings.json b/.vscode/settings.json
index baaa261..07d49d6 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,6 @@
{
"cSpell.words": [
- "oneditprepare"
+ "oneditprepare",
+ "oneditsave"
]
}
\ No newline at end of file
diff --git a/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/editor.html b/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/editor.html
index 19db4a0..9d11c17 100644
--- a/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/editor.html
+++ b/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/editor.html
@@ -5,7 +5,7 @@
-
-
+
+
diff --git a/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/index.ts b/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/index.ts
index dd100e4..135b425 100644
--- a/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/index.ts
+++ b/source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/index.ts
@@ -23,6 +23,9 @@ function isValidOPC_UA_URI(str: string) {
RED.nodes.registerType("OpcUa-Endpoint2", {
category: "config",
defaults: {
+
+ name: { value: "" },
+
endpoint: {
value: "",
required: true,
@@ -71,6 +74,7 @@ RED.nodes.registerType("OpcUa-Endpoint2", {
_securityMode.text("None");
}
},
+
oneditprepare() {
const node = this;
// -----------------------------------------------------------------------
@@ -110,7 +114,7 @@ RED.nodes.registerType("OpcUa-Endpoint2", {
const updateIdentityControls = function (userIdentityType: string) {
switch (userIdentityType) {
case "Anonymous":
- $("#node-input-user").val("");
+ $("#node-input-userName").val("");
$("#node-input-password").val("");
authRow.hide();
certRow.hide();
@@ -120,7 +124,7 @@ RED.nodes.registerType("OpcUa-Endpoint2", {
certRow.hide();
break;
case "Certificate":
- $("#node-input-user").val("");
+ $("#node-input-userName").val("");
$("#node-input-password").val("");
certRow.show();
authRow.hide();
diff --git a/source/nodes/tools/connection_tools.ts b/source/nodes/tools/connection_tools.ts
index 6b2c677..07fe9e9 100644
--- a/source/nodes/tools/connection_tools.ts
+++ b/source/nodes/tools/connection_tools.ts
@@ -94,7 +94,8 @@ export async function get_opcua_endpoint(endpointNode: OpcUaEndpoint2Node, reque
pendingConnection.set(endpointId, []);
const securityMode = MessageSecurityMode[(endpointNode.securityMode as any) || "None"] || MessageSecurityMode.None;
- const securityPolicy = coerceSecurityPolicy(endpointNode.securityPolicy);
+ const securityPolicy =
+ securityMode === MessageSecurityMode.None ? SecurityPolicy.None : coerceSecurityPolicy(endpointNode.securityPolicy);
nodeToNotify.warn("securityMode = " + securityMode);
nodeToNotify.warn("securityPolicy = " + securityPolicy);