Skip to content

Commit 3a6ffdf

Browse files
committed
Tweak emoncms logo to closer match other styles
1 parent 4a53c20 commit 3a6ffdf

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

Diff for: io/emoncms/88-emoncms.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@
3232
<input type="text" id="node-input-name" placeholder="Emoncms">
3333
</div>
3434
<div class="form-tips">Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used. Topic overrides <b>msg.topic</b></br>
35-
Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node Group overrides <b>msg.nodegroup</b></div>
35+
Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node Group overrides <b>msg.nodegroup</b></div>
3636
</script>
3737

3838
<script type="text/x-red" data-help-name="emoncms">
39-
<p>Performs post to Emoncms.</p>
40-
<p>Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used. Topic overrides <b>msg.topic</b></p>
41-
<p>Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node overrides <b>msg.nodegrpup</b></p>
39+
<p>Performs post to Emoncms.</p>
40+
<p>Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used. Topic overrides <b>msg.topic</b></p>
41+
<p>Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node overrides <b>msg.nodegrpup</b></p>
4242
</script>
4343

4444
<script type="text/javascript">
4545
RED.nodes.registerType('emoncms',{
4646
category: 'output',
4747
color:"rgb(91, 192, 222)",
48-
defaults: {
48+
defaults: {
4949
name: {value:"Emoncms"},
5050
emonServer: {type:"emoncms-server", required:true},
5151
topic: {value:""},
5252
nodegroup: {value:""}
5353
},
5454
inputs:1,
5555
outputs:0,
56-
icon: "emoncms-logo.png",
56+
icon: "emoncms.png",
5757
align: "right",
5858
label: function() {
5959
return this.name||this.baseurl;
@@ -98,7 +98,7 @@
9898
}
9999
});
100100
},
101-
oneditsave: function() {
101+
oneditsave: function() {
102102
var newApikey = $('#node-config-input-apikey').val();
103103
var credentials = {};
104104
credentials.apikey = newApikey;

Diff for: io/emoncms/88-emoncms.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright 2013 Henrik Olsson [email protected]
3-
*
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
66
* the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
1212
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -22,8 +22,8 @@ function EmoncmsServerNode(n) {
2222
this.name = n.name;
2323
var credentials = RED.nodes.getCredentials(n.id);
2424
if (credentials) {
25-
this.apikey = credentials.apikey;
26-
}
25+
this.apikey = credentials.apikey;
26+
}
2727

2828
}
2929
RED.nodes.registerType("emoncms-server",EmoncmsServerNode);
@@ -64,48 +64,48 @@ RED.app.post('/emoncms-server/:id',function(req,res) {
6464
});
6565

6666
function Emoncms(n) {
67-
RED.nodes.createNode(this,n);
67+
RED.nodes.createNode(this,n);
6868
this.emonServer = n.emonServer;
6969
var sc = RED.nodes.getNode(this.emonServer);
7070

71-
this.baseurl = sc.server;
72-
this.apikey = sc.apikey;
71+
this.baseurl = sc.server;
72+
this.apikey = sc.apikey;
73+
74+
this.topic = n.topic ||"";
75+
this.nodegroup = n.nodegroup || "";
76+
var node = this;
77+
if (this.baseurl.substring(0,5) === "https") { var http = require("https"); }
78+
else { var http = require("http"); }
79+
this.on("input", function(msg) {
7380

74-
this.topic = n.topic ||"";
75-
this.nodegroup = n.nodegroup || "";
76-
var node = this;
77-
if (this.baseurl.substring(0,5) === "https") { var http = require("https"); }
78-
else { var http = require("http"); }
79-
this.on("input", function(msg) {
80-
81-
var topic = this.topic || msg.topic;
82-
var nodegroup = this.nodegroup || msg.nodegroup;
83-
this.url = this.baseurl + '/input/post.json?json={' + topic + ':' + msg.payload+'}&apikey='+this.apikey;
84-
if(nodegroup != ""){
85-
this.url += '&node='+nodegroup;
86-
}
87-
node.log("[emoncms] "+this.url);
88-
http.get(this.url, function(res) {
89-
node.log("Http response: " + res.statusCode);
90-
msg.rc = res.statusCode;
91-
msg.payload = "";
92-
if ((msg.rc != 200) && (msg.rc != 404)) {
93-
node.send(msg);
94-
}
95-
res.setEncoding('utf8');
96-
res.on('data', function(chunk) {
97-
msg.payload += chunk;
98-
});
99-
res.on('end', function() {
100-
node.send(msg);
101-
});
102-
}).on('error', function(e) {
103-
// node.error(e);
104-
msg.rc = 503;
105-
msg.payload = e;
106-
node.send(msg);
107-
});
108-
});
81+
var topic = this.topic || msg.topic;
82+
var nodegroup = this.nodegroup || msg.nodegroup;
83+
this.url = this.baseurl + '/input/post.json?json={' + topic + ':' + msg.payload+'}&apikey='+this.apikey;
84+
if(nodegroup != ""){
85+
this.url += '&node='+nodegroup;
86+
}
87+
node.log("[emoncms] "+this.url);
88+
http.get(this.url, function(res) {
89+
node.log("Http response: " + res.statusCode);
90+
msg.rc = res.statusCode;
91+
msg.payload = "";
92+
if ((msg.rc != 200) && (msg.rc != 404)) {
93+
node.send(msg);
94+
}
95+
res.setEncoding('utf8');
96+
res.on('data', function(chunk) {
97+
msg.payload += chunk;
98+
});
99+
res.on('end', function() {
100+
node.send(msg);
101+
});
102+
}).on('error', function(e) {
103+
// node.error(e);
104+
msg.rc = 503;
105+
msg.payload = e;
106+
node.send(msg);
107+
});
108+
});
109109
}
110110

111111
RED.nodes.registerType("emoncms",Emoncms);

Diff for: io/emoncms/icons/emoncms.png

933 Bytes
Loading

0 commit comments

Comments
 (0)