mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Compare commits
	
		
			41 Commits
		
	
	
		
			3.0.0-beta
			...
			fix-ungrou
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d2fab7fddd | ||
|  | d549a9ad92 | ||
|  | 0385c72a8f | ||
|  | e223b20cbd | ||
|  | a0f7e92e40 | ||
|  | c87ff3ca26 | ||
|  | 82672a825d | ||
|  | 98d524e82d | ||
|  | 3d3090a8f2 | ||
|  | 9ed96de237 | ||
|  | abb81a0bac | ||
|  | 05eb055b8c | ||
|  | e8ddd6d16d | ||
|  | 8706998c8c | ||
|  | 06e0869767 | ||
|  | 7841fc6d3e | ||
|  | 1f7311deeb | ||
|  | 07a9e69e7b | ||
|  | 9bc8adc715 | ||
|  | 7845ebffc5 | ||
|  | b985de6df2 | ||
|  | 11f6491889 | ||
|  | b2ec040a8d | ||
|  | 424a53da4e | ||
|  | 963c289af7 | ||
|  | c5af71e0a2 | ||
|  | 329008bf6d | ||
|  | 531dbc5f83 | ||
|  | 851a925956 | ||
|  | 5d4e01eea6 | ||
|  | 7484dc5b4c | ||
|  | c513cff843 | ||
|  | bc5eafce66 | ||
|  | 5fb811eb4c | ||
|  | 84a3884ffc | ||
|  | 50ae29a08c | ||
|  | bf8bfa582a | ||
|  | 492d1ef30e | ||
|  | bd19c203e1 | ||
|  | 7955a17a17 | ||
|  | 58085e39d1 | 
| @@ -302,9 +302,9 @@ | ||||
|         "successfulRestart": "フローの再起動が成功しました", | ||||
|         "deployFailed": "デプロイが失敗しました: __message__", | ||||
|         "unusedConfigNodes": "使われていない設定ノードがあります。", | ||||
|         "unusedConfigNodesButton":"未使用の構成ノードを検索", | ||||
|         "unknownNodesButton":"不明なノードを検索する", | ||||
|         "invalidNodesButton":"無効なノードを検索する", | ||||
|         "unusedConfigNodesButton": "未使用の構成ノードを検索", | ||||
|         "unknownNodesButton": "不明なノードを検索する", | ||||
|         "invalidNodesButton": "無効なノードを検索する", | ||||
|         "errors": { | ||||
|             "noResponse": "サーバの応答がありません" | ||||
|         }, | ||||
| @@ -1159,6 +1159,9 @@ | ||||
|         "start": "開始", | ||||
|         "next": "次へ" | ||||
|     }, | ||||
|     "diagnostics": { | ||||
|         "title": "システム情報" | ||||
|     }, | ||||
|     "languages": { | ||||
|         "de": "ドイツ語", | ||||
|         "en-US": "英語", | ||||
| @@ -1168,6 +1171,22 @@ | ||||
|         "zh-CN": "中国語(簡体)", | ||||
|         "zh-TW": "中国語(繁体)" | ||||
|     }, | ||||
|     "validator": { | ||||
|         "errors": { | ||||
|             "invalid-json": "JSONデータが不正: __error__", | ||||
|             "invalid-json-prop": "__prop__: JSONデータが不正: __error__", | ||||
|             "invalid-prop": "プロパティ式が不正", | ||||
|             "invalid-prop-prop": "__prop__: プロパティ式が不正", | ||||
|             "invalid-num": "数値が不正", | ||||
|             "invalid-num-prop": "__prop__: 数値が不正", | ||||
|             "invalid-regexp": "入力パターンが不正", | ||||
|             "invalid-regex-prop": "__prop__: 入力パターンが不正", | ||||
|             "missing-required-prop": "__prop__: プロパティが未設定", | ||||
|             "invalid-config": "__prop__: 設定ノードが不正", | ||||
|             "missing-config": "__prop__: 設定ノードが存在しません", | ||||
|             "validation-error": "__prop__: チェックエラー: __node__, __id__: __error__" | ||||
|         } | ||||
|     }, | ||||
|     "action-list": { | ||||
|         "toggle-show-tips": "ヒント表示切替", | ||||
|         "show-about": "Node-REDの説明を表示", | ||||
| @@ -1305,21 +1324,5 @@ | ||||
|         "zoom-reset": "ズームリセット", | ||||
|         "toggle-navigator": "ナビゲータ表示切替", | ||||
|         "show-system-info": "システムインフォメーション" | ||||
|     }, | ||||
|     "validator": { | ||||
|         "errors": { | ||||
|             "invalid-json": "JSONデータが不正: __error__", | ||||
|             "invalid-json-prop": "__prop__: JSONデータが不正: __error__", | ||||
|             "invalid-prop": "プロパティ式が不正", | ||||
|             "invalid-prop-prop": "__prop__: プロパティ式が不正", | ||||
|             "invalid-num": "数値が不正", | ||||
|             "invalid-num-prop": "__prop__: 数値が不正", | ||||
|             "invalid-regexp": "入力パターンが不正", | ||||
|             "invalid-regex-prop": "__prop__: 入力パターンが不正", | ||||
|             "missing-required-prop": "__prop__: プロパティが未設定", | ||||
|             "invalid-config": "__prop__: 設定ノードが不正", | ||||
|             "missing-config": "__prop__: 設定ノードが存在しません", | ||||
|             "validation-error": "__prop__: チェックエラー: __node__, __id__: __error__" | ||||
| 	      } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2462,6 +2462,8 @@ RED.nodes = (function() { | ||||
|         workspacesOrder = []; | ||||
|         groups = {}; | ||||
|         groupsByZ = {}; | ||||
|         junctions = {}; | ||||
|         junctionsByZ = {}; | ||||
|  | ||||
|         var subflowIds = Object.keys(subflows); | ||||
|         subflowIds.forEach(function(id) { | ||||
|   | ||||
| @@ -1026,10 +1026,7 @@ | ||||
|                             $(opt.icon).prependTo(this.selectLabel); | ||||
|                         } | ||||
|                         else if (opt.icon.indexOf("/") !== -1) { | ||||
|                             image = new Image(); | ||||
|                             image.name = opt.icon; | ||||
|                             image.src = mapDeprecatedIcon(opt.icon); | ||||
|                             $('<img>',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); | ||||
|                             $('<i>',{class:"red-ui-typedInput-icon", style:"mask-image: url("+opt.icon+"); -webkit-mask-image: url("+opt.icon+"); margin-right: 4px;height: 18px;width:13px"}).prependTo(this.selectLabel); | ||||
|                         } | ||||
|                         else { | ||||
|                             $('<i>',{class:"red-ui-typedInput-icon "+opt.icon,style:"min-width: 13px; margin-right: 4px;"}).prependTo(this.selectLabel); | ||||
|   | ||||
| @@ -311,8 +311,8 @@ | ||||
|                 types:[ | ||||
|                     'str','num','bool', | ||||
|                     {value:"null",label:RED._("common.type.null"),hasValue:false}, | ||||
|                     {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"}, | ||||
|                     {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"} | ||||
|                     {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"}, | ||||
|                     {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"} | ||||
|                 ], | ||||
|                 default: valType | ||||
|             }); | ||||
|   | ||||
| @@ -19,7 +19,6 @@ | ||||
|                 this.tabflowEditor = RED.editor.createEditor({ | ||||
|                     id: 'node-input-info', | ||||
|                     mode: 'ace/mode/markdown', | ||||
|                     stateId: options.stateId, | ||||
|                     value: "" | ||||
|                 }); | ||||
|  | ||||
|   | ||||
| @@ -323,9 +323,6 @@ RED.group = (function() { | ||||
|                 groups: [ ], | ||||
|                 dirty: RED.nodes.dirty() | ||||
|             } | ||||
|             RED.history.push(historyEvent); | ||||
|  | ||||
|  | ||||
|             groups.forEach(function(g) { | ||||
|                 newSelection = newSelection.concat(ungroup(g)) | ||||
|                 historyEvent.groups.push(g); | ||||
|   | ||||
| @@ -144,7 +144,7 @@ RED.search = (function() { | ||||
|                 var key = keys[i]; | ||||
|                 var kpos = keys[i].indexOf(val); | ||||
|                 if (kpos > -1) { | ||||
|                     var ids = Object.keys(index[key]); | ||||
|                     var ids = Object.keys(index[key]||{}); | ||||
|                     for (j=0;j<ids.length;j++) { | ||||
|                         var node = index[key][ids[j]]; | ||||
|                         var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group'; | ||||
| @@ -255,7 +255,7 @@ RED.search = (function() { | ||||
|                 } | ||||
|                 currentResults = search(value); | ||||
|                 if (currentResults.length > 0) { | ||||
|                     for (i=0;i<Math.min(currentResults.length,25);i++) { | ||||
|                     for (let i=0;i<Math.min(currentResults.length,25);i++) { | ||||
|                         searchResults.editableList('addItem',currentResults[i]) | ||||
|                     } | ||||
|                     if (currentResults.length > 25) { | ||||
|   | ||||
| @@ -2918,7 +2918,7 @@ RED.view = (function() { | ||||
|                     } else if (drag_line.portType === PORT_TYPE_INPUT) { | ||||
|                         src = mouseup_node; | ||||
|                         dst = drag_line.node; | ||||
|                         src_port = portIndex; | ||||
|                         src_port = portIndex || 0; | ||||
|                     } | ||||
|                     var link = {source: src, sourcePort:src_port, target: dst}; | ||||
|                     if (drag_line.virtualLink) { | ||||
|   | ||||
| @@ -153,6 +153,16 @@ button.red-ui-typedInput-option-trigger | ||||
|         img { | ||||
|             max-width: none; | ||||
|         } | ||||
|         .red-ui-typedInput-icon:not(.fa) { | ||||
|             display: inline-block; | ||||
|             -webkit-mask-size: cover; | ||||
|             mask-size: cover; | ||||
|             -webkit-mask-position: center; | ||||
|             mask-position: center; | ||||
|             -webkit-mask-repeat: no-repeat; | ||||
|             mask-repeat: no-repeat; | ||||
|             background-color: $primary-text-color; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     &:not(.disabled):hover { | ||||
|   | ||||
| @@ -5,17 +5,17 @@ export default { | ||||
|             titleIcon: "fa fa-map-o", | ||||
|             title: { | ||||
|                 "en-US": "Welcome to Node-RED 3.0 Beta 1!", | ||||
|                 "ja": "Node-RED 3.0 Beta 1へようこそ!" | ||||
|                 "ja": "Node-RED 3.0 ベータ1へようこそ!" | ||||
|             }, | ||||
|             description: { | ||||
|                 "en-US": "<p>This is the first Beta release of Node-RED 3.0. It contains just about everything we have planned for the final release.</p><p>Let's take a moment to discover the new features in this release.</p>", | ||||
|                 "ja": "本リリースの新機能を見つけてみましょう。" | ||||
|                 "ja": "<p>これはNode-RED 3.0の最初のベータリリースです。これには、最終リリースで計画しているほぼ全ての機能が含まれています。</p><p>本リリースの新機能を見つけてみましょう。</p>" | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
|             title: { | ||||
|                 "en-US": "Wire Junctions", | ||||
|                 // "ja": "" | ||||
|                 "ja": "分岐点をワイヤーに追加" | ||||
|             }, | ||||
|             image: 'images/junction-slice.gif', | ||||
|             description: { | ||||
| @@ -23,26 +23,28 @@ export default { | ||||
|                              add junction nodes that give you more control.</p> | ||||
|                           <p>Junctions can be added to wires by holding the Shift key, then click and drag with | ||||
|                           the right-hand mouse button across the wires.</p>`, | ||||
|                 // "ja": "" | ||||
|                 "ja": `<p>フローのワイヤーの経路をより制御しやすくするために、分岐点ノードを追加できるようになりました。</p> | ||||
|                        <p>シフトキーを押しながら、マウスの右ボタンをクリックし、ワイヤーを横切るようにドラッグすることで、分岐点を追加できます。</p>` | ||||
|             }, | ||||
|         }, | ||||
|         { | ||||
|             title: { | ||||
|                 "en-US": "Wire Junctions", | ||||
|                 // "ja": "" | ||||
|                 "ja": "分岐点をワイヤーに追加" | ||||
|             }, | ||||
|             image: 'images/junction-quick-add.png', | ||||
|             description: { | ||||
|                 "en-US": `<p>Junctions can also be added using the quick-add dialog.</p> | ||||
|                           <p>The dialog is opened by holding the Ctrl (or Cmd) key when | ||||
|                              clicking in the workspace.</p>`, | ||||
|                 // "ja": "" | ||||
|                 "ja": `<p>クイック追加ダイアログを用いて、分岐点を追加することもできます。</p> | ||||
|                        <p>本ダイアログを開くには、Ctrl(またはCmd)キーを押しながら、ワークスペース上でクリックします。</p>` | ||||
|             }, | ||||
|         }, | ||||
|         { | ||||
|             title: { | ||||
|                 "en-US": "Debug Path Tooltip", | ||||
|                 // "ja": "" | ||||
|                 "ja": "デバッグパスのツールチップ" | ||||
|             }, | ||||
|             image: 'images/debug-path-tooltip.png', | ||||
|             description: { | ||||
| @@ -53,20 +55,22 @@ export default { | ||||
|                              the message.</p> | ||||
|                           <p>Clicking on any item in the list will reveal it in | ||||
|                              the workspace.</p>`, | ||||
|                 // "ja": "" | ||||
|                 "ja": `<p>デバックサイドバー内のノード名の上にマウスカーソルを乗せると、新たにツールチップが表示され、ノードの場所が分かるようになっています。</p> | ||||
|                        <p>これは、サブフローを用いる時に役立つ機能であり、メッセージがどのノードから出力されたかを正確に特定することが遥かに簡単になります。</p> | ||||
|                        <p>本リスト内の要素をクリックすると、ワークスペース内にその要素が表示されます。</p>` | ||||
|             }, | ||||
|         }, | ||||
|         { | ||||
|             title: { | ||||
|                 "en-US": "Continuous Search", | ||||
|                 // "ja": "" | ||||
|                 "ja": "連続した検索" | ||||
|             }, | ||||
|             image: 'images/continuous-search.png', | ||||
|             description: { | ||||
|                 "en-US": `<p>When searching for things in the editor, a new toolbar in | ||||
|                              the workspace provides options to quickly jump between | ||||
|                              the search results.</p>`, | ||||
|                 // "ja": "" | ||||
|                 "ja": `<p>ワークスペース内の新しいツールバーにあるオプションによって、エディタ内を検索する際に、検索結果の間を素早く移動できます。</p>` | ||||
|             }, | ||||
|         }, | ||||
|         { | ||||
| @@ -81,13 +85,17 @@ export default { | ||||
|                           <li><b><code>Split Wire With Link Nodes</code></b></li> | ||||
|                           </ul> | ||||
|                           <p>Actions can be accessed from the Action List in the main menu.</p>`, | ||||
|                 // "ja": `` | ||||
|                 "ja": `<p>ワイヤーを、接続されたLinkノードのペアに置き換える動作が新たに追加されました:</p> | ||||
|                        <ul> | ||||
|                        <li><b><code>ワイヤーをlinkノードで分割</code></b></li> | ||||
|                        </ul> | ||||
|                        <p>本アクションは、メインメニュー内の動作一覧から呼び出せます。</p>`, | ||||
|             }, | ||||
|         }, | ||||
|         { | ||||
|             title: { | ||||
|                 "en-US": "Default node names", | ||||
|                 // "ja": "" | ||||
|                 "ja": "標準ノードの名前" | ||||
|             }, | ||||
|             // image: "images/", | ||||
|             description: { | ||||
| @@ -100,7 +108,12 @@ export default { | ||||
|                              <li><b><code>Generate Node Names</code></b></li> | ||||
|                              </ul><p>Actions can be accessed from the Action List in the main menu.</p> | ||||
|                             `, | ||||
|                 // "ja": `` | ||||
|                 "ja": `<p>一部のノードは、ワークスペース上に新インスタンスとして追加した際に、一意の名前を付けるよう変更されました。この変更は、<code>Debug</code>、<code>Function</code>、<code>Link</code>ノードに適用されています。</p> | ||||
|                        <p>選択したノードに対して、標準の名前を生成する動作も新たに追加されました:</p> | ||||
|                           <ul> | ||||
|                           <li><b><code>ノード名を生成</code></b></li> | ||||
|                           </ul><p>本アクションは、メインメニュー内の動作一覧から呼び出せます。</p> | ||||
|                          ` | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
| @@ -115,7 +128,11 @@ export default { | ||||
|                             <li>The Link Call node can use a message property to dynamically target the link it should call</li> | ||||
|                             <li>The HTTP Request node can be preconfigured with HTTP headers</li> | ||||
|                           </ul>`, | ||||
|                 // "ja": `` | ||||
|                 "ja": `<ul> | ||||
|                          <li>Debugノードは、受信したメッセージの数をカウントするよう設定できるようになりました。</li> | ||||
|                          <li>Link Callノードは、メッセージのプロパティによって、呼び出し対象のlinkを動的に指定できるようになりました。</li> | ||||
|                          <li>HTTP Requestノードは、HTTPヘッダを事前設定できるようになりました。</li> | ||||
|                        </ul>` | ||||
|             } | ||||
|         } | ||||
|     ] | ||||
|   | ||||
| @@ -69,7 +69,7 @@ | ||||
|         outputs:1,              // set the number of outputs - 0 to n | ||||
|         color: "#ddd",          // set icon color | ||||
|         // set the icon (held in icons dir below where you save the node) | ||||
|         icon: "myicon.png",     // saved in  icons/myicon.png | ||||
|         icon: "myicon.svg",     // saved in  icons/myicon.svg | ||||
|         label: function() {     // sets the default label contents | ||||
|             return this.name||this.topic||"sample"; | ||||
|         }, | ||||
|   | ||||
| @@ -146,13 +146,13 @@ | ||||
|  | ||||
|     function createTypeValueField(row, defaultType){ | ||||
|         return $('<input/>',{class:"node-input-rule-type-value",type:"text",style:"width: 100%;"}).appendTo(row).typedInput({default:defaultType || 'string',types:[ | ||||
|             {value:"string",label:RED._("common.type.string"),hasValue:false,icon:"red/images/typedInput/az.png"}, | ||||
|             {value:"number",label:RED._("common.type.number"),hasValue:false,icon:"red/images/typedInput/09.png"}, | ||||
|             {value:"boolean",label:RED._("common.type.boolean"),hasValue:false,icon:"red/images/typedInput/bool.png"}, | ||||
|             {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"}, | ||||
|             {value:"buffer",label:RED._("common.type.buffer"),hasValue:false,icon:"red/images/typedInput/bin.png"}, | ||||
|             {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}, | ||||
|             {value:"json",label:RED._("common.type.jsonString"),hasValue:false,icon:"red/images/typedInput/json.png"}, | ||||
|             {value:"string",label:RED._("common.type.string"),hasValue:false,icon:"red/images/typedInput/az.svg"}, | ||||
|             {value:"number",label:RED._("common.type.number"),hasValue:false,icon:"red/images/typedInput/09.svg"}, | ||||
|             {value:"boolean",label:RED._("common.type.boolean"),hasValue:false,icon:"red/images/typedInput/bool.svg"}, | ||||
|             {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"}, | ||||
|             {value:"buffer",label:RED._("common.type.buffer"),hasValue:false,icon:"red/images/typedInput/bin.svg"}, | ||||
|             {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"}, | ||||
|             {value:"json",label:RED._("common.type.jsonString"),hasValue:false,icon:"red/images/typedInput/json.svg"}, | ||||
|             {value:"undefined",label:RED._("common.type.undefined"),hasValue:false}, | ||||
|             {value:"null",label:RED._("common.type.null"),hasValue:false} | ||||
|         ]}); | ||||
| @@ -247,14 +247,16 @@ | ||||
|                     var row2 = $('<div/>',{style:"display: flex; padding-top: 5px; padding-left: 175px;"}).appendTo(inputRows); | ||||
|                     var row3 = $('<div/>',{style:"display: flex; padding-top: 5px; align-items: center"}).appendTo(inputRows); | ||||
|  | ||||
|                     var row4 = $('<div/>',{style:"visibility: hidden; height: 0px;"}).appendTo(inputRows); | ||||
|                     var textSpan = $("<span/>").appendTo(row4); | ||||
|                     var selectField = $('<select/>',{style:"width:120px; text-align: center;"}).appendTo(row); | ||||
|                     var group0 = $('<optgroup/>', { label: "value rules" }).appendTo(selectField); | ||||
|                     var group0 = $('<optgroup/>', { label: RED._("node-red:switch.label.value-rules") }).appendTo(selectField); | ||||
|                     for (var d in operators) { | ||||
|                         if(operators[d].kind === 'V') { | ||||
|                             group0.append($("<option></option>").val(operators[d].v).text(/^switch/.test(operators[d].t)?node._(operators[d].t):operators[d].t)); | ||||
|                         } | ||||
|                     } | ||||
|                     var group1 = $('<optgroup/>', { label: "sequence rules" }).appendTo(selectField); | ||||
|                     var group1 = $('<optgroup/>', { label: RED._("node-red:switch.label.sequence-rules") }).appendTo(selectField); | ||||
|                     for (var d in operators) { | ||||
|                         if(operators[d].kind === 'S') { | ||||
|                             group1.append($("<option></option>").val(operators[d].v).text(/^switch/.test(operators[d].t)?node._(operators[d].t):operators[d].t)); | ||||
| @@ -340,9 +342,12 @@ | ||||
|                             row3.hide(); | ||||
|                         } | ||||
|                         var selectedLabel = selectField.find("option:selected").text(); | ||||
|                         if (selectedLabel.length <= 5) { | ||||
|  | ||||
|                         textSpan.text(selectedLabel); | ||||
|                         var width = textSpan.width(); | ||||
|                         if (width <= 30) { | ||||
|                             selectField.outerWidth(60); | ||||
|                         } else if (selectedLabel.length < 12) { | ||||
|                         } else if (width <= 85) { | ||||
|                             selectField.outerWidth(120); | ||||
|                         } else { | ||||
|                             selectField.width("auto") | ||||
|   | ||||
| @@ -453,6 +453,7 @@ module.exports = function(RED) { | ||||
|         node.options = {}; | ||||
|         node.queue = []; | ||||
|         node.subscriptions = {}; | ||||
|         node.clientListeners = [] | ||||
|         /** @type {mqtt.MqttClient}*/ this.client; | ||||
|         node.setOptions = function(opts, init) { | ||||
|             if(!opts || typeof opts !== "object") { | ||||
| @@ -718,11 +719,16 @@ module.exports = function(RED) { | ||||
|                 setStatusConnecting(node, true); | ||||
|                 try { | ||||
|                     node.serverProperties = {}; | ||||
|                     if(node.client) { | ||||
|                         //belt and braces to avoid left over clients | ||||
|                         node.client.end(true); | ||||
|                         node._clientRemoveListeners(); | ||||
|                     } | ||||
|                     node.client = mqtt.connect(node.brokerurl, node.options); | ||||
|                     node.client.setMaxListeners(0); | ||||
|                     let callbackDone = false; //prevent re-connects causing node.client.on('connect' firing callback multiple times | ||||
|                     let callbackDone = false; //prevent re-connects causing node._clientOn('connect' firing callback multiple times | ||||
|                     // Register successful connect or reconnect handler | ||||
|                     node.client.on('connect', function (connack) { | ||||
|                     node._clientOn('connect', function (connack) { | ||||
|                         node.closing = false; | ||||
|                         node.connecting = false; | ||||
|                         node.connected = true; | ||||
| @@ -754,7 +760,7 @@ module.exports = function(RED) { | ||||
|                         } | ||||
|                         setStatusConnected(node, true); | ||||
|                         // Remove any existing listeners before resubscribing to avoid duplicates in the event of a re-connection | ||||
|                         node.client.removeAllListeners('message'); | ||||
|                         node._clientRemoveListeners('message'); | ||||
|  | ||||
|                         // Re-subscribe to stored topics | ||||
|                         for (var s in node.subscriptions) { | ||||
| @@ -766,7 +772,7 @@ module.exports = function(RED) { | ||||
|                                     if (node.subscriptions[s].hasOwnProperty(r)) { | ||||
|                                         qos = Math.max(qos,node.subscriptions[s][r].qos); | ||||
|                                         _options = node.subscriptions[s][r].options; | ||||
|                                         node.client.on('message',node.subscriptions[s][r].handler); | ||||
|                                         node._clientOn('message',node.subscriptions[s][r].handler); | ||||
|                                     } | ||||
|                                 } | ||||
|                                 _options.qos = _options.qos || qos; | ||||
| @@ -779,11 +785,11 @@ module.exports = function(RED) { | ||||
|                             node.publish(node.birthMessage); | ||||
|                         } | ||||
|                     }); | ||||
|                     node.client.on("reconnect", function() { | ||||
|                     node._clientOn("reconnect", function() { | ||||
|                         setStatusConnecting(node, true); | ||||
|                     }); | ||||
|                     //Broker Disconnect - V5 event | ||||
|                     node.client.on("disconnect", function(packet) { | ||||
|                     node._clientOn("disconnect", function(packet) { | ||||
|                         //Emitted after receiving disconnect packet from broker. MQTT 5.0 feature. | ||||
|                         const rc = (packet && packet.properties && packet.reasonCode) || packet.reasonCode; | ||||
|                         const rs = packet && packet.properties && packet.properties.reasonString || ""; | ||||
| @@ -797,7 +803,7 @@ module.exports = function(RED) { | ||||
|                         setStatusDisconnected(node, true); | ||||
|                     }); | ||||
|                     // Register disconnect handlers | ||||
|                     node.client.on('close', function () { | ||||
|                     node._clientOn('close', function () { | ||||
|                         if (node.connected) { | ||||
|                             node.connected = false; | ||||
|                             node.log(RED._("mqtt.state.disconnected",{broker:(node.clientid?node.clientid+"@":"")+node.brokerurl})); | ||||
| @@ -809,7 +815,7 @@ module.exports = function(RED) { | ||||
|  | ||||
|                     // Register connect error handler | ||||
|                     // The client's own reconnect logic will take care of errors | ||||
|                     node.client.on('error', function (error) { | ||||
|                     node._clientOn('error', function (error) { | ||||
|                     }); | ||||
|                 }catch(err) { | ||||
|                     console.log(err); | ||||
| @@ -822,7 +828,7 @@ module.exports = function(RED) { | ||||
|                 if(node.connected || node.connecting) { | ||||
|                     setStatusDisconnected(node, true); | ||||
|                 } | ||||
|                 if(node.client) { node.client.removeAllListeners(); } | ||||
|                 if(node.client) { node._clientRemoveListeners(); } | ||||
|                 node.connecting = false; | ||||
|                 node.connected = false; | ||||
|                 callback && typeof callback == "function" && callback(); | ||||
| @@ -836,7 +842,11 @@ module.exports = function(RED) { | ||||
|                     if(!client) {  | ||||
|                         resolve(); | ||||
|                      } else { | ||||
|                          const t = setTimeout(reject, ms); | ||||
|                         const t = setTimeout(() => { | ||||
|                             //clean end() has exceeded WAIT_END, lets force end! | ||||
|                             client && client.end(true); | ||||
|                             reject(); | ||||
|                         }, ms); | ||||
|                         client.end(() => { | ||||
|                              clearTimeout(t); | ||||
|                              resolve() | ||||
| @@ -894,7 +904,7 @@ module.exports = function(RED) { | ||||
|             }; | ||||
|             node.subscriptions[topic][ref] = sub; | ||||
|             if (node.connected) { | ||||
|                 node.client.on('message',sub.handler); | ||||
|                 node._clientOn('message',sub.handler); | ||||
|                 node.client.subscribe(topic, options); | ||||
|             } | ||||
|         }; | ||||
| @@ -905,7 +915,7 @@ module.exports = function(RED) { | ||||
|             if (sub) { | ||||
|                 if (sub[ref]) { | ||||
|                     if(node.client) { | ||||
|                         node.client.removeListener('message',sub[ref].handler); | ||||
|                         node._clientRemoveListeners('message',sub[ref].handler); | ||||
|                     } | ||||
|                     delete sub[ref]; | ||||
|                 } | ||||
| @@ -995,13 +1005,40 @@ module.exports = function(RED) { | ||||
|  | ||||
|         node.on('close', function(done) { | ||||
|             node.disconnect(function() { | ||||
|                 if(node.client) { | ||||
|                     node.client.removeAllListeners(); | ||||
|                 } | ||||
|                 done(); | ||||
|             }); | ||||
|         }); | ||||
|  | ||||
|         /** | ||||
|          * Add event handlers to the MQTT.js client and track them so that | ||||
|          * we do not remove any handlers that the MQTT client uses internally.   | ||||
|          * Use {@link node._clientRemoveListeners `node._clientRemoveListeners`} to remove handlers | ||||
|          * @param {string} event The name of the event | ||||
|          * @param {function} handler The handler for this event | ||||
|          */ | ||||
|          node._clientOn = function(event, handler) { | ||||
|             node.clientListeners.push({event, handler}) | ||||
|             node.client.on(event, handler) | ||||
|         }  | ||||
|  | ||||
|         /** | ||||
|          * Remove event handlers from the MQTT.js client & only the events  | ||||
|          * that we attached in {@link node._clientOn `node._clientOn`}.   | ||||
|          * * If `event` is omitted, then all events matching `handler` are removed | ||||
|          * * If `handler` is omitted, then all events named `event` are removed | ||||
|          * * If both parameters are omitted, then all events are removed | ||||
|          * @param {string} [event] The name of the event (optional) | ||||
|          * @param {function} [handler] The handler for this event (optional) | ||||
|          */ | ||||
|          node._clientRemoveListeners = function(event, handler) { | ||||
|             node.clientListeners = node.clientListeners.filter((l) => { | ||||
|                 if (event && event !== l.event) { return true; } | ||||
|                 if (handler && handler !== l.handler) { return true; } | ||||
|                 node.client.removeListener(l.event, l.handler) | ||||
|                 return false; //found and removed, filter out this one | ||||
|             }) | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     RED.nodes.registerType("mqtt-broker",MQTTBrokerNode,{ | ||||
|   | ||||
| @@ -129,7 +129,7 @@ | ||||
|     var headerTypes = [ | ||||
|         {value:"content-type",label:"Content-Type",hasValue: false}, | ||||
|         {value:"location",label:"Location",hasValue: false}, | ||||
|         {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.png"} | ||||
|         {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.svg"} | ||||
|        ] | ||||
|     var contentTypes = [ | ||||
|         {value:"application/json",label:"application/json",hasValue: false}, | ||||
| @@ -139,7 +139,7 @@ | ||||
|         {value:"text/plain",label:"text/plain",hasValue: false}, | ||||
|         {value:"image/gif",label:"image/gif",hasValue: false}, | ||||
|         {value:"image/png",label:"image/png",hasValue: false}, | ||||
|         {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.png"} | ||||
|         {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.svg"} | ||||
|     ]; | ||||
|  | ||||
|     RED.nodes.registerType('http response',{ | ||||
| @@ -180,7 +180,7 @@ | ||||
|                     var propertyValue = $('<input/>',{class:"node-input-header-value",type:"text",style:"width: 100%"}) | ||||
|                         .appendTo(propertyValueCell) | ||||
|                         .typedInput({types: | ||||
|                             header.h === 'content-type'?contentTypes:[{value:"other",label:"other",icon:"red/images/typedInput/az.png"}] | ||||
|                             header.h === 'content-type'?contentTypes:[{value:"other",label:"other",icon:"red/images/typedInput/az.svg"}] | ||||
|                         }); | ||||
|  | ||||
|                     var matchedType = headerTypes.filter(function(ht) { | ||||
| @@ -223,7 +223,7 @@ | ||||
|                         if (type === 'content-type') { | ||||
|                             propertyValue.typedInput('types',contentTypes); | ||||
|                         } else { | ||||
|                             propertyValue.typedInput('types',[{value:"other",label:"other",icon:"red/images/typedInput/az.png"}]); | ||||
|                             propertyValue.typedInput('types',[{value:"other",label:"other",icon:"red/images/typedInput/az.svg"}]); | ||||
|                         } | ||||
|                     }); | ||||
|                 }, | ||||
|   | ||||
| @@ -127,12 +127,14 @@ | ||||
|         { value: "Cache-Control", label: "Cache-Control", hasValue: false }, | ||||
|         { value: "User-Agent", label: "User-Agent", hasValue: false }, | ||||
|         { value: "Location", label: "Location", hasValue: false }, | ||||
|         { value: "other", label: "other", hasValue: true, icon: "red/images/typedInput/az.png" }, | ||||
|         { value: "other", label: RED._("node-red:httpin.label.other"), | ||||
|           hasValue: true, icon: "red/images/typedInput/az.svg" }, | ||||
|         { value: "msg", label: "msg.", hasValue: true }, | ||||
|     ] | ||||
|     const headerOptions = {}; | ||||
|     const defaultOptions = [ | ||||
|         { value: "other", label: "other", hasValue: true, icon: "red/images/typedInput/az.png" }, | ||||
|         { value: "other", label: RED._("node-red:httpin.label.other"), | ||||
|           hasValue: true, icon: "red/images/typedInput/az.svg" }, | ||||
|         { value: "msg", label: "msg.", hasValue: true }, | ||||
|     ]; | ||||
|     headerOptions["accept"] = [ | ||||
|   | ||||
| @@ -247,7 +247,7 @@ | ||||
|                     var jsonata_or_empty = { | ||||
|                         value: "jsonata", | ||||
|                         label: "expression", | ||||
|                         icon: "red/images/typedInput/expr.png", | ||||
|                         icon: "red/images/typedInput/expr.svg", | ||||
|                         validate: function(v) { | ||||
|                             try{ | ||||
|                                 if(v !== "") { | ||||
|   | ||||
| @@ -54,9 +54,10 @@ | ||||
|     <p>If no response is received within the configured timeout, default 30 seconds, the node | ||||
|        will log an error that can be caught using the <code>catch</code> node.</p> | ||||
|     <p>When the option <b>Link Type</b> is set to "Dynamic target" <code>msg.target</code> can be used to call a | ||||
|        <code>link in</code> by name. The target <code>link in</code> node must be named. | ||||
|        <code>link in</code> by name or id.  | ||||
|     <ul> | ||||
|       <li>If there are 2 <code>link in</code> nodes with the same name, an error will be raised</li> | ||||
|       <li>If there is a <code>link in</code> nodes with the same id, it will be called</li> | ||||
|       <li>If there are two or more <code>link in</code> nodes with the same name, an error will be raised</li> | ||||
|       <li>A <code>link call</code> cannot call a <code>link in</code> node inside a subflow</li> | ||||
|     </ul> | ||||
|     </p> | ||||
|   | ||||
| @@ -729,7 +729,9 @@ | ||||
|         "label": { | ||||
|             "property": "Property", | ||||
|             "rule": "rule", | ||||
|             "repair": "recreate message sequences" | ||||
|             "repair": "recreate message sequences", | ||||
| 	    "value-rules": "value rules", | ||||
| 	    "sequence-rules": "sequence rules" | ||||
|         }, | ||||
|         "previous": "previous value", | ||||
|         "and": "and", | ||||
|   | ||||
| @@ -42,9 +42,10 @@ | ||||
|     <p>本ノードはメッセージを受信すると、メッセージを接続した <code>link in</code> ノードへ渡します。 | ||||
|        その後、応答を待った後にメッセージを送信します。</o> | ||||
|     <p>もし、設定したタイムアウト(デフォルト30秒)以内に応答がない場合は、<code>catch</code> ノードを用いてエラーをログに記録することもできます。</p> | ||||
|     <p><b>リンクの種類</b>で"対象を動的に指定"を選択した場合、<code>link in</code>ノードの名前を<code>msg.target</code>に指定して呼び出すことができます。対象となる<code>link in</code>ノードには、名前を付ける必要があります。 | ||||
|     <p><b>リンクの種類</b>で"対象を動的に指定"を選択した場合、<code>link in</code>ノードのIDもしくは名前を<code>msg.target</code>に指定して呼び出すことができます。 | ||||
|     <ul> | ||||
|       <li>もし、同じ名前を付けた<code>link in</code>ノードが2つある場合、エラーが発生します。</li> | ||||
|       <li>同じIDの<code>link in</code>ノードがある場合、それを呼び出します。</li> | ||||
|       <li>もし、同じ名前を付けた<code>link in</code>ノードが2つ以上ある場合、エラーが発生します。</li> | ||||
|       <li><code>link call</code>は、サブフローの中の<code>link in</code>ノードを呼び出すことはできません。</li> | ||||
|     </ul> | ||||
|     </p> | ||||
|   | ||||
| @@ -129,6 +129,7 @@ | ||||
|         "msgprop": "メッセージプロパティ", | ||||
|         "msgobj": "msgオブジェクト全体", | ||||
|         "autostatus": "デバッグ出力と同じ", | ||||
|         "messageCount": "メッセージ数をカウント", | ||||
|         "to": "出力先", | ||||
|         "debtab": "デバッグタブ", | ||||
|         "tabcon": "デバッグタブとコンソール", | ||||
| @@ -443,7 +444,8 @@ | ||||
|             "action": "動作", | ||||
|             "staticTopic": "1つのトピックを購読", | ||||
|             "dynamicTopic": "動的な購読", | ||||
|             "auto-connect": "自動接続" | ||||
|             "auto-connect": "自動接続", | ||||
|             "auto-mode-depreciated": "本オプションは非推奨になりました。新しい自動判定モードを使用してください。" | ||||
|         }, | ||||
|         "sections-label": { | ||||
|             "birth-message": "接続時の送信メッセージ(Birthメッセージ)", | ||||
| @@ -611,7 +613,8 @@ | ||||
|             "ms": "ミリ秒", | ||||
|             "chars": "文字", | ||||
|             "close": "終了", | ||||
|             "optional": "(任意)" | ||||
|             "optional": "(任意)", | ||||
|             "reattach": "区切り文字を再追加" | ||||
|         }, | ||||
|         "type": { | ||||
|             "listen": "待ち受け", | ||||
| @@ -724,7 +727,9 @@ | ||||
|         "label": { | ||||
|             "property": "プロパティ", | ||||
|             "rule": "条件", | ||||
|             "repair": "メッセージ列の補正" | ||||
|             "repair": "メッセージ列の補正", | ||||
| 	    "value-rules": "値ルール", | ||||
| 	    "sequence-rules": "列ルール" | ||||
|         }, | ||||
|         "previous": "前回の値", | ||||
|         "and": "~", | ||||
| @@ -732,22 +737,22 @@ | ||||
|         "stopfirst": "最初に合致した条件で終了", | ||||
|         "ignorecase": "大文字、小文字を区別しない", | ||||
|         "rules": { | ||||
|             "btwn": "is between", | ||||
|             "cont": "contains", | ||||
|             "regex": "matches regex", | ||||
|             "true": "is true", | ||||
|             "false": "is false", | ||||
|             "null": "is null", | ||||
|             "nnull": "is not null", | ||||
|             "istype": "is of type", | ||||
|             "empty": "is empty", | ||||
|             "nempty": "is not empty", | ||||
|             "head": "head", | ||||
|             "tail": "tail", | ||||
|             "index": "index between", | ||||
|             "btwn": "範囲内である", | ||||
|             "cont": "要素に含む", | ||||
|             "regex": "正規表現にマッチ", | ||||
|             "true": "trueである", | ||||
|             "false": "falseである", | ||||
|             "null": "nullである", | ||||
|             "nnull": "nullでない", | ||||
|             "istype": "指定型である", | ||||
|             "empty": "空である", | ||||
|             "nempty": "空でない", | ||||
|             "head": "先頭要素である", | ||||
|             "tail": "末尾要素である", | ||||
|             "index": "指定添字範囲要素である", | ||||
|             "exp": "JSONata式", | ||||
|             "else": "その他", | ||||
|             "hask": "has key" | ||||
|             "hask": "キーを含む" | ||||
|         }, | ||||
|         "errors": { | ||||
|             "invalid-expr": "不正な表現: __error__", | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
|         <dt class="optional">method <span class="property-type">文字列</span></dt> | ||||
|         <dd>ノードの設定で指定していない場合、このプロパティでリクエストに用いるHTTPメソッドを設定します。<code>GET</code>, <code>PUT</code>, <code>POST</code>, <code>PATCH</code>, <code>DELETE</code>のいずれかを指定してください。</dd> | ||||
|         <dt class="optional">headers <span class="property-type">オブジェクト</span></dt> | ||||
|         <dd>リクエストのHTTPヘッダを指定します。</dd> | ||||
|         <dd>リクエストのHTTPヘッダを指定します。注釈: <code>msg.headers</code>のヘッダは、ノード設定のヘッダで上書きされます。</dd> | ||||
|         <dt class="optional">cookies <span class="property-type">オブジェクト</span></dt> | ||||
|         <dd>設定すると、リクエストと共にクッキーを送ることができます。</dd> | ||||
|         <dt class="optional">payload</dt> | ||||
|   | ||||
| @@ -15,11 +15,12 @@ | ||||
| --> | ||||
|  | ||||
| <script type="text/html" data-help-name="file"> | ||||
|     <p><code>msg.payload</code>をファイルに書き出します。書き出しは、ファイルの最後に追記もしくは既存の内容の置き換えを選択できます。この他、ファイルの削除を行うことも可能です。</p> | ||||
|     <p><code>msg.payload</code>をファイルに書き出します。書き出しは、ファイルの最後に追記もしくは既存の内容の置き換えを選択できます。その他、ファイルの削除を行うことも可能です。</p> | ||||
|     <h3>入力</h3> | ||||
|     <dl class="message-properties"> | ||||
|         <dt class="optional">filename <span class="property-type">文字列</span></dt> | ||||
|         <dd>対象ファイル名をノードに設定していない場合、このプロパティでファイルを指定できます</dd> | ||||
|         <dd>更新するファイルの名前は、ノード設定やメッセージのプロパティで指定できます。デフォルトでは、<code>msg.filename</code>が使われますが、ノード内でカスタマイズすることも可能です。 | ||||
|         </dd> | ||||
|         <dt class="optional">encoding <span class="property-type">文字列</span></dt> | ||||
|         <dd>エンコーディングをmsgで設定する構成にした際は、この任意のプロパティでエンコーディングを設定できます。</dt> | ||||
|     </dl> | ||||
| @@ -30,7 +31,7 @@ | ||||
|     <p><code>msg.filename</code>を使う場合、書き込みを行う毎にファイルをクローズします。より良い性能を得るためにはファイル名をノードに設定してください。</p> | ||||
|     <p>追記を行う代わりに、ファイル全体を上書きするように設定することもできます。例えば、画像のようなバイナリデータをファイルに書き出す場合は、このオプションを指定し、改行を追記するオプションを指定しないようにします。</p> | ||||
|     <p>ファイル出力の際のエンコーディングは、エンコーディングリストから選択できます。</p> | ||||
|     <p>この他、ファイルの削除を行うことも可能です。</p> | ||||
|     <p>その他、ファイルの削除を行うことも可能です。</p> | ||||
| </script> | ||||
|  | ||||
| <script type="text/html" data-help-name="file in"> | ||||
| @@ -38,14 +39,15 @@ | ||||
|     <h3>入力</h3> | ||||
|     <dl class="message-properties"> | ||||
|         <dt class="optional">filename <span class="property-type">文字列</span></dt> | ||||
|         <dd>読み出し対象のファイル名をノードに設定していない場合、このプロパティでファイルを指定できます</dd> | ||||
|         <dd>読み込むファイルの名前は、ノード設定やメッセージのプロパティで指定できます。デフォルトでは、<code>msg.filename</code>が使われますが、ノード内でカスタマイズすることも可能です。 | ||||
|         </dd> | ||||
|     </dl> | ||||
|     <h3>出力</h3> | ||||
|     <dl class="message-properties"> | ||||
|         <dt>payload <span class="property-type">文字列 | バッファ</span></dt> | ||||
|         <dd>ファイルの内容を文字列もしくはバッファで表現します</dd> | ||||
|         <dd>ファイルの内容を文字列もしくはバッファで表現します。</dd> | ||||
|         <dt class="optional">filename <span class="property-type">文字列</span></dt> | ||||
|         <dd>読み出し対象のファイル名をノードに設定していない場合、このプロパティでファイルを指定します</dd> | ||||
|         <dd>読み出し対象のファイル名をノードに設定していない場合、この任意のプロパティでファイルの名前を指定します。</dd> | ||||
|     </dl> | ||||
|     <h3>詳細</h3> | ||||
|     <p>ファイルネームは絶対パスでの指定を推奨します。絶対パスを指定しない場合は、Node-REDプロセスのワーキングディレクトリからの相対パスとして扱います。</p> | ||||
|   | ||||
| @@ -165,7 +165,7 @@ function buildDiagnosticReport(scope, callback) { | ||||
|  | ||||
|     /** gets a sanitised list containing only the module name */ | ||||
|     function listContextModules() { | ||||
|         const keys = Object.keys(runtime.settings.contextStorage); | ||||
|         const keys = Object.keys(runtime.settings.contextStorage || {}); | ||||
|         const result = {}; | ||||
|         keys.forEach(e => { | ||||
|             result[e] = { | ||||
|   | ||||
| @@ -100,7 +100,9 @@ | ||||
|             "error": "クレデンシャルの読み込みエラー: __message__", | ||||
|             "error-saving": "クレデンシャルの保存エラー: __message__", | ||||
|             "not-registered": "クレデンシャル '__type__' は登録されていません", | ||||
|             "system-key-warning": "\n\n---------------------------------------------------------------------\nフローのクレデンシャルファイルはシステム生成キーで暗号化されています。\n\nシステム生成キーを何らかの理由で失った場合、クレデンシャルファイルを\n復元することはできません。その場合、ファイルを削除してクレデンシャルを\n再入力しなければなりません。\n\n設定ファイル内で 'credentialSecret' オプションを使って独自キーを設定\nします。変更を次にデプロイする際、Node-REDは選択したキーを用いてクレ\nデンシャルを再暗号化します。 \n\n---------------------------------------------------------------------\n" | ||||
|             "system-key-warning": "\n\n---------------------------------------------------------------------\nフローのクレデンシャルファイルはシステム生成キーで暗号化されています。\n\nシステム生成キーを何らかの理由で失った場合、クレデンシャルファイルを\n復元することはできません。その場合、ファイルを削除してクレデンシャルを\n再入力しなければなりません。\n\n設定ファイル内で 'credentialSecret' オプションを使って独自キーを設定\nします。変更を次にデプロイする際、Node-REDは選択したキーを用いてクレ\nデンシャルを再暗号化します。 \n\n---------------------------------------------------------------------\n", | ||||
|             "unencrypted": "暗号化されていないクレデンシャルを使用", | ||||
|             "encryptedNotFound": "暗号化されたクレデンシャルが存在しません" | ||||
|         }, | ||||
|         "flows": { | ||||
|             "safe-mode": "セーフモードでフローを停止しました。開始するためにはデプロイしてください", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user