Skip to content

Commit

Permalink
Merge pull request #3 from jmikerq/https
Browse files Browse the repository at this point in the history
Added in documentation of msg.measurement, added in protocol drop dow…
  • Loading branch information
mblackstock authored Nov 8, 2016
2 parents 1757e93 + 7ebb13a commit b453561
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions influxdb.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> <span data-i18n="influxdb.label.port"></span></label>
<input type="text" id="node-config-input-port" style="width:45px">
</div>
<div class="form-row">
<label for="node-config-input-protocol" > <i class="fa fa-bookmark"></i><span data-i18n="influxdb.label.protocol">Protocol</span></label>
<select type="text" id="node-config-input-protocol" style="width: 70%;">
<option value="http">http</option>
<option value="https">https</option>
</select>
</div>
<div class="form-row">
<label for="node-config-input-database"><i class="fa fa-database"></i> <span data-i18n="influxdb.label.database"></span></label>
<input type="text" id="node-config-input-database">
Expand All @@ -30,6 +37,7 @@
defaults: {
hostname: {value: "127.0.0.1", required: true},
port: {value: 8086, required: true},
protocol: {value: "http", required: true},
database: {value: "", required: true},
name: {value: ""}
},
Expand Down Expand Up @@ -66,6 +74,7 @@
<p>If <b>msg.payload</b> is an object containing multiple properties, the fields will be written to the measurement.</p>
<p>If <b>msg.payload</b> is an array containing two objects, the first object will be written as the set of named fields, the second is the set of named tags.</p>
<p>Finally, if <b>msg.payload</b> is an array of arrays, it will be written as a series of points containing fields and tags.</p>
<p>If the <i>measurement</i> field is not set in the node configuration, the user can send in data with a specified measurement name in <b>msg.measurement</b> to overwrite the <i>measurement</i> field in the configuration of the node.</p>
</script>

<script type="text/javascript">
Expand Down
5 changes: 4 additions & 1 deletion influxdb.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function(RED) {
function InfluxConfigNode(n) {
RED.nodes.createNode(this,n);
this.hostname = n.hostname;
this.protocol = n.protocol; //"https";
this.port = n.port;
this.database= n.database;
this.name = n.name;
Expand All @@ -36,6 +37,7 @@ module.exports = function(RED) {
var client = influx({
host: this.influxdbConfig.hostname,
port: this.influxdbConfig.port,
protocol: this.influxdbConfig.protocol,
database: this.influxdbConfig.database,
username: this.influxdbConfig.credentials.username,
password: this.influxdbConfig.credentials.password
Expand Down Expand Up @@ -102,6 +104,7 @@ module.exports = function(RED) {
var client = influx({
host: this.influxdbConfig.hostname,
port: this.influxdbConfig.port,
protocol: this.influxdbConfig.protocol,
database: this.influxdbConfig.database,
username: this.influxdbConfig.credentials.username,
password: this.influxdbConfig.credentials.password
Expand Down Expand Up @@ -133,4 +136,4 @@ module.exports = function(RED) {
}
}
RED.nodes.registerType("influxdb in",InfluxInNode);
}
}

0 comments on commit b453561

Please sign in to comment.