1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

catch internal subflow info error in tab-info...

This commit is contained in:
dceejay 2015-02-10 20:15:00 +00:00
parent 00b7afe3ae
commit 0accfade02

View File

@ -61,20 +61,25 @@ RED.sidebar.info = (function() {
//table += '<tr class="blank"><td colspan="2">Node</td></tr>';
if (node.type.indexOf("subflow") === 0) {
table += "<tr><td>Type</td><td>&nbsp;"+(RED.nodes.subflow(node.type.split(":")[1]).name||node.type)+"</td></tr>";
table += "<tr><td>ID</td><td>&nbsp;"+node.id+"</td></tr>";
var userCount = 0;
RED.nodes.eachNode(function(n) {
console.log(n);
if (n.type === node.type) {
userCount++;
}
});
node.name = node.name || "";
if (node.type !== "subflow") {
table += "<tr><td>Type</td><td>&nbsp;"+(RED.nodes.subflow(node.type.split(":")[1]).name||node.type)+"</td></tr>";
table += "<tr><td>ID</td><td>&nbsp;"+node.id+"</td></tr>";
table += "<tr><td>name</td><td>"+node.name+"</td></tr>";
table += "<tr><td>inputs</td><td>"+node.inputs+"</td></tr>";
table += "<tr><td>outputs</td><td>"+node.outputs+"</td></tr>";
table += "<tr><td>instances</td><td>"+userCount+"</td></tr>";
} else {
table += "<tr><td>Type</td><td>&nbsp;"+node.type+"</td></tr>";
table += "<tr><td>ID</td><td>&nbsp;"+node.id+"</td></tr>";
table += "<tr><td>name</td><td>"+node.name+"</td></tr>";
}
}
else if (node._def) {
if (node.type !== "comment") {