mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
38 Commits
fix-many-t
...
fix-drag-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a16032a8ed | ||
|
|
deb9c4ecc0 | ||
|
|
62cd3b2061 | ||
|
|
7924907384 | ||
|
|
51d429f9ae | ||
|
|
267aebb9cb | ||
|
|
3f9ebb588e | ||
|
|
6f0de7c80e | ||
|
|
3ace7eeafd | ||
|
|
eb9f15e4e4 | ||
|
|
a147458120 | ||
|
|
afdb15dc58 | ||
|
|
98b4b0dce0 | ||
|
|
70f26e0bea | ||
|
|
b6ad396a6c | ||
|
|
e44bb57b0e | ||
|
|
5c10b16b65 | ||
|
|
7ec1d42808 | ||
|
|
03e9e89558 | ||
|
|
3057035dec | ||
|
|
4af72cc7ba | ||
|
|
f6aee81651 | ||
|
|
a22f569ca0 | ||
|
|
8043f5d865 | ||
|
|
2ef50ab71f | ||
|
|
192a4f5e7f | ||
|
|
1af56a7f00 | ||
|
|
d2fab7fddd | ||
|
|
09973ba8cf | ||
|
|
dd3174c40f | ||
|
|
f0293b8f52 | ||
|
|
5561e89201 | ||
|
|
0f2420576a | ||
|
|
d1b74675d9 | ||
|
|
e04f5cb277 | ||
|
|
a4603a4396 | ||
|
|
1141f9de86 | ||
|
|
bbc32c4cd0 |
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,3 +1,38 @@
|
|||||||
|
#### 3.0.0-beta.2: Beta Release
|
||||||
|
|
||||||
|
**Migration from 2.x**
|
||||||
|
|
||||||
|
- The 'slice wires' action has changed from Ctrl-RightMouseButton to Alt-LeftMouseButton
|
||||||
|
|
||||||
|
Editor
|
||||||
|
|
||||||
|
- Rework Junctions to be more node like in their event handling (#3607) @knolleary
|
||||||
|
- Change slicing / slice-junction operations over to mouse button 0 (Left Mouse Button) (#3609) @Steve-Mcl
|
||||||
|
- Do not slice-junction link node wires (#3608) @knolleary
|
||||||
|
- Handle many-to-one slicing of wires (#3604) @knolleary
|
||||||
|
- Ensure ACE worker options are set (#3611) @Steve-Mcl
|
||||||
|
- Remove duplicate history add of ungroup event (#3605) @knolleary
|
||||||
|
- use text width instead of number of characters for deciding select fi… (#3603) @HiroyasuNishiyama
|
||||||
|
- Update Japanese info of link call node reflecting update of English info (#3600) @HiroyasuNishiyama
|
||||||
|
- Fix typedInput label not visible on themes (#3580) @bonanitech
|
||||||
|
- Fix project switching when junctions are present (#3595) @Steve-Mcl
|
||||||
|
- Fix junction: when wiring from a regular nodes INPUT, backwards to a junction (#3591) @Steve-Mcl
|
||||||
|
- Fix error initialising flow tab editor (#3585) @Steve-Mcl
|
||||||
|
- Add Japanese translations for v3.0-beta.1 (#3576) @kazuhitoyokoi
|
||||||
|
- Fix image paths where `red/image/typedInput/XXXX.png` should be `red/image/typedInput/XXXX.svg` (#3592) @kazuhitoyokoi
|
||||||
|
- Fix browser console error Uncaught TypeError when searching certain terms (#3584) @Steve-Mcl
|
||||||
|
|
||||||
|
Runtime
|
||||||
|
|
||||||
|
- fix error on system-info action (#3589) @HiroyasuNishiyama
|
||||||
|
|
||||||
|
Nodes
|
||||||
|
|
||||||
|
- I18n switch rule selector (#3602) @HiroyasuNishiyama
|
||||||
|
- Handle removal of event handlers to allow mqtt client.end() to work (#3594) @PhilDay-CT
|
||||||
|
- update link-call node info according to current behavior (#3597) @HiroyasuNishiyama
|
||||||
|
|
||||||
|
|
||||||
#### 3.0.0-beta.1: Beta Release
|
#### 3.0.0-beta.1: Beta Release
|
||||||
|
|
||||||
**Migration from 2.x**
|
**Migration from 2.x**
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"description": "Low-code programming for event-driven applications",
|
"description": "Low-code programming for event-driven applications",
|
||||||
"homepage": "http://nodered.org",
|
"homepage": "http://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -42,14 +42,14 @@
|
|||||||
"cronosjs": "1.7.1",
|
"cronosjs": "1.7.1",
|
||||||
"denque": "2.0.1",
|
"denque": "2.0.1",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
"express-session": "1.17.2",
|
"express-session": "1.17.3",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"fs-extra": "10.1.0",
|
"fs-extra": "10.1.0",
|
||||||
"got": "11.8.3",
|
"got": "11.8.3",
|
||||||
"hash-sum": "2.0.0",
|
"hash-sum": "2.0.0",
|
||||||
"hpagent": "1.0.0",
|
"hpagent": "1.0.0",
|
||||||
"https-proxy-agent": "5.0.1",
|
"https-proxy-agent": "5.0.1",
|
||||||
"i18next": "21.6.16",
|
"i18next": "21.8.2",
|
||||||
"iconv-lite": "0.6.3",
|
"iconv-lite": "0.6.3",
|
||||||
"is-utf8": "0.2.1",
|
"is-utf8": "0.2.1",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
"semver": "7.3.7",
|
"semver": "7.3.7",
|
||||||
"tar": "6.1.11",
|
"tar": "6.1.11",
|
||||||
"tough-cookie": "4.0.0",
|
"tough-cookie": "4.0.0",
|
||||||
"uglify-js": "3.15.4",
|
"uglify-js": "3.15.5",
|
||||||
"uuid": "8.3.2",
|
"uuid": "8.3.2",
|
||||||
"ws": "7.5.6",
|
"ws": "7.5.6",
|
||||||
"xml2js": "0.4.23"
|
"xml2js": "0.4.23"
|
||||||
@@ -85,8 +85,8 @@
|
|||||||
"bcrypt": "5.0.1"
|
"bcrypt": "5.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dompurify": "2.3.6",
|
"dompurify": "2.3.8",
|
||||||
"grunt": "1.5.2",
|
"grunt": "1.5.3",
|
||||||
"grunt-chmod": "~1.1.1",
|
"grunt-chmod": "~1.1.1",
|
||||||
"grunt-cli": "~1.4.3",
|
"grunt-cli": "~1.4.3",
|
||||||
"grunt-concurrent": "3.0.0",
|
"grunt-concurrent": "3.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-api",
|
"name": "@node-red/editor-api",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,13 +16,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/util": "3.0.0-beta.1",
|
"@node-red/util": "3.0.0-beta.2",
|
||||||
"@node-red/editor-client": "3.0.0-beta.1",
|
"@node-red/editor-client": "3.0.0-beta.2",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.20.0",
|
"body-parser": "1.20.0",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"express-session": "1.17.2",
|
"express-session": "1.17.3",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
"memorystore": "1.6.7",
|
"memorystore": "1.6.7",
|
||||||
"mime": "3.0.0",
|
"mime": "3.0.0",
|
||||||
|
|||||||
@@ -907,7 +907,8 @@
|
|||||||
"uknownNodes": "Unknown nodes",
|
"uknownNodes": "Unknown nodes",
|
||||||
"unusedSubflows": "Unused subflows",
|
"unusedSubflows": "Unused subflows",
|
||||||
"hiddenFlows": "Hidden flows",
|
"hiddenFlows": "Hidden flows",
|
||||||
"modifiedNodes": "Modified nodes and flows"
|
"modifiedNodes": "Modified nodes and flows",
|
||||||
|
"thisFlow": "Current flow"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/editor-client",
|
"name": "@node-red/editor-client",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.setOptions = function(options) {
|
this.setOptions = function(options) {
|
||||||
this.options = {
|
o.options = {
|
||||||
// undef: true,
|
// undef: true,
|
||||||
// unused: true,
|
// unused: true,
|
||||||
esversion: 9,
|
esversion: 9,
|
||||||
@@ -98,7 +98,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
|
|||||||
if (options) {
|
if (options) {
|
||||||
for (var opt in options) {
|
for (var opt in options) {
|
||||||
if (options.hasOwnProperty(opt)) {
|
if (options.hasOwnProperty(opt)) {
|
||||||
this.options[opt] = options.opt;
|
o.options[opt] = options[opt];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,9 +323,6 @@ RED.group = (function() {
|
|||||||
groups: [ ],
|
groups: [ ],
|
||||||
dirty: RED.nodes.dirty()
|
dirty: RED.nodes.dirty()
|
||||||
}
|
}
|
||||||
RED.history.push(historyEvent);
|
|
||||||
|
|
||||||
|
|
||||||
groups.forEach(function(g) {
|
groups.forEach(function(g) {
|
||||||
newSelection = newSelection.concat(ungroup(g))
|
newSelection = newSelection.concat(ungroup(g))
|
||||||
historyEvent.groups.push(g);
|
historyEvent.groups.push(g);
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ RED.search = (function() {
|
|||||||
|
|
||||||
function search(val) {
|
function search(val) {
|
||||||
var results = [];
|
var results = [];
|
||||||
var keys = [];
|
|
||||||
var typeFilter;
|
var typeFilter;
|
||||||
var m = /(?:^| )type:([^ ]+)/.exec(val);
|
var m = /(?:^| )type:([^ ]+)/.exec(val);
|
||||||
if (m) {
|
if (m) {
|
||||||
@@ -122,19 +121,24 @@ RED.search = (function() {
|
|||||||
val = extractFlag(val,"subflow",flags);
|
val = extractFlag(val,"subflow",flags);
|
||||||
val = extractFlag(val,"hidden",flags);
|
val = extractFlag(val,"hidden",flags);
|
||||||
val = extractFlag(val,"modified",flags);
|
val = extractFlag(val,"modified",flags);
|
||||||
// uses:<node-id>
|
val = extractValue(val,"flow",flags);// flow:active or flow:<flow-id>
|
||||||
val = extractValue(val,"uses",flags);
|
val = extractValue(val,"uses",flags);// uses:<node-id>
|
||||||
|
|
||||||
var hasFlags = Object.keys(flags).length > 0;
|
|
||||||
|
|
||||||
val = val.trim();
|
val = val.trim();
|
||||||
|
var hasFlags = Object.keys(flags).length > 0;
|
||||||
|
if (flags.flow && flags.flow.indexOf("current") >= 0) {
|
||||||
|
let idx = flags.flow.indexOf("current");
|
||||||
|
flags.flow[idx] = RED.workspaces.active();//convert active to flow ID
|
||||||
|
}
|
||||||
|
if (flags.flow && flags.flow.length) {
|
||||||
|
flags.flow = [ ...new Set(flags.flow) ]; //deduplicate
|
||||||
|
}
|
||||||
if (val.length > 0 || typeFilter || hasFlags) {
|
if (val.length > 0 || typeFilter || hasFlags) {
|
||||||
val = val.toLowerCase();
|
val = val.toLowerCase();
|
||||||
var i;
|
var i;
|
||||||
var j;
|
var j;
|
||||||
var list = [];
|
var list = [];
|
||||||
var nodes = {};
|
var nodes = {};
|
||||||
|
let keys = [];
|
||||||
if (flags.uses) {
|
if (flags.uses) {
|
||||||
keys = flags.uses;
|
keys = flags.uses;
|
||||||
} else {
|
} else {
|
||||||
@@ -188,6 +192,11 @@ RED.search = (function() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (flags.hasOwnProperty("flow")) {
|
||||||
|
if (flags.flow.indexOf(node.node.z || node.node.id) < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!typeFilter || node.node.type === typeFilter) {
|
if (!typeFilter || node.node.type === typeFilter) {
|
||||||
nodes[node.node.id] = nodes[node.node.id] = {
|
nodes[node.node.id] = nodes[node.node.id] = {
|
||||||
node: node.node,
|
node: node.node,
|
||||||
@@ -592,8 +601,8 @@ RED.search = (function() {
|
|||||||
{label:RED._("search.options.uknownNodes"), value: "type:unknown"},
|
{label:RED._("search.options.uknownNodes"), value: "type:unknown"},
|
||||||
{label:RED._("search.options.unusedSubflows"), value:"is:subflow is:unused"},
|
{label:RED._("search.options.unusedSubflows"), value:"is:subflow is:unused"},
|
||||||
{label:RED._("search.options.hiddenFlows"), value:"is:hidden"},
|
{label:RED._("search.options.hiddenFlows"), value:"is:hidden"},
|
||||||
|
{label:RED._("search.options.thisFlow"), value:"flow:current"},
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ RED.view = (function() {
|
|||||||
var selectNodesOptions;
|
var selectNodesOptions;
|
||||||
|
|
||||||
let flashingNodeId;
|
let flashingNodeId;
|
||||||
let flashingNodeTimer;
|
|
||||||
|
|
||||||
var clipboard = "";
|
var clipboard = "";
|
||||||
|
|
||||||
@@ -173,7 +172,8 @@ RED.view = (function() {
|
|||||||
length: function() { return set.length},
|
length: function() { return set.length},
|
||||||
get: function(i) { return set[i] },
|
get: function(i) { return set[i] },
|
||||||
forEach: function(func) { set.forEach(func) },
|
forEach: function(func) { set.forEach(func) },
|
||||||
nodes: function() { return set.map(function(n) { return n.n })}
|
nodes: function() { return set.map(function(n) { return n.n })},
|
||||||
|
has: function(node) { return setIds.has(node.id) }
|
||||||
}
|
}
|
||||||
return api;
|
return api;
|
||||||
})();
|
})();
|
||||||
@@ -230,6 +230,7 @@ RED.view = (function() {
|
|||||||
.on("mousedown", canvasMouseDown)
|
.on("mousedown", canvasMouseDown)
|
||||||
.on("mouseup", canvasMouseUp)
|
.on("mouseup", canvasMouseUp)
|
||||||
.on("mouseenter", function() {
|
.on("mouseenter", function() {
|
||||||
|
d3.select(document).on('mouseup.red-ui-workspace-tracker', null)
|
||||||
if (lasso) {
|
if (lasso) {
|
||||||
if (d3.event.buttons !== 1) {
|
if (d3.event.buttons !== 1) {
|
||||||
lasso.remove();
|
lasso.remove();
|
||||||
@@ -245,6 +246,7 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.on("mouseleave", canvasMouseLeave)
|
||||||
.on("touchend", function() {
|
.on("touchend", function() {
|
||||||
d3.event.preventDefault();
|
d3.event.preventDefault();
|
||||||
clearTimeout(touchStartTime);
|
clearTimeout(touchStartTime);
|
||||||
@@ -385,6 +387,9 @@ RED.view = (function() {
|
|||||||
drag_lines = [];
|
drag_lines = [];
|
||||||
|
|
||||||
RED.events.on("workspace:change",function(event) {
|
RED.events.on("workspace:change",function(event) {
|
||||||
|
// Just in case the mouse left the workspace whilst doing an action,
|
||||||
|
// put us back into default mode so the refresh works
|
||||||
|
mouse_mode = 0
|
||||||
if (event.old !== 0) {
|
if (event.old !== 0) {
|
||||||
workspaceScrollPositions[event.old] = {
|
workspaceScrollPositions[event.old] = {
|
||||||
left:chart.scrollLeft(),
|
left:chart.scrollLeft(),
|
||||||
@@ -955,8 +960,9 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function canvasMouseDown() {
|
function canvasMouseDown() {
|
||||||
if (RED.view.DEBUG) { console.warn("canvasMouseDown", mouse_mode); }
|
if (RED.view.DEBUG) {
|
||||||
var point;
|
console.warn("canvasMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||||
|
}
|
||||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
@@ -973,45 +979,49 @@ RED.view = (function() {
|
|||||||
selectedLinks.clear();
|
selectedLinks.clear();
|
||||||
updateSelection();
|
updateSelection();
|
||||||
}
|
}
|
||||||
if (mouse_mode === 0) {
|
if (mouse_mode === 0 && lasso) {
|
||||||
if (lasso) {
|
lasso.remove();
|
||||||
lasso.remove();
|
lasso = null;
|
||||||
lasso = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((mouse_mode === 0 || mouse_mode === RED.state.QUICK_JOINING) && (d3.event.touches || d3.event.button === 0) && (d3.event.metaKey || d3.event.ctrlKey)) {
|
if (d3.event.touches || d3.event.button === 0) {
|
||||||
// Trigger quick add dialog
|
if ((mouse_mode === 0 || mouse_mode === RED.state.QUICK_JOINING) && (d3.event.metaKey || d3.event.ctrlKey) && !(d3.event.altKey || d3.event.shiftKey)) {
|
||||||
d3.event.stopPropagation();
|
// Trigger quick add dialog
|
||||||
clearSelection();
|
d3.event.stopPropagation();
|
||||||
point = d3.mouse(this);
|
clearSelection();
|
||||||
var clickedGroup = getGroupAt(point[0],point[1]);
|
const point = d3.mouse(this);
|
||||||
if (drag_lines.length > 0) {
|
var clickedGroup = getGroupAt(point[0], point[1]);
|
||||||
clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
|
if (drag_lines.length > 0) {
|
||||||
|
clickedGroup = clickedGroup || RED.nodes.group(drag_lines[0].node.g)
|
||||||
|
}
|
||||||
|
showQuickAddDialog({ position: point, group: clickedGroup });
|
||||||
|
} else if (mouse_mode === 0 && !(d3.event.metaKey || d3.event.ctrlKey)) {
|
||||||
|
// CTRL not being held
|
||||||
|
if (!d3.event.altKey) {
|
||||||
|
// ALT not held (shift is allowed) Trigger lasso
|
||||||
|
if (!touchStartTime) {
|
||||||
|
const point = d3.mouse(this);
|
||||||
|
lasso = eventLayer.append("rect")
|
||||||
|
.attr("ox", point[0])
|
||||||
|
.attr("oy", point[1])
|
||||||
|
.attr("rx", 1)
|
||||||
|
.attr("ry", 1)
|
||||||
|
.attr("x", point[0])
|
||||||
|
.attr("y", point[1])
|
||||||
|
.attr("width", 0)
|
||||||
|
.attr("height", 0)
|
||||||
|
.attr("class", "nr-ui-view-lasso");
|
||||||
|
d3.event.preventDefault();
|
||||||
|
}
|
||||||
|
} else if (d3.event.altKey) {
|
||||||
|
//Alt [+shift] held - Begin slicing
|
||||||
|
clearSelection();
|
||||||
|
mouse_mode = (d3.event.shiftKey) ? RED.state.SLICING_JUNCTION : RED.state.SLICING;
|
||||||
|
const point = d3.mouse(this);
|
||||||
|
slicePath = eventLayer.append("path").attr("class", "nr-ui-view-slice").attr("d", `M${point[0]} ${point[1]}`)
|
||||||
|
slicePathLast = point;
|
||||||
|
RED.view.redraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
showQuickAddDialog({position:point, group:clickedGroup});
|
|
||||||
} else if (mouse_mode === 0 && (d3.event.touches || d3.event.button === 0) && !(d3.event.metaKey || d3.event.ctrlKey)) {
|
|
||||||
// Tigger lasso
|
|
||||||
if (!touchStartTime) {
|
|
||||||
point = d3.mouse(this);
|
|
||||||
lasso = eventLayer.append("rect")
|
|
||||||
.attr("ox",point[0])
|
|
||||||
.attr("oy",point[1])
|
|
||||||
.attr("rx",1)
|
|
||||||
.attr("ry",1)
|
|
||||||
.attr("x",point[0])
|
|
||||||
.attr("y",point[1])
|
|
||||||
.attr("width",0)
|
|
||||||
.attr("height",0)
|
|
||||||
.attr("class","nr-ui-view-lasso");
|
|
||||||
d3.event.preventDefault();
|
|
||||||
}
|
|
||||||
} else if (mouse_mode === 0 && d3.event.button === 2 && (d3.event.metaKey || d3.event.ctrlKey || d3.event.shiftKey)) {
|
|
||||||
clearSelection();
|
|
||||||
mouse_mode = (d3.event.metaKey || d3.event.ctrlKey)?RED.state.SLICING : RED.state.SLICING_JUNCTION;
|
|
||||||
point = d3.mouse(this);
|
|
||||||
slicePath = eventLayer.append("path").attr("class","nr-ui-view-slice").attr("d",`M${point[0]} ${point[1]}`)
|
|
||||||
slicePathLast = point;
|
|
||||||
RED.view.redraw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1711,10 +1721,19 @@ RED.view = (function() {
|
|||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function canvasMouseLeave() {
|
||||||
|
if (mouse_mode !== 0 && d3.event.buttons !== 0) {
|
||||||
|
d3.select(document).on('mouseup.red-ui-workspace-tracker', function() {
|
||||||
|
d3.select(document).on('mouseup.red-ui-workspace-tracker', null)
|
||||||
|
canvasMouseUp.call(this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
function canvasMouseUp() {
|
function canvasMouseUp() {
|
||||||
lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor];
|
lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor];
|
||||||
if (RED.view.DEBUG) { console.warn("canvasMouseUp", mouse_mode); }
|
if (RED.view.DEBUG) {
|
||||||
|
console.warn("canvasMouseUp", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||||
|
}
|
||||||
var i;
|
var i;
|
||||||
var historyEvent;
|
var historyEvent;
|
||||||
if (mouse_mode === RED.state.PANNING) {
|
if (mouse_mode === RED.state.PANNING) {
|
||||||
@@ -3232,52 +3251,16 @@ RED.view = (function() {
|
|||||||
port.classed("red-ui-flow-port-hovered",false);
|
port.classed("red-ui-flow-port-hovered",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function junctionMouseOver(junction, d) {
|
function junctionMouseOver(junction, d, portType) {
|
||||||
junction.classed("red-ui-flow-junction-hovered",true);
|
var active = (portType === undefined) ||
|
||||||
|
(mouse_mode !== RED.state.JOINING && mouse_mode !== RED.state.QUICK_JOINING) ||
|
||||||
|
(drag_lines.length > 0 && drag_lines[0].portType !== portType && !drag_lines[0].virtualLink)
|
||||||
|
junction.classed("red-ui-flow-junction-hovered", active);
|
||||||
}
|
}
|
||||||
function junctionMouseOut(junction, d) {
|
function junctionMouseOut(junction, d) {
|
||||||
junction.classed("red-ui-flow-junction-hovered",false);
|
junction.classed("red-ui-flow-junction-hovered",false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function junctionMouseDown(junction, d, evt) {
|
|
||||||
if (RED.view.DEBUG) { console.warn("junctionMouseDown", d); }
|
|
||||||
evt = evt || d3.event;
|
|
||||||
d3.event = evt
|
|
||||||
if (evt === 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
|
||||||
evt.stopPropagation();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mouse_mode == RED.state.QUICK_JOINING) {
|
|
||||||
d3.event.stopPropagation();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// mousedown_node = d;
|
|
||||||
// mousedown_port_type = portType;
|
|
||||||
// mousedown_port_index = portIndex || 0;
|
|
||||||
if (mouse_mode !== RED.state.QUICK_JOINING && (evt.ctrlKey || evt.metaKey)) {
|
|
||||||
mouse_mode = RED.state.QUICK_JOINING;
|
|
||||||
document.body.style.cursor = "crosshair";
|
|
||||||
showDragLines([{node:d,port:0,portType: PORT_TYPE_OUTPUT}]);
|
|
||||||
$(window).on('keyup',disableQuickJoinEventHandler);
|
|
||||||
} else if (event.button != 2) {
|
|
||||||
nodeMouseDown.call(junction[0][0],d)
|
|
||||||
// clearSelection();
|
|
||||||
// movingSet.add(d);
|
|
||||||
// mousedown_node = d;
|
|
||||||
// mouse_mode = RED.state.MOVING;
|
|
||||||
// var mouse = d3.touches(junction[0][0])[0]||d3.mouse(junction[0][0]);
|
|
||||||
// mouse[0] += d.x-d.w/2;
|
|
||||||
// mouse[1] += d.y-d.h/2;
|
|
||||||
// prepareDrag(mouse);
|
|
||||||
}
|
|
||||||
evt.stopPropagation();
|
|
||||||
evt.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
function prepareDrag(mouse) {
|
function prepareDrag(mouse) {
|
||||||
mouse_mode = RED.state.MOVING;
|
mouse_mode = RED.state.MOVING;
|
||||||
// Called when movingSet should be prepared to be dragged
|
// Called when movingSet should be prepared to be dragged
|
||||||
@@ -3437,6 +3420,9 @@ RED.view = (function() {
|
|||||||
return;
|
return;
|
||||||
} else if (mouse_mode === RED.state.SELECTING_NODE) {
|
} else if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
|
if (d.type === 'junction') {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (selectNodesOptions.single) {
|
if (selectNodesOptions.single) {
|
||||||
selectNodesOptions.done(d);
|
selectNodesOptions.done(d);
|
||||||
return;
|
return;
|
||||||
@@ -3463,12 +3449,12 @@ RED.view = (function() {
|
|||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
clickElapsed = now-clickTime;
|
clickElapsed = now-clickTime;
|
||||||
clickTime = now;
|
clickTime = now;
|
||||||
dblClickPrimed = (lastClickNode == mousedown_node &&
|
dblClickPrimed = lastClickNode == mousedown_node &&
|
||||||
(d3.event.touches || d3.event.button === 0) &&
|
(d3.event.touches || d3.event.button === 0) &&
|
||||||
!d3.event.shiftKey && !d3.event.altKey &&
|
!d3.event.shiftKey && !d3.event.altKey &&
|
||||||
clickElapsed < dblClickInterval
|
clickElapsed < dblClickInterval &&
|
||||||
)
|
d.type !== 'junction'
|
||||||
lastClickNode = mousedown_node;
|
lastClickNode = mousedown_node;
|
||||||
|
|
||||||
if (!d.selected && d.g /*&& !RED.nodes.group(d.g).selected*/) {
|
if (!d.selected && d.g /*&& !RED.nodes.group(d.g).selected*/) {
|
||||||
var nodeGroup = RED.nodes.group(d.g);
|
var nodeGroup = RED.nodes.group(d.g);
|
||||||
@@ -3594,9 +3580,9 @@ RED.view = (function() {
|
|||||||
clearSelection();
|
clearSelection();
|
||||||
}
|
}
|
||||||
var clickPosition = (d3.event.offsetX/scaleFactor - mousedown_node.x)
|
var clickPosition = (d3.event.offsetX/scaleFactor - mousedown_node.x)
|
||||||
var edgeDelta = (mousedown_node.w/2) - Math.abs(clickPosition);
|
var edgeDelta = ((mousedown_node.w||10)/2) - Math.abs(clickPosition);
|
||||||
var cnodes;
|
var cnodes;
|
||||||
var targetEdgeDelta = mousedown_node.w > 30 ? 25 : 8;
|
var targetEdgeDelta = mousedown_node.w > 30 ? 25 : (mousedown_node.w > 0 ? 8 : 3);
|
||||||
if (edgeDelta < targetEdgeDelta) {
|
if (edgeDelta < targetEdgeDelta) {
|
||||||
if (clickPosition < 0) {
|
if (clickPosition < 0) {
|
||||||
cnodes = [mousedown_node].concat(RED.nodes.getAllUpstreamNodes(mousedown_node));
|
cnodes = [mousedown_node].concat(RED.nodes.getAllUpstreamNodes(mousedown_node));
|
||||||
@@ -3741,12 +3727,13 @@ RED.view = (function() {
|
|||||||
function portMouseOverProxy(e) { portMouseOver(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
|
function portMouseOverProxy(e) { portMouseOver(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
|
||||||
function portMouseOutProxy(e) { portMouseOut(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
|
function portMouseOutProxy(e) { portMouseOut(d3.select(this), this.__data__,this.__portType__,this.__portIndex__, e); }
|
||||||
|
|
||||||
function junctionMouseOverProxy(e) { junctionMouseOver(d3.select(this), this.__data__) }
|
function junctionMouseOverProxy(e) { junctionMouseOver(d3.select(this), this.__data__, this.__portType__) }
|
||||||
function junctionMouseOutProxy(e) { junctionMouseOut(d3.select(this), this.__data__) }
|
function junctionMouseOutProxy(e) { junctionMouseOut(d3.select(this), this.__data__) }
|
||||||
function junctionMouseDownProxy(e) { junctionMouseDown(d3.select(this), this.__data__, e) }
|
|
||||||
function junctionMouseUpProxy(e) { junctionMouseUp(d3.select(this), this.__data__) }
|
|
||||||
|
|
||||||
function linkMouseDown(d) {
|
function linkMouseDown(d) {
|
||||||
|
if (RED.view.DEBUG) {
|
||||||
|
console.warn("linkMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||||
|
}
|
||||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
@@ -4895,22 +4882,56 @@ RED.view = (function() {
|
|||||||
junctionBack.setAttribute("y",-5);
|
junctionBack.setAttribute("y",-5);
|
||||||
junctionBack.setAttribute("width",10);
|
junctionBack.setAttribute("width",10);
|
||||||
junctionBack.setAttribute("height",10);
|
junctionBack.setAttribute("height",10);
|
||||||
junctionBack.setAttribute("rx",5);
|
junctionBack.setAttribute("rx",3);
|
||||||
junctionBack.setAttribute("ry",5);
|
junctionBack.setAttribute("ry",3);
|
||||||
junctionBack.__data__ = d;
|
junctionBack.__data__ = d;
|
||||||
this.__junctionBack__ = junctionBack;
|
this.__junctionBack__ = junctionBack;
|
||||||
contents.appendChild(junctionBack);
|
contents.appendChild(junctionBack);
|
||||||
|
|
||||||
|
var junctionInput = document.createElementNS("http://www.w3.org/2000/svg","rect");
|
||||||
|
junctionInput.setAttribute("class","red-ui-flow-junction-port red-ui-flow-junction-port-input");
|
||||||
|
junctionInput.setAttribute("x",-5);
|
||||||
|
junctionInput.setAttribute("y",-5);
|
||||||
|
junctionInput.setAttribute("width",10);
|
||||||
|
junctionInput.setAttribute("height",10);
|
||||||
|
junctionInput.setAttribute("rx",3);
|
||||||
|
junctionInput.setAttribute("ry",3);
|
||||||
|
junctionInput.__data__ = d;
|
||||||
|
junctionInput.__portType__ = PORT_TYPE_INPUT;
|
||||||
|
junctionInput.__portIndex__ = 0;
|
||||||
|
this.__junctionInput__ = junctionOutput;
|
||||||
|
contents.appendChild(junctionInput);
|
||||||
|
junctionInput.addEventListener("mouseup", portMouseUpProxy);
|
||||||
|
junctionInput.addEventListener("mousedown", portMouseDownProxy);
|
||||||
|
|
||||||
|
|
||||||
|
this.__junctionInput__ = junctionInput;
|
||||||
|
contents.appendChild(junctionInput);
|
||||||
|
var junctionOutput = document.createElementNS("http://www.w3.org/2000/svg","rect");
|
||||||
|
junctionOutput.setAttribute("class","red-ui-flow-junction-port red-ui-flow-junction-port-output");
|
||||||
|
junctionOutput.setAttribute("x",-5);
|
||||||
|
junctionOutput.setAttribute("y",-5);
|
||||||
|
junctionOutput.setAttribute("width",10);
|
||||||
|
junctionOutput.setAttribute("height",10);
|
||||||
|
junctionOutput.setAttribute("rx",3);
|
||||||
|
junctionOutput.setAttribute("ry",3);
|
||||||
|
junctionOutput.__data__ = d;
|
||||||
|
junctionOutput.__portType__ = PORT_TYPE_OUTPUT;
|
||||||
|
junctionOutput.__portIndex__ = 0;
|
||||||
|
this.__junctionOutput__ = junctionOutput;
|
||||||
|
contents.appendChild(junctionOutput);
|
||||||
|
junctionOutput.addEventListener("mouseup", portMouseUpProxy);
|
||||||
|
junctionOutput.addEventListener("mousedown", portMouseDownProxy);
|
||||||
|
|
||||||
|
junctionOutput.addEventListener("mouseover", junctionMouseOverProxy);
|
||||||
|
junctionOutput.addEventListener("mouseout", junctionMouseOutProxy);
|
||||||
|
junctionInput.addEventListener("mouseover", junctionMouseOverProxy);
|
||||||
|
junctionInput.addEventListener("mouseout", junctionMouseOutProxy);
|
||||||
junctionBack.addEventListener("mouseover", junctionMouseOverProxy);
|
junctionBack.addEventListener("mouseover", junctionMouseOverProxy);
|
||||||
junctionBack.addEventListener("mouseout", junctionMouseOutProxy);
|
junctionBack.addEventListener("mouseout", junctionMouseOutProxy);
|
||||||
junctionBack.addEventListener("mouseup", portMouseUpProxy);
|
|
||||||
junctionBack.addEventListener("mousedown", junctionMouseDownProxy);
|
|
||||||
|
|
||||||
// d3.select(junctionBack).on("mousedown", nodeMouseDown);
|
// These handlers expect to be registered as d3 events
|
||||||
|
d3.select(junctionBack).on("mousedown", nodeMouseDown).on("mouseup", nodeMouseUp);
|
||||||
this.__portType__ = PORT_TYPE_INPUT
|
|
||||||
this.__portIndex__ = 0
|
|
||||||
// function portMouseUpProxy(e) { portMouseUp(this.__data__,this.__portType__,this.__portIndex__, e); }
|
|
||||||
|
|
||||||
junction[0][0].appendChild(contents);
|
junction[0][0].appendChild(contents);
|
||||||
})
|
})
|
||||||
@@ -4919,6 +4940,7 @@ RED.view = (function() {
|
|||||||
var junction = d3.select(this);
|
var junction = d3.select(this);
|
||||||
this.setAttribute("transform", "translate(" + (d.x) + "," + (d.y) + ")");
|
this.setAttribute("transform", "translate(" + (d.x) + "," + (d.y) + ")");
|
||||||
if (d.dirty) {
|
if (d.dirty) {
|
||||||
|
junction.classed("red-ui-flow-junction-dragging", mouse_mode === RED.state.MOVING_ACTIVE && movingSet.has(d))
|
||||||
junction.classed("selected", !!d.selected)
|
junction.classed("selected", !!d.selected)
|
||||||
dirtyNodes[d.id] = d;
|
dirtyNodes[d.id] = d;
|
||||||
|
|
||||||
@@ -4959,10 +4981,11 @@ RED.view = (function() {
|
|||||||
.on("touchstart",linkTouchStart)
|
.on("touchstart",linkTouchStart)
|
||||||
.on("mousemove", function(d) {
|
.on("mousemove", function(d) {
|
||||||
if (mouse_mode === RED.state.SLICING) {
|
if (mouse_mode === RED.state.SLICING) {
|
||||||
|
|
||||||
selectedLinks.add(d)
|
selectedLinks.add(d)
|
||||||
l.classed("red-ui-flow-link-splice",true)
|
l.classed("red-ui-flow-link-splice",true)
|
||||||
redraw()
|
redraw()
|
||||||
} else if (mouse_mode === RED.state.SLICING_JUNCTION) {
|
} else if (mouse_mode === RED.state.SLICING_JUNCTION && !d.link) {
|
||||||
if (!l.classed("red-ui-flow-link-splice")) {
|
if (!l.classed("red-ui-flow-link-splice")) {
|
||||||
// Find intersection point
|
// Find intersection point
|
||||||
var lineLength = pathLine.getTotalLength();
|
var lineLength = pathLine.getTotalLength();
|
||||||
@@ -5876,27 +5899,26 @@ RED.view = (function() {
|
|||||||
if(typeof node === "string") { node = RED.nodes.node(n); }
|
if(typeof node === "string") { node = RED.nodes.node(n); }
|
||||||
if(!node) { return; }
|
if(!node) { return; }
|
||||||
|
|
||||||
const flashingNode = flashingNodeTimer && flashingNodeId && RED.nodes.node(flashingNodeId);
|
const flashingNode = flashingNodeId && RED.nodes.node(flashingNodeId);
|
||||||
if(flashingNode) {
|
if(flashingNode) {
|
||||||
//cancel current flashing node before flashing new node
|
//cancel current flashing node before flashing new node
|
||||||
clearInterval(flashingNodeTimer);
|
clearInterval(flashingNode.__flashTimer);
|
||||||
flashingNodeTimer = null;
|
delete flashingNode.__flashTimer;
|
||||||
flashingNode.dirty = true;
|
flashingNode.dirty = true;
|
||||||
flashingNode.highlighted = false;
|
flashingNode.highlighted = false;
|
||||||
}
|
}
|
||||||
|
node.__flashTimer = setInterval(function(flashEndTime, n) {
|
||||||
flashingNodeTimer = setInterval(function(flashEndTime) {
|
n.dirty = true;
|
||||||
node.dirty = true;
|
|
||||||
if (flashEndTime >= Date.now()) {
|
if (flashEndTime >= Date.now()) {
|
||||||
node.highlighted = !node.highlighted;
|
n.highlighted = !n.highlighted;
|
||||||
} else {
|
} else {
|
||||||
clearInterval(flashingNodeTimer);
|
clearInterval(n.__flashTimer);
|
||||||
flashingNodeTimer = null;
|
delete n.__flashTimer;
|
||||||
node.highlighted = false;
|
|
||||||
flashingNodeId = null;
|
flashingNodeId = null;
|
||||||
|
n.highlighted = false;
|
||||||
}
|
}
|
||||||
RED.view.redraw();
|
RED.view.redraw();
|
||||||
}, 100, Date.now() + 2200)
|
}, 100, Date.now() + 2200, node)
|
||||||
flashingNodeId = node.id;
|
flashingNodeId = node.id;
|
||||||
node.highlighted = true;
|
node.highlighted = true;
|
||||||
RED.view.redraw();
|
RED.view.redraw();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
}
|
}
|
||||||
.ace_gutter-cell {
|
.ace_gutter-cell {
|
||||||
color: $text-editor-color;
|
color: $text-editor-gutter-color;
|
||||||
}
|
}
|
||||||
.ace_gutter-active-line {
|
.ace_gutter-active-line {
|
||||||
background: $text-editor-gutter-active-line-background;
|
background: $text-editor-gutter-active-line-background;
|
||||||
|
|||||||
@@ -379,11 +379,46 @@ g.red-ui-flow-link-unknown path.red-ui-flow-link-line {
|
|||||||
white-space: pre;
|
white-space: pre;
|
||||||
@include disable-selection;
|
@include disable-selection;
|
||||||
}
|
}
|
||||||
|
.red-ui-flow-junction-dragging {
|
||||||
|
.red-ui-flow-junction-background {
|
||||||
|
background: red !important
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.red-ui-flow-junction:not(.red-ui-flow-junction-dragging):hover {
|
||||||
|
.red-ui-flow-junction-background {
|
||||||
|
transform: scale(1.4);
|
||||||
|
stroke-width: 0.6;
|
||||||
|
}
|
||||||
|
.red-ui-flow-junction-port {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.red-ui-flow-junction-port-input {
|
||||||
|
transform: translate(-10px,0)
|
||||||
|
}
|
||||||
|
.red-ui-flow-junction-port-output {
|
||||||
|
transform: translate(10px,0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.red-ui-flow-junction-port {
|
||||||
|
stroke: $node-border;
|
||||||
|
stroke-width: 1;
|
||||||
|
fill: $node-port-background;
|
||||||
|
cursor: crosshair;
|
||||||
|
transition: transform 0.1s;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
.red-ui-flow-junction-background {
|
.red-ui-flow-junction-background {
|
||||||
stroke: $node-border;
|
stroke: $node-border;
|
||||||
stroke-width: 1;
|
stroke-width: 1;
|
||||||
fill: $node-port-background;
|
fill: $node-port-background;
|
||||||
cursor: crosshair;
|
cursor: crosshair;
|
||||||
|
transform: scale(1);
|
||||||
|
transition: transform 0.1s;
|
||||||
|
&:hover {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.red-ui-flow-junction-hovered {
|
.red-ui-flow-junction-hovered {
|
||||||
stroke: $port-selected-color;
|
stroke: $port-selected-color;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
.red-ui-search-result-node-port {
|
.red-ui-search-result-node-port {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: 1px solid $node-border;;
|
border: 1px solid $node-border;
|
||||||
width: 6px;
|
width: 6px;
|
||||||
height: 7px;
|
height: 7px;
|
||||||
top:4px;
|
top:4px;
|
||||||
|
|||||||
@@ -530,7 +530,6 @@
|
|||||||
if (type !== 'full') {
|
if (type !== 'full') {
|
||||||
comp = $("#node-input-typed-complete").typedInput('value');
|
comp = $("#node-input-typed-complete").typedInput('value');
|
||||||
}
|
}
|
||||||
console.log('hihi')
|
|
||||||
that.statusType = "auto";
|
that.statusType = "auto";
|
||||||
that.statusVal = comp;
|
that.statusVal = comp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,7 +302,6 @@
|
|||||||
return this.name?"node_label_italic":"";
|
return this.name?"node_label_italic":"";
|
||||||
},
|
},
|
||||||
oneditprepare: function() {
|
oneditprepare: function() {
|
||||||
console.log("link call oneditprepare")
|
|
||||||
const updateVisibility = function() {
|
const updateVisibility = function() {
|
||||||
const static = $('#node-input-linkType').val() !== "dynamic";
|
const static = $('#node-input-linkType').val() !== "dynamic";
|
||||||
if(static) {
|
if(static) {
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ RED.debug = (function() {
|
|||||||
$('<span class="red-ui-debug-msg-date">'+ getTimestamp()+'</span>').appendTo(metaRow);
|
$('<span class="red-ui-debug-msg-date">'+ getTimestamp()+'</span>').appendTo(metaRow);
|
||||||
if (sourceNode) {
|
if (sourceNode) {
|
||||||
|
|
||||||
var nodeLink = $('<a>',{href:"#",class:"red-ui-debug-msg-name"}).text("node: "+(o.name||sourceNode.name||sourceNode.id))
|
var nodeLink = $('<a>',{href:"#",class:"red-ui-debug-msg-name"}).text(RED._("node-red:debug.node")+": "+(o.name||sourceNode.name||sourceNode.id))
|
||||||
.appendTo(metaRow)
|
.appendTo(metaRow)
|
||||||
.on("click", function(evt) {
|
.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ module.exports = function(RED) {
|
|||||||
// Only for ws or wss, check if proxy env var for additional configuration
|
// Only for ws or wss, check if proxy env var for additional configuration
|
||||||
if (node.brokerurl.indexOf("wss://") > -1 || node.brokerurl.indexOf("ws://") > -1) {
|
if (node.brokerurl.indexOf("wss://") > -1 || node.brokerurl.indexOf("ws://") > -1) {
|
||||||
// check if proxy is set in env
|
// check if proxy is set in env
|
||||||
let prox, noprox;
|
let prox, noprox, noproxy;
|
||||||
if (process.env.http_proxy) { prox = process.env.http_proxy; }
|
if (process.env.http_proxy) { prox = process.env.http_proxy; }
|
||||||
if (process.env.HTTP_PROXY) { prox = process.env.HTTP_PROXY; }
|
if (process.env.HTTP_PROXY) { prox = process.env.HTTP_PROXY; }
|
||||||
if (process.env.no_proxy) { noprox = process.env.no_proxy.split(","); }
|
if (process.env.no_proxy) { noprox = process.env.no_proxy.split(","); }
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var connectedSockets = [];
|
const connectedSockets = new Set();
|
||||||
node.status({text:RED._("tcpin.status.connections",{count:0})});
|
node.status({text:RED._("tcpin.status.connections",{count:0})});
|
||||||
let srv = net;
|
let srv = net;
|
||||||
let connOpts;
|
let connOpts;
|
||||||
@@ -456,16 +456,16 @@ module.exports = function(RED) {
|
|||||||
});
|
});
|
||||||
socket.on('close',function() {
|
socket.on('close',function() {
|
||||||
node.log(RED._("tcpin.status.connection-closed",{host:socket.remoteAddress, port:socket.remotePort}));
|
node.log(RED._("tcpin.status.connection-closed",{host:socket.remoteAddress, port:socket.remotePort}));
|
||||||
connectedSockets.splice(connectedSockets.indexOf(socket),1);
|
connectedSockets.delete(socket);
|
||||||
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
|
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.size})});
|
||||||
});
|
});
|
||||||
socket.on('error',function() {
|
socket.on('error',function() {
|
||||||
node.log(RED._("tcpin.errors.socket-error",{host:socket.remoteAddress, port:socket.remotePort}));
|
node.log(RED._("tcpin.errors.socket-error",{host:socket.remoteAddress, port:socket.remotePort}));
|
||||||
connectedSockets.splice(connectedSockets.indexOf(socket),1);
|
connectedSockets.delete(socket);
|
||||||
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
|
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.size})});
|
||||||
});
|
});
|
||||||
connectedSockets.push(socket);
|
connectedSockets.add(socket);
|
||||||
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.length})});
|
node.status({text:RED._("tcpin.status.connections",{count:connectedSockets.size})});
|
||||||
});
|
});
|
||||||
|
|
||||||
node.on("input", function(msg, nodeSend, nodeDone) {
|
node.on("input", function(msg, nodeSend, nodeDone) {
|
||||||
@@ -478,10 +478,10 @@ module.exports = function(RED) {
|
|||||||
} else {
|
} else {
|
||||||
buffer = Buffer.from(""+msg.payload);
|
buffer = Buffer.from(""+msg.payload);
|
||||||
}
|
}
|
||||||
for (var i = 0; i < connectedSockets.length; i += 1) {
|
connectedSockets.forEach(soc => {
|
||||||
if (node.doend === true) { connectedSockets[i].end(buffer); }
|
if (node.doend === true) { soc.end(buffer); }
|
||||||
else { connectedSockets[i].write(buffer); }
|
else { soc.write(buffer); }
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
nodeDone();
|
nodeDone();
|
||||||
});
|
});
|
||||||
@@ -498,12 +498,10 @@ module.exports = function(RED) {
|
|||||||
} else {
|
} else {
|
||||||
node.log(RED._("tcpin.status.listening-port",{port:node.port}));
|
node.log(RED._("tcpin.status.listening-port",{port:node.port}));
|
||||||
node.on('close', function() {
|
node.on('close', function() {
|
||||||
for (var c in connectedSockets) {
|
connectedSockets.forEach(soc => {
|
||||||
if (connectedSockets.hasOwnProperty(c)) {
|
soc.end();
|
||||||
connectedSockets[c].end();
|
soc.unref();
|
||||||
connectedSockets[c].unref();
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
server.close();
|
server.close();
|
||||||
node.log(RED._("tcpin.status.stopped-listening",{port:node.port}));
|
node.log(RED._("tcpin.status.stopped-listening",{port:node.port}));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -137,6 +137,7 @@
|
|||||||
"toConsole": "system console",
|
"toConsole": "system console",
|
||||||
"toStatus": "node status (32 characters)",
|
"toStatus": "node status (32 characters)",
|
||||||
"severity": "Level",
|
"severity": "Level",
|
||||||
|
"node": "node",
|
||||||
"notification": {
|
"notification": {
|
||||||
"activated": "Successfully activated: __label__",
|
"activated": "Successfully activated: __label__",
|
||||||
"deactivated": "Successfully deactivated: __label__"
|
"deactivated": "Successfully deactivated: __label__"
|
||||||
|
|||||||
@@ -137,6 +137,7 @@
|
|||||||
"toConsole": "システムコンソール",
|
"toConsole": "システムコンソール",
|
||||||
"toStatus": "ノードステータス(32 文字)",
|
"toStatus": "ノードステータス(32 文字)",
|
||||||
"severity": "Level",
|
"severity": "Level",
|
||||||
|
"node": "ノード",
|
||||||
"notification": {
|
"notification": {
|
||||||
"activated": "有効化しました: __label__",
|
"activated": "有効化しました: __label__",
|
||||||
"deactivated": "無効化しました: __label__"
|
"deactivated": "無効化しました: __label__"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/nodes",
|
"name": "@node-red/nodes",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/registry",
|
"name": "@node-red/registry",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/util": "3.0.0-beta.1",
|
"@node-red/util": "3.0.0-beta.2",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"fs-extra": "10.1.0",
|
"fs-extra": "10.1.0",
|
||||||
"semver": "7.3.7",
|
"semver": "7.3.7",
|
||||||
"tar": "6.1.11",
|
"tar": "6.1.11",
|
||||||
"uglify-js": "3.15.4"
|
"uglify-js": "3.15.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/runtime",
|
"name": "@node-red/runtime",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/registry": "3.0.0-beta.1",
|
"@node-red/registry": "3.0.0-beta.2",
|
||||||
"@node-red/util": "3.0.0-beta.1",
|
"@node-red/util": "3.0.0-beta.2",
|
||||||
"async-mutex": "0.3.2",
|
"async-mutex": "0.3.2",
|
||||||
"clone": "2.1.2",
|
"clone": "2.1.2",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@node-red/util",
|
"name": "@node-red/util",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "10.1.0",
|
"fs-extra": "10.1.0",
|
||||||
"i18next": "21.6.16",
|
"i18next": "21.8.2",
|
||||||
"json-stringify-safe": "5.0.1",
|
"json-stringify-safe": "5.0.1",
|
||||||
"jsonata": "1.8.6",
|
"jsonata": "1.8.6",
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "^4.5.0",
|
||||||
|
|||||||
10
packages/node_modules/node-red/package.json
vendored
10
packages/node_modules/node-red/package.json
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red",
|
"name": "node-red",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"description": "Low-code programming for event-driven applications",
|
"description": "Low-code programming for event-driven applications",
|
||||||
"homepage": "http://nodered.org",
|
"homepage": "http://nodered.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
"flow"
|
"flow"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@node-red/editor-api": "3.0.0-beta.1",
|
"@node-red/editor-api": "3.0.0-beta.2",
|
||||||
"@node-red/runtime": "3.0.0-beta.1",
|
"@node-red/runtime": "3.0.0-beta.2",
|
||||||
"@node-red/util": "3.0.0-beta.1",
|
"@node-red/util": "3.0.0-beta.2",
|
||||||
"@node-red/nodes": "3.0.0-beta.1",
|
"@node-red/nodes": "3.0.0-beta.2",
|
||||||
"basic-auth": "2.0.1",
|
"basic-auth": "2.0.1",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user