Automatic detection of csv and json call and simplified help text

This commit is contained in:
henols
2014-04-03 09:42:49 +02:00
parent e6f90f9b8d
commit 9808e8a3a6
2 changed files with 6 additions and 23 deletions

View File

@@ -19,10 +19,6 @@
<label for="node-input-emonServer"><i class="icon-globe"></i> Emoncms server</label>
<input type="text" id="node-input-emonServer">
</div>
<div class="form-row">
<label for="node-input-topic"><i class="icon-tasks"></i> Key</label>
<input type="text" id="node-input-topic" placeholder="">
</div>
<div class="form-row">
<label for="node-input-nodegroup"><i class="icon-tag"></i> Node</label>
<input type="text" id="node-input-nodegroup" placeholder="">
@@ -31,22 +27,13 @@
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Emoncms">
</div>
<div class="form-tips">If <b>msg.payload</b> holds comma separated values (csv), Key and <b>msg.topic</b> is ignored and the key will
be automatically generated by Emoncms. If <b>msg.payload</b> holds a single value and Key and <b>msg.topic</b> is not specified, <b>msg.payload</b>
will be treated as a csv otherwise it will be treated as a json payload and the key value can be manually or programmatically set.</br></br>
Key is not mandatory, if Key is left blank <b>msg.topic</b> will used. Key overrides <b>msg.topic</b>, it will be ignored if <b>msg.payload</b> is holding csv</br></br>
Node (numeric) is not mandatory, if Node is left blank <b>msg.nodegrpup</b> will used. Node over rides <b>msg.nodegroup</b>.
</div>
</script>
<script type="text/x-red" data-help-name="emoncms">
<p>Performs post to Emoncms.</p>
<p>If <b>msg.payload</b> holds comma separated values (csv), Key and <b>msg.topic</b> is ignored.
If <b>msg.payload</b> holds a single value and Key and <b>msg.topic</b> is not specified, <b>msg.payload</b>
will be treated as a csv otherwise it will be treated as a json payload</p>
<p>If Key is left blank <b>msg.topic</b> will used, ignored if <b>msg.payload</b> holds csv.</p>
<p>Emoncms post.</p>
<p>The <b>msg.payload</b> can contain either a comma separated list of name value pairs ex. name:value,... or a comma separated list of values ex. 1,2,.. .
<p>If Node is left blank <b>msg.nodegrpup</b> will used.</p>
<p>Insertion time can be manipulated by setting <b>msg.time</b>.</p>
<p>Insertion time can be manipulated by setting <b>msg.time</b>.</p>
</script>
<script type="text/javascript">
@@ -56,8 +43,6 @@
defaults: {
name: {value:"Emoncms"},
emonServer: {type:"emoncms-server", required:true},
payloadType: {value:"json"},
topic: {value:""},
nodegroup: {value:""}
},
inputs:1,