mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
117 lines
3.8 KiB
HTML
117 lines
3.8 KiB
HTML
|
|
<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="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-appkey_sub"><i class="fa fa-lock"></i> App Key</label>
|
|
<input type="text" id="node-input-pusherappkey_sub" placeholder="key">
|
|
</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},
|
|
eventname: {value:"", required:true}
|
|
},
|
|
credentials: {
|
|
pusherappkey_sub: "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-appid"><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-appkey"><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-topic"><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-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},
|
|
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>
|