mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch '0.18' into projects
This commit is contained in:
@@ -64,7 +64,7 @@ function start() {
|
||||
// https://github.com/websockets/ws/pull/632
|
||||
// that is fixed in the 1.x release of the ws module
|
||||
// that we cannot currently pickup as it drops node 0.10 support
|
||||
perMessageDeflate: false
|
||||
//perMessageDeflate: false
|
||||
});
|
||||
|
||||
wsServer.on('connection',function(ws) {
|
||||
@@ -190,15 +190,27 @@ function publish(topic,data,retain) {
|
||||
}
|
||||
}
|
||||
|
||||
var stack = [];
|
||||
var ok2tx = true;
|
||||
function publishTo(ws,topic,data) {
|
||||
var msg = JSON.stringify({topic:topic,data:data});
|
||||
try {
|
||||
ws.send(msg);
|
||||
} catch(err) {
|
||||
removeActiveConnection(ws);
|
||||
removePendingConnection(ws);
|
||||
log.warn(log._("comms.error-send",{message:err.toString()}));
|
||||
if (topic && data) { stack.push({topic:topic,data:data}); }
|
||||
|
||||
if (ok2tx && (stack.length > 0)) {
|
||||
ok2tx = false;
|
||||
try {
|
||||
ws.send(JSON.stringify(stack));
|
||||
} catch(err) {
|
||||
removeActiveConnection(ws);
|
||||
removePendingConnection(ws);
|
||||
log.warn(log._("comms.error-send",{message:err.toString()}));
|
||||
}
|
||||
stack = [];
|
||||
var txtout = setTimeout(function() {
|
||||
ok2tx = true;
|
||||
publishTo(ws);
|
||||
}, 50); // TODO: OK so a 50mS update rate should prob not be hard-coded
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function handleRemoteSubscription(ws,topic) {
|
||||
|
@@ -22,6 +22,7 @@ var library = require("./library");
|
||||
var info = require("./settings");
|
||||
|
||||
var auth = require("../auth");
|
||||
var nodes = require("../admin/nodes"); // TODO: move /icons into here
|
||||
var needsPermission = auth.needsPermission;
|
||||
var runtime;
|
||||
var log;
|
||||
@@ -59,6 +60,8 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
|
||||
|
||||
editorApp.get("/icons",needsPermission("nodes.read"),nodes.getIcons,errorHandler);
|
||||
editorApp.get("/icons/:module/:icon",ui.icon);
|
||||
editorApp.get("/icons/:scope/:module/:icon",ui.icon);
|
||||
|
||||
@@ -75,7 +78,7 @@ module.exports = {
|
||||
// Locales
|
||||
var locales = require("./locales");
|
||||
locales.init(runtime);
|
||||
editorApp.get('/locales/nodes',locales.getAllNodes,apiUtil.errorHandler);
|
||||
editorApp.get('/locales/nodes',locales.getAllNodes,apiUtil..errorHandler);
|
||||
editorApp.get(/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler);
|
||||
|
||||
// Library
|
||||
|
@@ -218,9 +218,10 @@
|
||||
"editConfig": "Edit __type__ config node",
|
||||
"addNewType": "Add new __type__...",
|
||||
"nodeProperties": "node properties",
|
||||
"portLabels": "port labels",
|
||||
"portLabels": "node settings",
|
||||
"labelInputs": "Inputs",
|
||||
"labelOutputs": "Outputs",
|
||||
"settingIcon": "Icon",
|
||||
"noDefaultLabel": "none",
|
||||
"defaultLabel": "use default label",
|
||||
"errors": {
|
||||
@@ -450,8 +451,10 @@
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "Functions",
|
||||
"functionReference": "Function reference",
|
||||
"insert": "Insert",
|
||||
"title": "JSONata Expression editor",
|
||||
"test": "Test",
|
||||
"data": "Example message",
|
||||
"result": "Result",
|
||||
"format": "format expression",
|
||||
|
@@ -95,6 +95,10 @@
|
||||
"args":"",
|
||||
"desc":"Returns a pseudo random number greater than or equal to zero and less than one."
|
||||
},
|
||||
"$millis": {
|
||||
"args":"",
|
||||
"desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "Returns the arithmetic sum of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
||||
@@ -160,6 +164,10 @@
|
||||
"args": "object",
|
||||
"desc": "Splits an object containing key/value pairs into an array of objects, each of which has a single key/value pair from the input object. If the parameter is an array of objects, then the resultant array contains an object for every key/value pair in every object in the supplied array."
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
|
||||
},
|
||||
"$sift": {
|
||||
"args":"object, function",
|
||||
"desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
|
||||
@@ -187,5 +195,26 @@
|
||||
"$globalContext": {
|
||||
"args": "string",
|
||||
"desc": "Retrieves a global context property."
|
||||
},
|
||||
"$pad": {
|
||||
"args": "string, width [, char]",
|
||||
"desc": "Returns a copy of the `string` with extra padding, if necessary, so that its total number of characters is at least the absolute value of the `width` parameter.\n\nIf `width` is a positive number, then the string is padded to the right; if negative, it is padded to the left.\n\nThe optional `char` argument specifies the padding character(s) to use. If not specified, it defaults to the space character."
|
||||
},
|
||||
"$fromMillis": {
|
||||
"args": "number",
|
||||
"desc": "Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format."
|
||||
},
|
||||
"$formatNumber": {
|
||||
"args": "number, picture [, options]",
|
||||
"desc": "Casts the number to a string and formats it to a decimal representation as specified by the picture string.\n\n The behaviour of this function is consistent with the XPath/XQuery function fn:format-number as defined in the XPath F&O 3.1 specification. The picture string parameter defines how the number is formatted and has the same syntax as fn:format-number.\n\nThe optional third argument options is used to override the default locale specific formatting characters such as the decimal separator. If supplied, this argument must be an object containing name/value pairs specified in the decimal format section of the XPath F&O 3.1 specification."
|
||||
},
|
||||
"$formatBase": {
|
||||
"args": "number [, radix]",
|
||||
"desc": "Casts the number to a string and formats it to an integer represented in the number base specified by the radix argument. If radix is not specified, then it defaults to base 10. radix can be between 2 and 36, otherwise an error is thrown."
|
||||
},
|
||||
"$toMillis": {
|
||||
"args": "timestamp",
|
||||
"desc": "Convert a timestamp string in the ISO 8601 format to the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. An error is thrown if the string is not in the correct format."
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -208,9 +208,10 @@
|
||||
"editConfig": "__type__ ノードの設定を編集",
|
||||
"addNewType": "新規に __type__ を追加...",
|
||||
"nodeProperties": "プロパティ",
|
||||
"portLabels": "端子名",
|
||||
"portLabels": "設定",
|
||||
"labelInputs": "入力",
|
||||
"labelOutputs": "出力",
|
||||
"settingIcon": "アイコン",
|
||||
"noDefaultLabel": "なし",
|
||||
"defaultLabel": "既定の名前を使用",
|
||||
"errors": {
|
||||
@@ -422,11 +423,13 @@
|
||||
},
|
||||
"expressionEditor": {
|
||||
"functions": "関数",
|
||||
"functionReference": "関数リファレンス",
|
||||
"insert": "挿入",
|
||||
"title": "JSONata式エディタ",
|
||||
"test": "テスト",
|
||||
"data": "メッセージ例",
|
||||
"result": "結果",
|
||||
"format": "形式",
|
||||
"format": "整形",
|
||||
"compatMode": "互換モードが有効になっています",
|
||||
"compatModeDesc": "<h3>JSONata互換モード</h3><p> 入力された式では <code>msg</code> を参照しているため、互換モードで評価します。このモードは将来廃止予定のため、式で <code>msg</code> を使わないよう修正してください。</p><p> JSONataをNode-REDで最初にサポートした際には、 <code>msg</code> オブジェクトの参照が必要でした。例えば <code>msg.payload</code> がペイロードを参照するために使われていました。</p><p> 直接メッセージに対して式を評価するようになったため、この形式は使えなくなります。ペイロードを参照するには、単に <code>payload</code> にしてください。</p>",
|
||||
"noMatch": "一致した結果なし",
|
||||
|
@@ -95,6 +95,10 @@
|
||||
"args": "",
|
||||
"desc": "0以上、1未満の疑似乱数を返します。"
|
||||
},
|
||||
"$millis": {
|
||||
"args": "",
|
||||
"desc": "Unixエポック(1 January, 1970 UTC)からの経過ミリ秒を数値として返します。評価対象式に含まれる `$millis()` の呼び出しは、全て同じ値を返します。"
|
||||
},
|
||||
"$sum": {
|
||||
"args": "array",
|
||||
"desc": "数値の配列 `array` の合計値を返します。 `array` が数値でない要素を含む場合、エラーになります。"
|
||||
@@ -159,6 +163,10 @@
|
||||
"args": "object",
|
||||
"desc": "key/valueのペアを持つオブジェクトを、各要素が1つのkey/valueのペアを持つオブジェクトの配列に分割します。引数がオブジェクトの配列の場合、結果の配列は各オブジェクトから得た各key/valueのペアのオブジェクトを持ちます。"
|
||||
},
|
||||
"$merge": {
|
||||
"args": "array<object>",
|
||||
"desc": "`object` の配列を1つの `object` へマージします。 マージ結果のオブジェクトは入力配列内の各オブジェクトのkey/valueペアを含みます。入力のオブジェクトが同じキーを持つ場合、戻り値の `object` には配列の最後のオブジェクトのkey/value値が格納されます。入力の配列がオブジェクトでない要素を含む場合、エラーとなります。"
|
||||
},
|
||||
"$sift": {
|
||||
"args": "object, function",
|
||||
"desc": "引数 `object` が持つkey/valueのペアのうち、関数 `function` によってふるい分けたオブジェクトのみを返します。\n\n関数 `function` は、以下の引数を持つ必要があります。\n\n`function(value [, key [, object]])`"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"common": {
|
||||
"label": {
|
||||
"name": "姓名",
|
||||
"ok": "Ok",
|
||||
"ok": "确认",
|
||||
"done": "完成",
|
||||
"cancel": "取消",
|
||||
"delete": "删除",
|
||||
@@ -28,8 +28,8 @@
|
||||
"menu": {
|
||||
"label": {
|
||||
"view": {
|
||||
"view": "表示",
|
||||
"showGrid": "表示网格",
|
||||
"view": "显示",
|
||||
"showGrid": "显示网格",
|
||||
"snapGrid": "对齐网格",
|
||||
"gridSize": "网格尺寸",
|
||||
"textDir": "文本方向",
|
||||
@@ -42,7 +42,7 @@
|
||||
"show": "显示侧边栏"
|
||||
},
|
||||
"userSettings": "设定",
|
||||
"displayStatus": "表示节点状态",
|
||||
"displayStatus": "显示节点状态",
|
||||
"displayConfig": "配置节点设定",
|
||||
"import": "导入",
|
||||
"export": "导出",
|
||||
@@ -256,7 +256,7 @@
|
||||
"social": "社交",
|
||||
"storage": "存储",
|
||||
"analysis": "分析",
|
||||
"advanced": "高级的"
|
||||
"advanced": "高级"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "添加到面板中的节点:",
|
||||
@@ -381,7 +381,7 @@
|
||||
"str": "文字列",
|
||||
"num": "数字",
|
||||
"re": "正则表达式",
|
||||
"bool": "真伪判断",
|
||||
"bool": "布尔",
|
||||
"json": "JSON",
|
||||
"date": "时间戳"
|
||||
}
|
||||
|
Reference in New Issue
Block a user