1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add validator for link call node

This commit is contained in:
Kazuhito Yokoi 2023-02-10 18:55:10 +09:00
parent 4fda59a585
commit 81331e68d2
4 changed files with 19 additions and 8 deletions

View File

@ -1,4 +1,3 @@
<script type="text/html" data-template-name="link in">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
@ -272,7 +271,17 @@
color:"#ddd",//"#87D8CF",
defaults: {
name: { value: "" },
links: { value: [], type:"link in[]" },
links: {
value: [],
type: "link in[]",
validate: function (v, opt) {
if ((this.linkType === "static" && v.length > 0)
|| this.linkType === "dynamic") {
return true;
}
return RED._("node-red:link.errors.linkUndefined");
}
},
linkType: { value:"static" },
timeout: {
value: "30",

View File

@ -164,10 +164,10 @@ module.exports = function(RED) {
if (returnNode && returnNode.returnLinkMessage) {
returnNode.returnLinkMessage(messageEvent.id, msg);
} else {
node.warn(RED._("link.error.missingReturn"))
node.warn(RED._("link.errors.missingReturn"));
}
} else {
node.warn(RED._("link.error.missingReturn"))
node.warn(RED._("link.errors.missingReturn"));
}
done();
} else if (mode === "link") {

View File

@ -184,8 +184,9 @@
"staticLinkCall": "Fixed target",
"dynamicLinkCall": "Dynamic target (msg.target)",
"dynamicLinkLabel": "Dynamic",
"error": {
"missingReturn": "Missing return node information"
"errors": {
"missingReturn": "Missing return node information",
"linkUndefined": "link undefined"
}
},
"tls": {

View File

@ -184,8 +184,9 @@
"staticLinkCall": "対象を固定で指定",
"dynamicLinkCall": "対象を動的に指定 (msg.target)",
"dynamicLinkLabel": "動的",
"error": {
"missingReturn": "返却するノードの情報が存在しません"
"errors": {
"missingReturn": "返却するノードの情報が存在しません",
"linkUndefined": "リンクが未定義"
}
},
"tls": {