mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
12 Commits
fix-auto-c
...
warn-inval
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a40e5dbcd4 | ||
|
|
93c1600980 | ||
|
|
c3d1e6181f | ||
|
|
4115c13a65 | ||
|
|
ce31edc803 | ||
|
|
199caccbc3 | ||
|
|
f060309002 | ||
|
|
fc3d86e6ff | ||
|
|
7507a7b459 | ||
|
|
d657817211 | ||
|
|
954649007c | ||
|
|
7bd7c99dd4 |
@@ -935,11 +935,11 @@
|
||||
"errors": {
|
||||
"invalid-expr": "不正なJSONata式:\n __message__",
|
||||
"invalid-msg": "不正なJSONメッセージ例:\n __message__",
|
||||
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト機能をテストできません",
|
||||
"context-unsupported": "$flowContext や $globalContextの\nコンテキスト関数をテストできません",
|
||||
"env-unsupported": "$env関数はテストできません",
|
||||
"moment-unsupported": "$moment関数はテストできません",
|
||||
"clone-unsupported": "$clone関数はテストできません",
|
||||
"eval": "表現評価エラー:\n __message__"
|
||||
"eval": "式評価エラー:\n __message__"
|
||||
}
|
||||
},
|
||||
"monaco": {
|
||||
|
||||
@@ -451,11 +451,13 @@
|
||||
tabs.activateTab("func-tab-body");
|
||||
|
||||
$( "#node-input-outputs" ).spinner({
|
||||
min:0,
|
||||
min: 0,
|
||||
max: 500,
|
||||
change: function(event, ui) {
|
||||
var value = this.value;
|
||||
if (!value.match(/^\d+$/)) { value = 1; }
|
||||
else if (value < this.min) { value = this.min; }
|
||||
var value = parseInt(this.value);
|
||||
value = isNaN(value) ? 1 : value;
|
||||
value = Math.max(value, parseInt($(this).attr("aria-valuemin")));
|
||||
value = Math.min(value, parseInt($(this).attr("aria-valuemax")));
|
||||
if (value !== this.value) { $(this).spinner("value", value); }
|
||||
}
|
||||
});
|
||||
|
||||
@@ -282,7 +282,7 @@ module.exports = function(RED) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var node = this;
|
||||
this.headers = n.headers||{};
|
||||
this.statusCode = n.statusCode;
|
||||
this.statusCode = parseInt(n.statusCode);
|
||||
this.on("input",function(msg,_send,done) {
|
||||
if (msg.res) {
|
||||
var headers = RED.util.cloneMessage(node.headers);
|
||||
@@ -323,7 +323,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
}
|
||||
var statusCode = node.statusCode || msg.statusCode || 200;
|
||||
var statusCode = node.statusCode || parseInt(msg.statusCode) || 200;
|
||||
if (typeof msg.payload == "object" && !Buffer.isBuffer(msg.payload)) {
|
||||
msg.res._res.status(statusCode).jsonp(msg.payload);
|
||||
} else {
|
||||
|
||||
@@ -52,4 +52,7 @@
|
||||
used to mark the templated sections. For example, to use <code>[[ ]]</code>
|
||||
instead, add the following line to the top of the template:</p>
|
||||
<pre>{{=[[ ]]=}}</pre>
|
||||
<h4>Using environment variables</h4>
|
||||
<p>The template node can access environment variables using the syntax:</p>
|
||||
<pre>My favourite colour is {{env.COLOUR}}.</pre>
|
||||
</script>
|
||||
|
||||
@@ -48,4 +48,7 @@
|
||||
<p><b>注: </b>デフォルトでは、<i>mustache</i>形式は置換対象のHTML要素をエスケープします。これを抑止するには<code>{{{三重}}}</code>括弧形式を使います。</p>
|
||||
<p>もし、コンテンツの中で<code>{{ }}</code>を出力する必要がある場合は、テンプレートで使われる記号文字を変えることもできます。例えば、<code>[[ ]]</code>を代わりに用いるには、テンプレートの先頭に以下の行を追加します。</p>
|
||||
<pre>{{=[[ ]]=}}</pre>
|
||||
<h4>環境変数の利用</h4>
|
||||
<p>templateノードでは、次の構文を用いると環境変数にアクセスできます:</p>
|
||||
<pre>私の好きな色は{{env.COLOUR}}です。</pre>
|
||||
</script>
|
||||
|
||||
@@ -373,6 +373,11 @@ Node.prototype.send = function(msg) {
|
||||
if (msg === null || typeof msg === "undefined") {
|
||||
return;
|
||||
} else if (!util.isArray(msg)) {
|
||||
// A single message has been passed in
|
||||
if (typeof msg !== 'object') {
|
||||
this.error(Log._("nodes.flow.non-message-returned", { type: typeof msg }));
|
||||
return
|
||||
}
|
||||
if (this._wire) {
|
||||
// A single message and a single wire on output 0
|
||||
// TODO: pre-load flows.get calls - cannot do in constructor
|
||||
@@ -425,27 +430,31 @@ Node.prototype.send = function(msg) {
|
||||
for (k = 0; k < msgs.length; k++) {
|
||||
var m = msgs[k];
|
||||
if (m !== null && m !== undefined) {
|
||||
if (!m._msgid) {
|
||||
hasMissingIds = true;
|
||||
if (typeof m !== 'object') {
|
||||
this.error(Log._("nodes.flow.non-message-returned", { type: typeof m }));
|
||||
} else {
|
||||
if (!m._msgid) {
|
||||
hasMissingIds = true;
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
if (!sentMessageId) {
|
||||
sentMessageId = m._msgid;
|
||||
}
|
||||
sendEvents.push({
|
||||
msg: m,
|
||||
source: {
|
||||
id: this.id,
|
||||
node: this,
|
||||
port: i
|
||||
},
|
||||
destination: {
|
||||
id: wires[j],
|
||||
node: undefined
|
||||
},
|
||||
cloneMessage: msgSent
|
||||
});
|
||||
msgSent = true;
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
if (!sentMessageId) {
|
||||
sentMessageId = m._msgid;
|
||||
}
|
||||
sendEvents.push({
|
||||
msg: m,
|
||||
source: {
|
||||
id: this.id,
|
||||
node: this,
|
||||
port: i
|
||||
},
|
||||
destination: {
|
||||
id: wires[j],
|
||||
node: undefined
|
||||
},
|
||||
cloneMessage: msgSent
|
||||
});
|
||||
msgSent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,8 @@
|
||||
"flow": {
|
||||
"unknown-type": "Unknown type: __type__",
|
||||
"missing-types": "missing types",
|
||||
"error-loop": "Message exceeded maximum number of catches"
|
||||
"error-loop": "Message exceeded maximum number of catches",
|
||||
"non-message-returned": "Node tried to send a message of type __type__"
|
||||
},
|
||||
"index": {
|
||||
"unrecognised-id": "Unrecognised id: __id__",
|
||||
|
||||
Reference in New Issue
Block a user