1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

and add fa icons to websocket

This commit is contained in:
Dave C-J 2014-07-11 21:32:51 +01:00
parent 1a1c6a73b6
commit bc53d302ff
2 changed files with 9 additions and 9 deletions

View File

@ -17,11 +17,11 @@
<!-- WebSocket Input Node --> <!-- WebSocket Input Node -->
<script type="text/x-red" data-template-name="websocket in"> <script type="text/x-red" data-template-name="websocket in">
<div class="form-row"> <div class="form-row">
<label for="node-input-server"><i class="icon-bookmark"></i> Path</label> <label for="node-input-server"><i class="fa fa-bookmark"></i> Path</label>
<input type="text" id="node-input-server"> <input type="text" id="node-input-server">
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name"> <input type="text" id="node-input-name" placeholder="Name">
</div> </div>
</script> </script>
@ -57,11 +57,11 @@
<!-- WebSocket out Node --> <!-- WebSocket out Node -->
<script type="text/x-red" data-template-name="websocket out"> <script type="text/x-red" data-template-name="websocket out">
<div class="form-row"> <div class="form-row">
<label for="node-input-server"><i class="icon-bookmark"></i> Path</label> <label for="node-input-server"><i class="fa fa-bookmark"></i> Path</label>
<input type="text" id="node-input-server"> <input type="text" id="node-input-server">
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name"> <input type="text" id="node-input-name" placeholder="Name">
</div> </div>
</script> </script>
@ -71,11 +71,11 @@
<p>By default, <b>msg.payload</b> will be sent over the WebSocket. The listener <p>By default, <b>msg.payload</b> will be sent over the WebSocket. The listener
can be configured to encode the entire message object as a JSON string and send that can be configured to encode the entire message object as a JSON string and send that
over the WebSocket.</p> over the WebSocket.</p>
<p>If the message arriving at this node started at a WebSocket In node, the message <p>If the message arriving at this node started at a WebSocket In node, the message
will be sent back to the client that triggered the flow. Otherwise, the message will be sent back to the client that triggered the flow. Otherwise, the message
will be broadcast to all connected clients.</p> will be broadcast to all connected clients.</p>
<p>If you want to broadcast a message that started at a WebSocket In node, you <p>If you want to broadcast a message that started at a WebSocket In node, you
should delete the <b>msg._session</b> property within the flow</p>. should delete the <b>msg._session</b> property within the flow</p>.
</script> </script>
@ -104,7 +104,7 @@
<!-- WebSocket Server configuration node --> <!-- WebSocket Server configuration node -->
<script type="text/x-red" data-template-name="websocket-listener"> <script type="text/x-red" data-template-name="websocket-listener">
<div class="form-row"> <div class="form-row">
<label for="node-config-input-path"><i class="icon-bookmark"></i> Path</label> <label for="node-config-input-path"><i class="fa fa-bookmark"></i> Path</label>
<input type="text" id="node-config-input-path" placeholder="/ws/example"> <input type="text" id="node-config-input-path" placeholder="/ws/example">
</div> </div>
<div class="form-row"> <div class="form-row">

View File

@ -106,13 +106,13 @@ module.exports = function(RED) {
for (var i = 0; i < this._inputNodes.length; i++) { for (var i = 0; i < this._inputNodes.length; i++) {
this._inputNodes[i].send(msg); this._inputNodes[i].send(msg);
}; }
} }
WebSocketListenerNode.prototype.broadcast = function(data){ WebSocketListenerNode.prototype.broadcast = function(data){
for(var i in this.server.clients){ for(var i in this.server.clients){
this.server.clients[i].send(data); this.server.clients[i].send(data);
}; }
} }
WebSocketListenerNode.prototype.send = function(id,data){ WebSocketListenerNode.prototype.send = function(id,data){