node-red-contrib-prib-functions
Advanced tools
Comparing version 0.7.0 to 0.7.1
{ | ||
"name": "node-red-contrib-prib-functions", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Node-RED added node functions.", | ||
@@ -5,0 +5,0 @@ "dependencies": {}, |
@@ -1,2 +0,2 @@ | ||
# node-red-contrib-prib-functions | ||
# [node-red-contrib-prib-functions][2] | ||
@@ -8,3 +8,3 @@ [Node-Red][1] nodes for various functions: | ||
* Load Injector | ||
* Monitor Fow | ||
* Monitor Flow | ||
* append | ||
@@ -163,2 +163,7 @@ * Spawn Process | ||
0.7.1 | ||
* fix json to table html and minor code improvements. | ||
turn off debug mode on spawn process. | ||
clear down timer on close for host available | ||
0.7.0 | ||
@@ -165,0 +170,0 @@ * add Host Available |
@@ -16,3 +16,3 @@ const ts=(new Date().toString()).split(' '); | ||
} | ||
let debug=debugOn,debugCnt=100; | ||
let debug=debugOff,debugCnt=100; | ||
let spawn; | ||
@@ -19,0 +19,0 @@ let os=require("os"); |
@@ -76,3 +76,5 @@ const ts=(new Date().toString()).split(' '); | ||
} | ||
hostAvailableNode.prototype.close = function() { | ||
runtimeStop.apply(this); | ||
}; | ||
RED.nodes.registerType("Host Available",hostAvailableNode); | ||
@@ -79,0 +81,0 @@ |
@@ -56,11 +56,17 @@ const ts=(new Date().toString()).split(' '); | ||
}, | ||
JSONToHTML: (data)=>{ | ||
JSONToHTML: (data,level=0)=>{ | ||
if(Array.isArray(data)) { | ||
if(data.length) { | ||
return "<table><tr>"+data.map((r)=>functions.JSONToHTML(r,++level)).join("</tr><tr>")+"</tr><table>" | ||
} | ||
return ""; | ||
} | ||
if(data instanceof Object){ | ||
let a=[]; | ||
for(let p in data) { | ||
a.push("<td><![cdata["+p+"]]><td></td><![cdata["+functions.JSONToHTML(data[p])+"]]></td>"); | ||
a.push("<td style='vertical-align: top;'>"+escape(p)+":</td><td>"+functions.JSONToHTML(data[p],++level)+"</td>"); | ||
} | ||
return "<table><tr>"+a.join("</tr><tr>")+"</tr><table>"; | ||
} | ||
return data; | ||
return escape(data); | ||
}, | ||
@@ -67,0 +73,0 @@ ArrayToCSV: (data)=>data.map(x=>JSON.stringify(x)).join("\n"), |
893005
3033
192