Skip to content

Commit

Permalink
OpcUaEndpoint2 adjust UI
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Aug 18, 2023
1 parent 4cfb4ae commit 350779f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"oneditprepare"
"oneditprepare",
"oneditsave"
]
}
6 changes: 3 additions & 3 deletions source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</style>

<div class="form-row">
<label for="node-config-input-name"><i class="icon-tasks"></i> Name</label>
<label for="node-config-input-name"><i class="icon-tasks"></i>Name</label>
<input type="text" id="node-config-input-name" placeholder="enter the friendly name of the connection" />
</div>

Expand Down Expand Up @@ -57,8 +57,8 @@
</div>
<div class="section-userIdentityType-UserName">
<div class="form-row">
<label for="node-config-input-user"><i class="icon-user"></i> User</label>
<input type="text" id="node-config-input-user" />
<label for="node-config-input-userName"><i class="icon-user"></i> User</label>
<input type="text" id="node-config-input-userName" />
</div>
<div class="form-row">
<label for="node-config-input-password"><i class="icon-password"></i> Password</label>
Expand Down
8 changes: 6 additions & 2 deletions source/nodes/OpcUa-Endpoint2/OpcUa-Endpoint2.html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function isValidOPC_UA_URI(str: string) {
RED.nodes.registerType<OpcUaEndpoint2NodeProperties, CRED>("OpcUa-Endpoint2", {
category: "config",
defaults: {

name: { value: "" },

endpoint: {
value: "",
required: true,
Expand Down Expand Up @@ -71,6 +74,7 @@ RED.nodes.registerType<OpcUaEndpoint2NodeProperties, CRED>("OpcUa-Endpoint2", {
_securityMode.text("None");
}
},

oneditprepare() {
const node = this;
// -----------------------------------------------------------------------
Expand Down Expand Up @@ -110,7 +114,7 @@ RED.nodes.registerType<OpcUaEndpoint2NodeProperties, CRED>("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();
Expand All @@ -120,7 +124,7 @@ RED.nodes.registerType<OpcUaEndpoint2NodeProperties, CRED>("OpcUa-Endpoint2", {
certRow.hide();
break;
case "Certificate":
$("#node-input-user").val("");
$("#node-input-userName").val("");
$("#node-input-password").val("");
certRow.show();
authRow.hide();
Expand Down
3 changes: 2 additions & 1 deletion source/nodes/tools/connection_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 350779f

Please sign in to comment.