forked from dannysu/node-red-contrib-merge
-
Notifications
You must be signed in to change notification settings - Fork 1
/
17-merge.html
44 lines (41 loc) · 1.64 KB
/
17-merge.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
<!DOCTYPE html>
<script type="text/x-red" data-template-name="mergeTopic">
<div class="node-row-custom">
<div class="form-row node-row-trigger">
<label style="width: auto;">Send the message:</label>
<ul>
<li style="height: 40px;">
<label style="width: 280px;" for="node-input-timeout">After a timeout following the last message:</label> <input id="node-input-timeout" placeholder="seconds" type="text" style="width: 75px;">
</li><b>
OR
<li style="height: 40px;">
<label style="width: 280px;" for="node-input-msglimit">Once the topic queue goes beyong more entries than:</label> <input id="node-input-msglimit" placeholder="msglimit" type="text" style="width: 75px;">
</li>
</ul>
</div>
</div>
</script>
<script type="text/x-red" data-help-name="mergeTopic">
<p>A function that merges <b>per topic</b> the a sequence of messages into a single message.</p>
<p>A <i>timeout</i> is used to trigger sending the new message using whatever has been received so far.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('mergeTopic',{
category: 'function',
color:"#E2D96E",
defaults: {
name: {value:""},
timeout: {value:""},
msglimit: {value:0}
},
inputs:1,
outputs:1,
icon: "join.png",
label: function() {
return this.name || "mergeTopic";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>