mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
status node extended
This commit is contained in:
parent
d7a10328c0
commit
08ce6cce97
@ -4,6 +4,7 @@
|
|||||||
<label style="width: auto" for="node-input-scope" data-i18n="status.label.source"></label>
|
<label style="width: auto" for="node-input-scope" data-i18n="status.label.source"></label>
|
||||||
<select id="node-input-scope-select">
|
<select id="node-input-scope-select">
|
||||||
<option value="all" data-i18n="status.scope.all"></option>
|
<option value="all" data-i18n="status.scope.all"></option>
|
||||||
|
<option value="group" data-i18n="status.scope.group"></option>
|
||||||
<option value="target" data-i18n="status.scope.selected"></options>
|
<option value="target" data-i18n="status.scope.selected"></options>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -157,6 +158,8 @@
|
|||||||
});
|
});
|
||||||
if (this.scope === null) {
|
if (this.scope === null) {
|
||||||
$("#node-input-scope-select").val("all");
|
$("#node-input-scope-select").val("all");
|
||||||
|
} else if(this.scope === "group"){
|
||||||
|
$("#node-input-scope-select").val("group");
|
||||||
} else {
|
} else {
|
||||||
$("#node-input-scope-select").val("target");
|
$("#node-input-scope-select").val("target");
|
||||||
}
|
}
|
||||||
@ -166,6 +169,8 @@
|
|||||||
var scope = $("#node-input-scope-select").val();
|
var scope = $("#node-input-scope-select").val();
|
||||||
if (scope === 'all') {
|
if (scope === 'all') {
|
||||||
this.scope = null;
|
this.scope = null;
|
||||||
|
} else if(scope === 'group') {
|
||||||
|
this.scope = "group";
|
||||||
} else {
|
} else {
|
||||||
this.scope = $("#node-input-status-target-container-div").treeList('selected').map(function(i) { return i.node.id})
|
this.scope = $("#node-input-status-target-container-div").treeList('selected').map(function(i) { return i.node.id})
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
},
|
},
|
||||||
"scope": {
|
"scope": {
|
||||||
"all": "allen Nodes",
|
"all": "allen Nodes",
|
||||||
|
"group": "in gleicher Gruppe",
|
||||||
"selected": "ausgewählten Nodes"
|
"selected": "ausgewählten Nodes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -115,6 +115,7 @@
|
|||||||
},
|
},
|
||||||
"scope": {
|
"scope": {
|
||||||
"all": "all nodes",
|
"all": "all nodes",
|
||||||
|
"group": "in same group",
|
||||||
"selected": "selected nodes"
|
"selected": "selected nodes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -665,10 +665,16 @@ class Flow {
|
|||||||
}
|
}
|
||||||
handled = true;
|
handled = true;
|
||||||
} else {
|
} else {
|
||||||
|
const flow = this;
|
||||||
this.statusNodes.forEach(function(targetStatusNode) {
|
this.statusNodes.forEach(function(targetStatusNode) {
|
||||||
if (targetStatusNode.scope && targetStatusNode.scope.indexOf(reportingNode.id) === -1) {
|
if (Array.isArray(targetStatusNode.scope) && targetStatusNode.scope.indexOf(reportingNode.id) === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetStatusNode.scope === "group" && flow.isNodeInSameGroup(targetStatusNode, reportingNode) === false){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var message = {
|
var message = {
|
||||||
status: clone(statusMessage)
|
status: clone(statusMessage)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user