1
0
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:
Hiroyasu Nishiyama 2022-01-26 09:25:30 +09:00
parent 983dad5b53
commit ba304c9651
3 changed files with 8 additions and 8 deletions

View File

@ -424,12 +424,12 @@ class Flow {
*/ */
getGroupEnvSetting(node, group, name) { getGroupEnvSetting(node, group, name) {
if (group) { if (group) {
if (name === "GROUP_NAME") { if (name === "NR_GROUP_NAME") {
return [{ return [{
val: group.name val: group.name
}, null]; }, null];
} }
if (name === "GROUP_ID") { if (name === "NR_GROUP_ID") {
return [{ return [{
val: group.id val: group.id
}, null]; }, null];
@ -510,10 +510,10 @@ class Flow {
*/ */
getSetting(key) { getSetting(key) {
const flow = this.flow; const flow = this.flow;
if (key === "FLOW_NAME") { if (key === "NR_FLOW_NAME") {
return flow.label; return flow.label;
} }
if (key === "FLOW_ID") { if (key === "NR_FLOW_ID") {
return flow.id; return flow.id;
} }
if (flow.credentials === undefined) { if (flow.credentials === undefined) {

View File

@ -372,10 +372,10 @@ class Subflow extends Flow {
} }
const node = this.subflowInstance; const node = this.subflowInstance;
if (node) { if (node) {
if (name === "NODE_NAME") { if (name === "NR_NODE_NAME") {
return node.name; return node.name;
} }
if (name === "NODE_ID") { if (name === "NR_NODE_ID") {
return node.id; return node.id;
} }
} }

View File

@ -523,10 +523,10 @@ function setObjectProperty(msg,prop,value,createMissing) {
*/ */
function getSetting(node, name, flow_) { function getSetting(node, name, flow_) {
if (node) { if (node) {
if (name === "NODE_NAME") { if (name === "NR_NODE_NAME") {
return node.name; return node.name;
} }
if (name === "NODE_ID") { if (name === "NR_NODE_ID") {
return node.id; return node.id;
} }
} }