-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopcua-client.html
81 lines (77 loc) · 3.18 KB
/
opcua-client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<script type="text/javascript">
RED.nodes.registerType('opcua-client', {
category: 'config',
defaults: {
name: { required: true },
host: { required: true },
securitypolicy: { value: "None", required: true },
messagesecurity: { value: "None", required: true },
anonymous: { value: true, required: false },
username: { required: false },
password: { required: false }
},
label: function () {
return this.name;
},
oneditprepare: function () {
$("#node-config-input-securitypolicy").typedInput({
types: [
{
options: [
{ value: "None", label: "None" },
{ value: "Basic256", label: "Basic256" },
{ value: "Basic256Sha256", label: "Basic256Sha256" }
]
}
]
});
$("#node-config-input-messagesecurity").typedInput({
types: [
{
options: [
{ value: "None", label: "None" },
{ value: "Sign", label: "Sign" },
{ value: "SignAndEncrypt", label: "Sign&Encrypt" }
]
}
]
});
$("#node-config-input-anonymous").on('change', function (event) {
const value = $("#node-config-input-anonymous")[0].checked;
$("#node-config-input-username")[0].readOnly = value;
$("#node-config-input-password")[0].readOnly = value;
});
}
});
</script>
<script type="text/html" data-template-name="opcua-client">
<div class="form-row">
<label for="node-config-input-name"></i> Name</label>
<input type="text" id="node-config-input-name">
</div>
<div class="form-row">
<label for="node-config-input-host"><i class="fa fa-server"></i> Host</label>
<input type="text" id="node-config-input-host" placeholder="opc.tcp://localhost:4840/">
</div>
<h4>Authentication Settings</h4>
<div class="form-row">
<label for="node-config-input-securitypolicy"><i class="fa fa-lock"></i> Security Policy</label>
<input type="text" id="node-config-input-securitypolicy">
</div>
<div class="form-row">
<label for="node-config-input-messagesecurity"><i class="fa fa-envelope"></i> Message Security Mode</label>
<input type="text" id="node-config-input-messagesecurity">
</div>
<div class="form-row">
<label for="node-config-input-anonymous">Anonymous</label>
<input type="checkbox" id="node-config-input-anonymous" style="margin: 5px 0px; width: auto;">
</div>
<div class="form-row">
<label for="node-config-input-username">Username</label>
<input type="text" id="node-config-input-username">
</div>
<div class="form-row">
<label for="node-config-input-password">Password</label>
<input type="password" id="node-config-input-password">
</div>
</script>