mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow config nodes to be disabled, tidy css and add actions
This commit is contained in:
@@ -132,29 +132,39 @@ class Flow {
|
||||
id = configNodes.shift();
|
||||
node = this.flow.configs[id];
|
||||
if (!this.activeNodes[id]) {
|
||||
var readyToCreate = true;
|
||||
// This node doesn't exist.
|
||||
// Check it doesn't reference another non-existent config node
|
||||
for (var prop in node) {
|
||||
if (node.hasOwnProperty(prop) && prop !== 'id' && prop !== 'wires' && prop !== '_users' && this.flow.configs[node[prop]]) {
|
||||
if (!this.activeNodes[node[prop]]) {
|
||||
// References a non-existent config node
|
||||
// Add it to the back of the list to try again later
|
||||
configNodes.push(id);
|
||||
configNodeAttempts[id] = (configNodeAttempts[id]||0)+1;
|
||||
if (configNodeAttempts[id] === 100) {
|
||||
throw new Error("Circular config node dependency detected: "+id);
|
||||
if (node.d !== true) {
|
||||
var readyToCreate = true;
|
||||
// This node doesn't exist.
|
||||
// Check it doesn't reference another non-existent config node
|
||||
for (var prop in node) {
|
||||
if (node.hasOwnProperty(prop) &&
|
||||
prop !== 'id' &&
|
||||
prop !== 'wires' &&
|
||||
prop !== '_users' &&
|
||||
this.flow.configs[node[prop]] &&
|
||||
this.flow.configs[node[prop]].d !== true
|
||||
) {
|
||||
if (!this.activeNodes[node[prop]]) {
|
||||
// References a non-existent config node
|
||||
// Add it to the back of the list to try again later
|
||||
configNodes.push(id);
|
||||
configNodeAttempts[id] = (configNodeAttempts[id]||0)+1;
|
||||
if (configNodeAttempts[id] === 100) {
|
||||
throw new Error("Circular config node dependency detected: "+id);
|
||||
}
|
||||
readyToCreate = false;
|
||||
break;
|
||||
}
|
||||
readyToCreate = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (readyToCreate) {
|
||||
newNode = flowUtil.createNode(this,node);
|
||||
if (newNode) {
|
||||
this.activeNodes[id] = newNode;
|
||||
if (readyToCreate) {
|
||||
newNode = flowUtil.createNode(this,node);
|
||||
if (newNode) {
|
||||
this.activeNodes[id] = newNode;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.debug("not starting disabled config node : "+id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,6 +216,8 @@ class Flow {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.debug("not starting disabled node : "+id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user