mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge branch 'master' into stop-start-flows
This commit is contained in:
commit
d83516584d
@ -907,7 +907,8 @@
|
|||||||
"uknownNodes": "未知のノード",
|
"uknownNodes": "未知のノード",
|
||||||
"unusedSubflows": "未使用のサブフロー",
|
"unusedSubflows": "未使用のサブフロー",
|
||||||
"hiddenFlows": "非表示のフロー",
|
"hiddenFlows": "非表示のフロー",
|
||||||
"modifiedNodes": "修正したノードやフロー"
|
"modifiedNodes": "修正したノードやフロー",
|
||||||
|
"thisFlow": "現在のフロー"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expressionEditor": {
|
"expressionEditor": {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
|
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
|
||||||
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
|
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
|
||||||
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
|
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
|
||||||
"tip17": "ノードのプロバティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
|
"tip17": "ノードのプロパティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
|
||||||
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
|
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,14 +363,22 @@ RED.library = (function() {
|
|||||||
options.onconfirm(item);
|
options.onconfirm(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
|
var itemTools = null;
|
||||||
|
if (options.folderTools) {
|
||||||
|
dirList.on('treelistselect', function(event, item) {
|
||||||
|
if (item.writable !== false && item.treeList) {
|
||||||
|
if (itemTools) {
|
||||||
|
itemTools.remove();
|
||||||
|
}
|
||||||
|
itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
|
||||||
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
|
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
|
||||||
.on("click", function(evt) {
|
.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
var elementPos = menuButton.offset();
|
var elementPos = menuButton.offset();
|
||||||
|
|
||||||
var menuOptionMenu = RED.menu.init({id:"red-ui-library-browser-menu",
|
var menuOptionMenu
|
||||||
|
= RED.menu.init({id:"red-ui-library-browser-menu",
|
||||||
options: [
|
options: [
|
||||||
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
|
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
|
||||||
var defaultFolderName = "new-folder";
|
var defaultFolderName = "new-folder";
|
||||||
@ -460,9 +468,7 @@ RED.library = (function() {
|
|||||||
}).show();
|
}).show();
|
||||||
|
|
||||||
}).appendTo(itemTools);
|
}).appendTo(itemTools);
|
||||||
if (options.folderTools) {
|
|
||||||
dirList.on('treelistselect', function(event, item) {
|
|
||||||
if (item.writable !== false && item.treeList) {
|
|
||||||
itemTools.appendTo(item.treeList.label);
|
itemTools.appendTo(item.treeList.label);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -526,6 +526,23 @@ RED.view = (function() {
|
|||||||
nn.x = mousePos[0];
|
nn.x = mousePos[0];
|
||||||
nn.y = mousePos[1];
|
nn.y = mousePos[1];
|
||||||
|
|
||||||
|
var minX = nn.w/2 -5;
|
||||||
|
if (nn.x < minX) {
|
||||||
|
nn.x = minX;
|
||||||
|
}
|
||||||
|
var minY = nn.h/2 -5;
|
||||||
|
if (nn.y < minY) {
|
||||||
|
nn.y = minY;
|
||||||
|
}
|
||||||
|
var maxX = space_width -nn.w/2 +5;
|
||||||
|
if (nn.x > maxX) {
|
||||||
|
nn.x = maxX;
|
||||||
|
}
|
||||||
|
var maxY = space_height -nn.h +5;
|
||||||
|
if (nn.y > maxY) {
|
||||||
|
nn.y = maxY;
|
||||||
|
}
|
||||||
|
|
||||||
if (snapGrid) {
|
if (snapGrid) {
|
||||||
var gridOffset = RED.view.tools.calculateGridSnapOffsets(nn);
|
var gridOffset = RED.view.tools.calculateGridSnapOffsets(nn);
|
||||||
nn.x -= gridOffset.x;
|
nn.x -= gridOffset.x;
|
||||||
|
@ -131,6 +131,7 @@
|
|||||||
width: 120px;
|
width: 120px;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child {
|
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
@ -109,9 +109,10 @@ module.exports = function(RED) {
|
|||||||
if (!property) return;
|
if (!property) return;
|
||||||
|
|
||||||
if (valueType === "jsonata") {
|
if (valueType === "jsonata") {
|
||||||
if (p.exp) {
|
if (p.v) {
|
||||||
try {
|
try {
|
||||||
var val = RED.util.evaluateJSONataExpression(p.exp, msg);
|
var exp = RED.util.prepareJSONataExpression(p.v, node);
|
||||||
|
var val = RED.util.evaluateJSONataExpression(exp, msg);
|
||||||
RED.util.setMessageProperty(msg, property, val, true);
|
RED.util.setMessageProperty(msg, property, val, true);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -237,7 +237,7 @@
|
|||||||
}).text(label).appendTo(encSel);
|
}).text(label).appendTo(encSel);
|
||||||
$("#node-input-filename").typedInput({
|
$("#node-input-filename").typedInput({
|
||||||
default: "msg",
|
default: "msg",
|
||||||
types:[{ value: "str", label:"", icon:"red/images/typedInput/az.svg"}, "msg", "jsonata", "env"],
|
types: ["str", "msg", "jsonata", "env"],
|
||||||
typeField: $("#node-input-filenameType")
|
typeField: $("#node-input-filenameType")
|
||||||
});
|
});
|
||||||
if(typeof node.filenameType == 'undefined') {
|
if(typeof node.filenameType == 'undefined') {
|
||||||
@ -342,7 +342,7 @@
|
|||||||
}).text(label).appendTo(encSel);
|
}).text(label).appendTo(encSel);
|
||||||
$("#node-input-filename").typedInput({
|
$("#node-input-filename").typedInput({
|
||||||
default: "msg",
|
default: "msg",
|
||||||
types:[{ value: "str", label:"", icon:"red/images/typedInput/az.svg"}, "msg", "jsonata", "env"],
|
types: ["str", "msg", "jsonata", "env"],
|
||||||
typeField: $("#node-input-filenameType")
|
typeField: $("#node-input-filenameType")
|
||||||
});
|
});
|
||||||
if(typeof node.filenameType == 'undefined') {
|
if(typeof node.filenameType == 'undefined') {
|
||||||
|
2
packages/node_modules/@node-red/nodes/locales/en-US/messages.json
vendored
Executable file → Normal file
2
packages/node_modules/@node-red/nodes/locales/en-US/messages.json
vendored
Executable file → Normal file
@ -494,7 +494,6 @@
|
|||||||
"invalid-action-alreadyconnected": "Disconnect from broker before connecting",
|
"invalid-action-alreadyconnected": "Disconnect from broker before connecting",
|
||||||
"invalid-action-badsubscription": "msg.topic is missing or invalid",
|
"invalid-action-badsubscription": "msg.topic is missing or invalid",
|
||||||
"invalid-client-id": "Missing Client ID"
|
"invalid-client-id": "Missing Client ID"
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"httpin": {
|
"httpin": {
|
||||||
@ -646,7 +645,6 @@
|
|||||||
"connection-closed": "connection closed from __host__:__port__",
|
"connection-closed": "connection closed from __host__:__port__",
|
||||||
"connections": "__count__ connection",
|
"connections": "__count__ connection",
|
||||||
"connections_plural": "__count__ connections"
|
"connections_plural": "__count__ connections"
|
||||||
|
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"connection-lost": "connection lost to __host__:__port__",
|
"connection-lost": "connection lost to __host__:__port__",
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"httpStatic": "HTTP Static : __path__"
|
"httpStatic": "HTTP Static : __path__"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"server": {
|
"server": {
|
||||||
"loading": "Loading palette nodes",
|
"loading": "Loading palette nodes",
|
||||||
"palette-editor": {
|
"palette-editor": {
|
||||||
@ -61,7 +60,6 @@
|
|||||||
"function-required": "httpsRefreshInterval requires https property to be a function"
|
"function-required": "httpsRefreshInterval requires https property to be a function"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"api": {
|
"api": {
|
||||||
"flows": {
|
"flows": {
|
||||||
"error-save": "Error saving flows: __message__",
|
"error-save": "Error saving flows: __message__",
|
||||||
@ -79,13 +77,11 @@
|
|||||||
"error-enable": "Failed to enable node:"
|
"error-enable": "Failed to enable node:"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"comms": {
|
"comms": {
|
||||||
"error": "Communication channel error: __message__",
|
"error": "Communication channel error: __message__",
|
||||||
"error-server": "Communication server error: __message__",
|
"error-server": "Communication server error: __message__",
|
||||||
"error-send": "Communication send error: __message__"
|
"error-send": "Communication send error: __message__"
|
||||||
},
|
},
|
||||||
|
|
||||||
"settings": {
|
"settings": {
|
||||||
"user-not-available": "Cannot save user settings: __message__",
|
"user-not-available": "Cannot save user settings: __message__",
|
||||||
"not-available": "Settings not available",
|
"not-available": "Settings not available",
|
||||||
@ -150,7 +146,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"storage": {
|
"storage": {
|
||||||
"index": {
|
"index": {
|
||||||
"forbidden-flow-name": "forbidden flow name"
|
"forbidden-flow-name": "forbidden flow name"
|
||||||
@ -180,7 +175,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"context": {
|
"context": {
|
||||||
"log-store-init": "Context store : '__name__' [__info__]",
|
"log-store-init": "Context store : '__name__' [__info__]",
|
||||||
"error-loading-module": "Error loading context store: __message__",
|
"error-loading-module": "Error loading context store: __message__",
|
||||||
@ -195,5 +189,4 @@
|
|||||||
"error-write": "Error writing context: __message__"
|
"error-write": "Error writing context: __message__"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,12 @@ function evaluateNodeProperty(value, type, node, msg, callback) {
|
|||||||
result = Date.now();
|
result = Date.now();
|
||||||
} else if (type === 'bin') {
|
} else if (type === 'bin') {
|
||||||
var data = JSON.parse(value);
|
var data = JSON.parse(value);
|
||||||
|
if (Array.isArray(data) || (typeof(data) === "string")) {
|
||||||
result = Buffer.from(data);
|
result = Buffer.from(data);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw createError("INVALID_BUFFER_DATA", "Not string or array");
|
||||||
|
}
|
||||||
} else if (type === 'msg' && msg) {
|
} else if (type === 'msg' && msg) {
|
||||||
try {
|
try {
|
||||||
result = getMessageProperty(msg,value);
|
result = getMessageProperty(msg,value);
|
||||||
|
@ -906,6 +906,7 @@ describe('inject node', function() {
|
|||||||
msg.should.have.property("str1", "1"); //injected prop
|
msg.should.have.property("str1", "1"); //injected prop
|
||||||
msg.should.have.property("num1", 1); //injected prop
|
msg.should.have.property("num1", 1); //injected prop
|
||||||
msg.should.have.property("bool1", true); //injected prop
|
msg.should.have.property("bool1", true); //injected prop
|
||||||
|
msg.should.have.property("jsonata1", "AB"); //injected prop
|
||||||
|
|
||||||
helper.clearFlows().then(function() {
|
helper.clearFlows().then(function() {
|
||||||
done();
|
done();
|
||||||
@ -919,6 +920,7 @@ describe('inject node', function() {
|
|||||||
{p:"str1", v:"1", vt:"str"}, //new prop
|
{p:"str1", v:"1", vt:"str"}, //new prop
|
||||||
{p:"num1", v:"1", vt:"num"}, //new prop
|
{p:"num1", v:"1", vt:"num"}, //new prop
|
||||||
{p:"bool1", v:"true", vt:"bool"}, //new prop
|
{p:"bool1", v:"true", vt:"bool"}, //new prop
|
||||||
|
{p:"jsonata1", v:'"A" & "B"', vt:"jsonata"}, //new prop
|
||||||
]})
|
]})
|
||||||
.expect(200).end(function(err) {
|
.expect(200).end(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -388,6 +388,19 @@ describe("@node-red/util/util", function() {
|
|||||||
result[0].should.eql(1);
|
result[0].should.eql(1);
|
||||||
result[1].should.eql(2);
|
result[1].should.eql(2);
|
||||||
});
|
});
|
||||||
|
it('throws an error if buffer data is not array or string', function (done) {
|
||||||
|
try {
|
||||||
|
var result = util.evaluateNodeProperty('12','bin');
|
||||||
|
done("should throw an error");
|
||||||
|
} catch (err) {
|
||||||
|
if (err.code === "INVALID_BUFFER_DATA") {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done("should throw an error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
it('returns msg property',function() {
|
it('returns msg property',function() {
|
||||||
var result = util.evaluateNodeProperty('foo.bar','msg',{},{foo:{bar:"123"}});
|
var result = util.evaluateNodeProperty('foo.bar','msg',{},{foo:{bar:"123"}});
|
||||||
result.should.eql("123");
|
result.should.eql("123");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user