mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow tcp request node to accept msg.host and msg.port as inputs
Overrides only allowed if edit setting left blank.
This commit is contained in:
@@ -213,7 +213,6 @@
|
||||
else {
|
||||
$("#fin-tip2").hide();
|
||||
}
|
||||
|
||||
};
|
||||
updateOptions();
|
||||
$("#node-input-beserver").change(updateOptions);
|
||||
@@ -226,7 +225,7 @@
|
||||
<div class="form-row">
|
||||
<label for="node-input-server"><i class="fa fa-globe"></i> Server</label>
|
||||
<input type="text" id="node-input-server" placeholder="ip.address" style="width:50%">
|
||||
port <input type="text" id="node-input-port" style="width:50px">
|
||||
port <input type="text" id="node-input-port" placeholder="port" style="width:50px">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-out"><i class="fa fa-sign-out"></i> Return</label>
|
||||
@@ -243,7 +242,8 @@
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<div class="form-tips"><b>Tip:</b> outputs a binary <b>Buffer</b>, so you may want to .toString() it.</div>
|
||||
<div class="form-tips"><b>Tip:</b> Outputs a binary <b>Buffer</b>, so you may want to .toString() it.</br/>
|
||||
<b>Tip:</b> Leave host and port blank if you want to overide with msg.host and msg.port properties.</div>
|
||||
<script>
|
||||
var previous = null;
|
||||
$("#node-input-out").on('focus', function () { previous = this.value; }).change(function() {
|
||||
@@ -273,6 +273,7 @@
|
||||
returned characters into a fixed buffer, match a specified character before returning,
|
||||
wait a fixed timeout from first reply and then return, or just sit and wait for data.</p>
|
||||
<p>The response will be output in <b>msg.payload</b> as a buffer, so you may want to .toString() it.</p>
|
||||
<p>If you leave tcp host and port blank you must set them by using the <b>msg.host</b> and <b>msg.port</b> properties.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -280,8 +281,8 @@
|
||||
category: 'function',
|
||||
color:"Silver",
|
||||
defaults: {
|
||||
server: {value:"",required:true},
|
||||
port: {value:"",required:true,validate:RED.validators.number()},
|
||||
server: {value:""},
|
||||
port: {value:"",validate:RED.validators.regex(/^(\d*|)$/)},
|
||||
out: {value:"time",required:true},
|
||||
splitc: {value:"0",required:true},
|
||||
name: {value:""}
|
||||
|
Reference in New Issue
Block a user