mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Change the name of getID
by generateId
This commit is contained in:
parent
2f01fe5832
commit
476e8345c5
@ -564,7 +564,7 @@ RED.nodes = (function() {
|
||||
return api;
|
||||
})()
|
||||
|
||||
function getID() {
|
||||
function generateId() {
|
||||
var bytes = [];
|
||||
for (var i=0;i<8;i++) {
|
||||
bytes.push(Math.round(0xff*Math.random()).toString(16).padStart(2,'0'));
|
||||
@ -2124,7 +2124,7 @@ RED.nodes = (function() {
|
||||
activeWorkspace = defaultWorkspace.id;
|
||||
}
|
||||
if (createNewIds || options.importMap[node.id] === "copy") {
|
||||
node.id = getID();
|
||||
node.id = generateId();
|
||||
}
|
||||
addWorkspace(node);
|
||||
workspaceMap[oldId] = node.id;
|
||||
@ -2136,23 +2136,23 @@ RED.nodes = (function() {
|
||||
input.direction = "in";
|
||||
input.z = node.id;
|
||||
input.i = i;
|
||||
input.id = getID();
|
||||
input.id = generateId();
|
||||
});
|
||||
node.out.forEach(function(output, i) {
|
||||
output.type = "subflow";
|
||||
output.direction = "out";
|
||||
output.z = node.id;
|
||||
output.i = i;
|
||||
output.id = getID();
|
||||
output.id = generateId();
|
||||
});
|
||||
if (node.status) {
|
||||
node.status.type = "subflow";
|
||||
node.status.direction = "status";
|
||||
node.status.z = node.id;
|
||||
node.status.id = getID();
|
||||
node.status.id = generateId();
|
||||
}
|
||||
if (createNewIds || options.importMap[node.id] === "copy") {
|
||||
node.id = getID();
|
||||
node.id = generateId();
|
||||
}
|
||||
subflowMap[oldId] = node;
|
||||
newSubflows.push(node);
|
||||
@ -2162,7 +2162,7 @@ RED.nodes = (function() {
|
||||
|
||||
// Add a tab if there isn't one there already - Like first install
|
||||
if (!defaultWorkspace) {
|
||||
defaultWorkspace = { type: "tab", id: getID(), disabled: false, info: "", label: RED._("workspace.defaultName", { number: 1 }), env: [] };
|
||||
defaultWorkspace = { type: "tab", id: generateId(), disabled: false, info: "", label: RED._("workspace.defaultName", { number: 1 }), env: [] };
|
||||
addWorkspace(defaultWorkspace);
|
||||
RED.workspaces.add(defaultWorkspace);
|
||||
newWorkspaces.push(defaultWorkspace);
|
||||
@ -2181,7 +2181,7 @@ RED.nodes = (function() {
|
||||
// Repair the flow - but we really need to track that down.
|
||||
if (!recoveryWorkspace) {
|
||||
recoveryWorkspace = {
|
||||
id: getID(),
|
||||
id: generateId(),
|
||||
type: "tab",
|
||||
disabled: false,
|
||||
label: RED._("clipboard.recoveredNodes"),
|
||||
@ -2333,7 +2333,7 @@ RED.nodes = (function() {
|
||||
|
||||
// Now the node has been copied, change the `id` if it's a copy
|
||||
if (createNewIds || options.importMap[oldId] === "copy") {
|
||||
nodeMap[oldId].id = getID();
|
||||
nodeMap[oldId].id = generateId();
|
||||
}
|
||||
|
||||
if (node.type === "junction") {
|
||||
@ -3145,7 +3145,7 @@ RED.nodes = (function() {
|
||||
createExportableNodeSet: createExportableNodeSet,
|
||||
createCompleteNodeSet: createCompleteNodeSet,
|
||||
updateConfigNodeUsers: updateConfigNodeUsers,
|
||||
id: getID,
|
||||
id: generateId,
|
||||
dirty: function(d) {
|
||||
if (d == null) {
|
||||
return dirty;
|
||||
|
Loading…
x
Reference in New Issue
Block a user