-
Notifications
You must be signed in to change notification settings - Fork 591
/
Copy pathpusher.html
146 lines (133 loc) · 5.23 KB
/
pusher.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<script type="text/x-red" data-template-name="pusher in">
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="channel">
</div>
<div class="form-row">
<label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
<input type="text" id="node-input-eventname" placeholder="event name">
</div>
<div class="form-row">
<label for="node-input-pusherappkeysub"><i class="fa fa-lock"></i> App Key</label>
<input type="text" id="node-input-pusherappkeysub" placeholder="key">
</div>
<div class="form-row">
<label for="node-input-cluster"><i class="fa fa-server"></i> Cluster</label>
<select type="text" id="node-input-cluster">
<option value="mt1">N. Virginia (US - default)</option>
<option value="us2">Ohio (US)</option>
<option value="us3">Oregon (US)</option>
<option value="eu">Ireland (Europe)</option>
<option value="ap1">Singapore (Asia)</option>
<option value="ap2">Mumbai (India)</option>
<option value="ap3">Tokyo (Asia)</option>
<option value="ap4">Sydney (Australia)</option>
<option value="sa1">São Paulo (Brazil)</option>
</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/x-red" data-help-name="pusher in">
<p>Pusher input mode. Use this node to subscribe to a Pusher channel/event.</p>
<p>You need a valid Pusher App key.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('pusher in',{
category: 'mobile-input',
color:"#A9D0F5",
defaults: {
name: {value:""},
channel: {value:"", required:true},
cluster: {value:"mt1"},
eventname: {value:"", required:true}
},
credentials: {
pusherappkeysub: {type:"text"}
},
inputs:0,
outputs:1,
icon: "pusher.png",
label: function() {
return this.name||"pusher";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>
<script type="text/x-red" data-template-name="pusher out">
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="my_channel">
</div>
<div class="form-row">
<label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
<input type="text" id="node-input-eventname" placeholder="test_event_name">
</div>
<div class="form-row">
<label for="node-input-pusherappid"><i class="fa fa-tag"></i> App ID</label>
<input type="text" id="node-input-pusherappid" placeholder="app_id">
</div>
<div class="form-row">
<label for="node-input-pusherappkey"><i class="fa fa-lock"></i> App Key</label>
<input type="text" id="node-input-pusherappkey" placeholder="key">
</div>
<div class="form-row">
<label for="node-input-pusherappsecret"><i class="fa fa-asterisk"></i> App Secret</label>
<input type="password" id="node-input-pusherappsecret" placeholder="secret">
</div>
<div class="form-row">
<label for="node-input-cluster"><i class="fa fa-server"></i> Cluster</label>
<select type="text" id="node-input-cluster">
<option value="mt1">N. Virginia (US - default)</option>
<option value="us2">Ohio (US)</option>
<option value="us3">Oregon (US)</option>
<option value="eu">Ireland (Europe)</option>
<option value="ap1">Singapore (Asia)</option>
<option value="ap2">Mumbai (India)</option>
<option value="ap3">Tokyo (Asia)</option>
<option value="ap4">Sydney (Australia)</option>
<option value="sa1">São Paulo (Brazil)</option>
</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/x-red" data-help-name="pusher out">
<p>Pusher output node for sending messages to a specific channel/event.</p>
<p>You need an App key, secret and ID of a Pusher app.</p>
<p>The node will send the <code>msg.payload</code> of the incoming message.</p>
<p>If you leave the eventname blank you can set it using <code>msg.topic</code>.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('pusher out',{
category: 'mobile-output',
color:"#A9D0F5",
defaults: {
name: {value:""},
channel: {value:"", required:true},
cluster: {value:"mt1"},
eventname: {value:""}
},
credentials: {
pusherappid: {type:"text"},
pusherappkey: {type:"text"},
pusherappsecret: {type:"password"}
},
inputs:1,
outputs:0,
icon: "pusher.png",
align: "right",
label: function() {
return this.name||"pusher";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>