-
Notifications
You must be signed in to change notification settings - Fork 2
/
konecty-server.html
49 lines (45 loc) · 1.45 KB
/
konecty-server.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
<script type="text/javascript">
RED.nodes.registerType('konecty-server', {
category: 'config',
defaults: {
name: { value: '', required: true },
host: { value: 'konecty-embedded-server', required: true },
hostType: { value: "str", required: true },
key: { value: '', required: true },
keyType: { value: "str", required: true },
},
label: function () {
return this.name;
},
oneditprepare: function () {
const node = this;
$("#node-config-input-host").typedInput({
default: node.hostType || "str",
types: ["str", "env", "global"]
});
$("#node-config-input-key").typedInput({
default: node.keyType || "str",
types: ["str", "env", "global"]
});
},
oneditsave: function () {
const node = this;
node.hostType = $("#node-config-input-host").typedInput("type");
node.keyType = $("#node-config-input-key").typedInput("type");
}
});
</script>
<script type="text/x-red" data-template-name="konecty-server">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-bookmark"></i> Name</label>
<input type="text" id="node-config-input-name">
</div>
<div class="form-row">
<label for="node-config-input-host"><i class="icon-bookmark"></i> Host</label>
<input type="text" id="node-config-input-host">
</div>
<div class="form-row">
<label for="node-config-input-key"><i class="icon-bookmark"></i> Access Key</label>
<input type="text" id="node-config-input-key">
</div>
</script>