mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Enable individual flow nodes to be disabled
This commit is contained in:
@@ -171,37 +171,39 @@ class Flow {
|
||||
for (id in this.flow.nodes) {
|
||||
if (this.flow.nodes.hasOwnProperty(id)) {
|
||||
node = this.flow.nodes[id];
|
||||
if (!node.subflow) {
|
||||
if (!this.activeNodes[id]) {
|
||||
newNode = flowUtil.createNode(this,node);
|
||||
if (newNode) {
|
||||
this.activeNodes[id] = newNode;
|
||||
if (node.d !== true) {
|
||||
if (!node.subflow) {
|
||||
if (!this.activeNodes[id]) {
|
||||
newNode = flowUtil.createNode(this,node);
|
||||
if (newNode) {
|
||||
this.activeNodes[id] = newNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.subflowInstanceNodes[id]) {
|
||||
try {
|
||||
var subflowDefinition = this.flow.subflows[node.subflow]||this.global.subflows[node.subflow]
|
||||
// console.log("NEED TO CREATE A SUBFLOW",id,node.subflow);
|
||||
this.subflowInstanceNodes[id] = true;
|
||||
var subflow = Subflow.create(
|
||||
this,
|
||||
this.global,
|
||||
subflowDefinition,
|
||||
node
|
||||
);
|
||||
this.subflowInstanceNodes[id] = subflow;
|
||||
subflow.start();
|
||||
this.activeNodes[id] = subflow.node;
|
||||
} else {
|
||||
if (!this.subflowInstanceNodes[id]) {
|
||||
try {
|
||||
var subflowDefinition = this.flow.subflows[node.subflow]||this.global.subflows[node.subflow]
|
||||
// console.log("NEED TO CREATE A SUBFLOW",id,node.subflow);
|
||||
this.subflowInstanceNodes[id] = true;
|
||||
var subflow = Subflow.create(
|
||||
this,
|
||||
this.global,
|
||||
subflowDefinition,
|
||||
node
|
||||
);
|
||||
this.subflowInstanceNodes[id] = subflow;
|
||||
subflow.start();
|
||||
this.activeNodes[id] = subflow.node;
|
||||
|
||||
// this.subflowInstanceNodes[id] = nodes.map(function(n) { return n.id});
|
||||
// for (var i=0;i<nodes.length;i++) {
|
||||
// if (nodes[i]) {
|
||||
// this.activeNodes[nodes[i].id] = nodes[i];
|
||||
// }
|
||||
// }
|
||||
} catch(err) {
|
||||
console.log(err.stack)
|
||||
// this.subflowInstanceNodes[id] = nodes.map(function(n) { return n.id});
|
||||
// for (var i=0;i<nodes.length;i++) {
|
||||
// if (nodes[i]) {
|
||||
// this.activeNodes[nodes[i].id] = nodes[i];
|
||||
// }
|
||||
// }
|
||||
} catch(err) {
|
||||
console.log(err.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user