-
Notifications
You must be signed in to change notification settings - Fork 0
/
zyre-connect.html
49 lines (45 loc) · 1.68 KB
/
zyre-connect.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('zyre-connect', {
category: 'Zyre',
color: '#a6bbcf',
defaults: {
name: {
value: 'connect',
required: true
},
zyre: {
value: '',
type: 'zyre-peer',
required: true
}
},
inputs: 0,
outputs: 1,
icon: 'zeromq.png',
label: function () {
return this.name || 'zyre-connect'
}
})
</script>
<script type="text/html" data-template-name="zyre-connect">
<div class="form-row">
<label for="node-input-zyre"><i class="fa fa-server"></i> Zyre Peer</label>
<select id="node-input-zyre"></select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/html" data-help-name="zyre-connect">
<p>Get notified when a peer connects to the Zyre network.</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>topic <span class="property-type">string</span></dt>
<dd>The identity of the peer that connected to the Zyre network.</dd>
<dt>payload <span class="property-type">object</span></dt>
<dd>Information about the connected peer, including <code>identity</code>, <code>name</code>, and <code>headers</code>.</dd>
</dl>
<h3>Details</h3>
<p>This node outputs a message whenever a peer connects to the zyre network. <code>msg.payload</code> contains headers that allow peers to broadcast capabilities or unique attributes they wish to share with the network. It's a good idea to capture this information in a flow or global variable if applicable, so you can use it later.</p>
</script>