mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
add NR_ prefix to special environment variables
This commit is contained in:
parent
983dad5b53
commit
ba304c9651
@ -424,12 +424,12 @@ class Flow {
|
||||
*/
|
||||
getGroupEnvSetting(node, group, name) {
|
||||
if (group) {
|
||||
if (name === "GROUP_NAME") {
|
||||
if (name === "NR_GROUP_NAME") {
|
||||
return [{
|
||||
val: group.name
|
||||
}, null];
|
||||
}
|
||||
if (name === "GROUP_ID") {
|
||||
if (name === "NR_GROUP_ID") {
|
||||
return [{
|
||||
val: group.id
|
||||
}, null];
|
||||
@ -510,10 +510,10 @@ class Flow {
|
||||
*/
|
||||
getSetting(key) {
|
||||
const flow = this.flow;
|
||||
if (key === "FLOW_NAME") {
|
||||
if (key === "NR_FLOW_NAME") {
|
||||
return flow.label;
|
||||
}
|
||||
if (key === "FLOW_ID") {
|
||||
if (key === "NR_FLOW_ID") {
|
||||
return flow.id;
|
||||
}
|
||||
if (flow.credentials === undefined) {
|
||||
|
@ -372,10 +372,10 @@ class Subflow extends Flow {
|
||||
}
|
||||
const node = this.subflowInstance;
|
||||
if (node) {
|
||||
if (name === "NODE_NAME") {
|
||||
if (name === "NR_NODE_NAME") {
|
||||
return node.name;
|
||||
}
|
||||
if (name === "NODE_ID") {
|
||||
if (name === "NR_NODE_ID") {
|
||||
return node.id;
|
||||
}
|
||||
}
|
||||
|
@ -523,10 +523,10 @@ function setObjectProperty(msg,prop,value,createMissing) {
|
||||
*/
|
||||
function getSetting(node, name, flow_) {
|
||||
if (node) {
|
||||
if (name === "NODE_NAME") {
|
||||
if (name === "NR_NODE_NAME") {
|
||||
return node.name;
|
||||
}
|
||||
if (name === "NODE_ID") {
|
||||
if (name === "NR_NODE_ID") {
|
||||
return node.id;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user