mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
32 Commits
fix-dynami
...
CSV-fix-n-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b60fd36c6e | ||
|
|
4467c0df31 | ||
|
|
ab1e38dde8 | ||
|
|
dd0d1e700e | ||
|
|
51ebb2579f | ||
|
|
d1d3b805f6 | ||
|
|
a6e247326b | ||
|
|
823b7e2989 | ||
|
|
5f40dc37a2 | ||
|
|
5e5c05f0c6 | ||
|
|
ab1340d213 | ||
|
|
cc5a0a436c | ||
|
|
125b37e98f | ||
|
|
f8ad75329d | ||
|
|
78327716a4 | ||
|
|
5393fa81b9 | ||
|
|
d2e84925f7 | ||
|
|
2ea10206fa | ||
|
|
1f5588b803 | ||
|
|
202102ebf7 | ||
|
|
71714733ad | ||
|
|
ad0a08ea0e | ||
|
|
5e592427e9 | ||
|
|
643541eebd | ||
|
|
13885493ac | ||
|
|
75c9353cbd | ||
|
|
01d9affe61 | ||
|
|
3ad95bec3c | ||
|
|
418b3ee7d6 | ||
|
|
0000f2a34d | ||
|
|
6c0d6c5425 | ||
|
|
326f346936 |
@@ -111,7 +111,7 @@
|
||||
"marked": "4.0.17",
|
||||
"minami": "1.2.3",
|
||||
"mocha": "9.2.2",
|
||||
"node-red-node-test-helper": "^0.3.0",
|
||||
"node-red-node-test-helper": "^0.2.7",
|
||||
"nodemon": "2.0.16",
|
||||
"proxy": "^1.0.2",
|
||||
"sass": "1.52.3",
|
||||
|
||||
@@ -1187,5 +1187,11 @@
|
||||
"missing-config": "__prop__: missing configuration node",
|
||||
"validation-error": "__prop__: validation error: __node__, __id__: __error__"
|
||||
}
|
||||
},
|
||||
"contextMenu": {
|
||||
"insert": "Insert",
|
||||
"node": "Node",
|
||||
"junction": "Junction",
|
||||
"linkNodes": "Link Nodes"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1188,6 +1188,12 @@
|
||||
"validation-error": "__prop__: チェックエラー: __node__, __id__: __error__"
|
||||
}
|
||||
},
|
||||
"contextMenu": {
|
||||
"insert": "挿入",
|
||||
"node": "ノード",
|
||||
"junction": "分岐点",
|
||||
"linkNodes": "Linkノード"
|
||||
},
|
||||
"action-list": {
|
||||
"toggle-show-tips": "ヒント表示切替",
|
||||
"show-about": "Node-REDの説明を表示",
|
||||
@@ -1302,7 +1308,7 @@
|
||||
"search": "検索",
|
||||
"search-previous": "前を検索",
|
||||
"search-next": "次を検索",
|
||||
"show-action-list": "アクション一覧を表示",
|
||||
"show-action-list": "動作一覧を表示",
|
||||
"confirm-edit-tray": "編集を完了",
|
||||
"cancel-edit-tray": "編集をキャンセル",
|
||||
"show-remote-diff": "リモートとの変更差分を表示",
|
||||
@@ -1324,6 +1330,11 @@
|
||||
"zoom-out": "ズームアウト",
|
||||
"zoom-reset": "ズームリセット",
|
||||
"toggle-navigator": "ナビゲータ表示切替",
|
||||
"show-system-info": "システムインフォメーション"
|
||||
"show-system-info": "システム情報",
|
||||
"split-wires-with-junctions": "分岐点によりワイヤーを分割",
|
||||
"new-project": "新しいプロジェクト",
|
||||
"open-project": "プロジェクトを開く",
|
||||
"show-project-settings": "プロジェクト設定を表示",
|
||||
"show-version-control-tab": "バージョンコントロールタブを表示"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ RED.contextMenu = (function() {
|
||||
const menuItems = [
|
||||
{ onselect: 'core:show-action-list', onpostselect: function() {} },
|
||||
{
|
||||
label: 'Insert',
|
||||
label: RED._("contextMenu.insert"),
|
||||
options: [
|
||||
{
|
||||
label: 'Node',
|
||||
label: RED._("contextMenu.node"),
|
||||
onselect: function() {
|
||||
RED.view.showQuickAddDialog({
|
||||
position: [ options.x - offset.left, options.y - offset.top ],
|
||||
@@ -62,12 +62,12 @@ RED.contextMenu = (function() {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Junction',
|
||||
label: RED._("contextMenu.junction"),
|
||||
onselect: 'core:split-wires-with-junctions',
|
||||
disabled: hasSelection || !hasLinks
|
||||
},
|
||||
{
|
||||
label: 'Link Nodes',
|
||||
label: RED._("contextMenu.linkNodes"),
|
||||
onselect: 'core:split-wire-with-link-nodes',
|
||||
disabled: hasSelection || !hasLinks
|
||||
}
|
||||
@@ -170,6 +170,7 @@ RED.contextMenu = (function() {
|
||||
}
|
||||
|
||||
return {
|
||||
show: show
|
||||
show: show,
|
||||
hide: disposeMenu
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
const MONACO = "monaco";
|
||||
const ACE = "ace";
|
||||
const defaultEditor = ACE;
|
||||
const defaultEditor = MONACO;
|
||||
const DEFAULT_SETTINGS = { lib: defaultEditor, options: {} };
|
||||
var selectedCodeEditor = null;
|
||||
var initialised = false;
|
||||
@@ -48,12 +48,12 @@
|
||||
}
|
||||
|
||||
function create(options) {
|
||||
//TODO: (quandry - for consideration)
|
||||
//TODO: (quandry - for consideration)
|
||||
// Below, I had to create a hidden element if options.id || options.element is not in the DOM
|
||||
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
|
||||
// I have seen 1 node calling `this.editor = RED.editor.createEditor()` with an
|
||||
// invalid (non existing html element selector) (e.g. node-red-contrib-components does this)
|
||||
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
|
||||
// code is thus skipped.
|
||||
// This causes monaco to throw an error when attempting to hook up its events to the dom & the rest of the 'oneditperapre'
|
||||
// code is thus skipped.
|
||||
// In ACE mode, creating an ACE editor (with an invalid ID) allows the editor to be created (but obviously there is no UI)
|
||||
// Because one (or more) contrib nodes have left this bad code in place, how would we handle this?
|
||||
// For compatibility, I have decided to create a hidden element so that at least an editor is created & errors do not occur.
|
||||
@@ -79,7 +79,7 @@
|
||||
return this.editor.create(options);//fallback to ACE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
init: init,
|
||||
/**
|
||||
@@ -91,7 +91,7 @@
|
||||
},
|
||||
/**
|
||||
* Get user selected code editor
|
||||
* @return {string} Returns
|
||||
* @return {string} Returns
|
||||
* @memberof RED.editor.codeEditor
|
||||
*/
|
||||
get editor() {
|
||||
@@ -104,4 +104,4 @@
|
||||
*/
|
||||
create: create
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
if (!node._def.defaults || !node._def.defaults.hasOwnProperty("icon")) {
|
||||
var icon = $("#red-ui-editor-node-icon").val()||"";
|
||||
if (!this.isDefaultIcon) {
|
||||
if ((icon !== node.icon) &&
|
||||
(icon !== "")) {
|
||||
if ((node.icon && icon !== node.icon) || (!node.icon && icon !== "")) {
|
||||
editState.changes.icon = node.icon;
|
||||
node.icon = icon;
|
||||
editState.changed = true;
|
||||
|
||||
@@ -979,13 +979,14 @@ RED.view.tools = (function() {
|
||||
* - it uses `<paletteLabel> <N>` - where N is the next available integer that
|
||||
* doesn't clash with any existing nodes of that type
|
||||
* @param {Object} node The node to set the name of - if not provided, uses current selection
|
||||
* @param {{ renameBlank: boolean, renameClash: boolean, generateHistory: boolean }} options Possible options are `renameBlank`, `renameClash` and `generateHistory`
|
||||
*/
|
||||
function generateNodeNames(node, options) {
|
||||
options = options || {
|
||||
options = Object.assign({
|
||||
renameBlank: true,
|
||||
renameClash: true,
|
||||
generateHistory: true
|
||||
}
|
||||
}, options)
|
||||
let nodes = node;
|
||||
if (node) {
|
||||
if (!Array.isArray(node)) {
|
||||
|
||||
@@ -988,6 +988,7 @@ RED.view = (function() {
|
||||
if (RED.view.DEBUG) {
|
||||
console.warn("canvasMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||
}
|
||||
RED.contextMenu.hide();
|
||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||
d3.event.stopPropagation();
|
||||
return;
|
||||
@@ -1779,6 +1780,9 @@ RED.view = (function() {
|
||||
}
|
||||
var i;
|
||||
var historyEvent;
|
||||
if (d3.event.button === 2) {
|
||||
return
|
||||
}
|
||||
if (mouse_mode === RED.state.PANNING) {
|
||||
resetMouseVars();
|
||||
return
|
||||
@@ -2903,6 +2907,7 @@ RED.view = (function() {
|
||||
|
||||
function portMouseDown(d,portType,portIndex, evt) {
|
||||
if (RED.view.DEBUG) { console.warn("portMouseDown", mouse_mode,d,portType,portIndex); }
|
||||
RED.contextMenu.hide();
|
||||
evt = evt || d3.event;
|
||||
if (evt === 1) {
|
||||
return;
|
||||
@@ -3411,6 +3416,7 @@ RED.view = (function() {
|
||||
function nodeMouseDown(d) {
|
||||
if (RED.view.DEBUG) { console.warn("nodeMouseDown", mouse_mode,d); }
|
||||
focusView();
|
||||
RED.contextMenu.hide();
|
||||
if (d3.event.button === 1) {
|
||||
return;
|
||||
}
|
||||
@@ -3793,6 +3799,7 @@ RED.view = (function() {
|
||||
if (RED.view.DEBUG) {
|
||||
console.warn("linkMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||
}
|
||||
RED.contextMenu.hide();
|
||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||
d3.event.stopPropagation();
|
||||
return;
|
||||
@@ -3852,6 +3859,9 @@ RED.view = (function() {
|
||||
}
|
||||
|
||||
function groupMouseUp(g) {
|
||||
if (RED.view.DEBUG) {
|
||||
console.warn("groupMouseUp", { mouse_mode, event: d3.event });
|
||||
}
|
||||
if (dblClickPrimed && mousedown_group == g && clickElapsed > 0 && clickElapsed < dblClickInterval) {
|
||||
mouse_mode = RED.state.DEFAULT;
|
||||
RED.editor.editGroup(g);
|
||||
@@ -3867,6 +3877,10 @@ RED.view = (function() {
|
||||
// return
|
||||
// }
|
||||
|
||||
if (RED.view.DEBUG) {
|
||||
console.warn("groupMouseDown", { mouse_mode, point: mouse, event: d3.event });
|
||||
}
|
||||
RED.contextMenu.hide();
|
||||
focusView();
|
||||
if (d3.event.button === 1) {
|
||||
return;
|
||||
@@ -5858,6 +5872,7 @@ RED.view = (function() {
|
||||
* @private
|
||||
*/
|
||||
function createNode(type, x, y, z) {
|
||||
const wasDirty = RED.nodes.dirty()
|
||||
var m = /^subflow:(.+)$/.exec(type);
|
||||
var activeSubflow = z ? RED.nodes.subflow(z) : null;
|
||||
if (activeSubflow && m) {
|
||||
@@ -5916,7 +5931,7 @@ RED.view = (function() {
|
||||
var historyEvent = {
|
||||
t: "add",
|
||||
nodes: [nn.id],
|
||||
dirty: RED.nodes.dirty()
|
||||
dirty: wasDirty
|
||||
}
|
||||
if (activeSubflow) {
|
||||
var subflowRefresh = RED.subflow.refresh(true);
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
.red-ui-search-results-container {
|
||||
display: none;
|
||||
height: 150px;
|
||||
height: 195px;
|
||||
.red-ui-editableList-container {
|
||||
border: 1px dashed $primary-border-color;
|
||||
border-top: 1px solid $secondary-border-color;
|
||||
|
||||
@@ -37,7 +37,7 @@ ul.red-ui-sidebar-node-config-list {
|
||||
}
|
||||
.red-ui-palette-node {
|
||||
overflow: hidden;
|
||||
|
||||
cursor: default;
|
||||
&.selected {
|
||||
border-color: transparent;
|
||||
box-shadow: 0 0 0 2px $node-selected-color;
|
||||
@@ -58,7 +58,7 @@ ul.red-ui-sidebar-node-config-list {
|
||||
.red-ui-palette-icon-container {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background-color: $node-icon-background-color;
|
||||
background-color: $node-port-background;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
a {
|
||||
@@ -68,6 +68,7 @@ ul.red-ui-sidebar-node-config-list {
|
||||
left: 0;
|
||||
right: 0;
|
||||
color: $node-port-label-color;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
background: $node-port-background-hover;
|
||||
|
||||
@@ -9,19 +9,22 @@ export default {
|
||||
},
|
||||
description: {
|
||||
"en-US": "<p>This is the final beta release of Node-RED 3.0.</p><p>Let's take a moment to discover the new features in this release.</p>",
|
||||
// "ja": "<p>これはNode-RED 3.0の最初のベータリリースです。これには、最終リリースで計画しているほぼ全ての機能が含まれています。</p><p>本リリースの新機能を見つけてみましょう。</p>"
|
||||
"ja": "<p>これはNode-RED 3.0の最後のベータリリースです。</p><p>本リリースの新機能を見つけてみましょう。</p>"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "Context Menu"
|
||||
"en-US": "Context Menu",
|
||||
"ja": "コンテキストメニュー"
|
||||
},
|
||||
image: 'images/context-menu.png',
|
||||
description: {
|
||||
"en-US": `<p>The editor now has its own context menu when you
|
||||
right-click in the workspace.</p>
|
||||
<p>This makes many of the built-in actions much easier
|
||||
to access.</p>`
|
||||
to access.</p>`,
|
||||
"ja": `<p>ワークスペースで右クリックすると、エディタに独自のコンテキストメニューが表示されるようになりました。</p>
|
||||
<p>これによって多くの組み込み動作を、より簡単に利用できます。</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -34,10 +37,10 @@ export default {
|
||||
"en-US": `<p>To make it easier to route wires around your flows,
|
||||
it is now possible to add junction nodes that give
|
||||
you more control.</p>
|
||||
<p>Junctions can be added to wires by holding the Alt key
|
||||
<p>Junctions can be added to wires by holding both the Alt key and the Shift key
|
||||
then click and drag the mouse across the wires.</p>`,
|
||||
// "ja": `<p>フローのワイヤーの経路をより制御しやすくするために、分岐点ノードを追加できるようになりました。</p>
|
||||
// <p>シフトキーを押しながら、マウスの右ボタンをクリックし、ワイヤーを横切るようにドラッグすることで、分岐点を追加できます。</p>`
|
||||
"ja": `<p>フローのワイヤーの経路をより制御しやすくするために、分岐点ノードを追加できるようになりました。</p>
|
||||
<p>Altキーとシフトキーを押しながらマウスをクリックし、ワイヤーを横切るようにドラッグすることで、分岐点を追加できます。</p>`
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
.inject-time-row {
|
||||
padding-left: 110px;
|
||||
}
|
||||
.inject-time-row select {
|
||||
.inject-time-row:not(#inject-time-row-interval) select {
|
||||
margin: 3px 0;
|
||||
}
|
||||
.inject-time-days label {
|
||||
|
||||
@@ -558,7 +558,7 @@
|
||||
onadd: function() {
|
||||
if (this.name === '_DEFAULT_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
RED.actions.invoke("core:generate-node-names", this, {generateHistory: false})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
function onAdd() {
|
||||
if (this.name === '_DEFAULT_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
RED.actions.invoke("core:generate-node-names", this, {generateHistory: false})
|
||||
}
|
||||
for (var i=0;i<this.links.length;i++) {
|
||||
var n = RED.nodes.node(this.links[i]);
|
||||
|
||||
@@ -109,13 +109,16 @@ module.exports = function(RED) {
|
||||
},
|
||||
remove(node) {
|
||||
const target = generateTarget(node);
|
||||
const targs = this.getTargets(target.name);
|
||||
const idx = getIndex(targs, target.id);
|
||||
if (idx > -1) {
|
||||
targs.splice(idx, 1);
|
||||
}
|
||||
if (targs.length === 0) {
|
||||
delete registry.name[tn.name];
|
||||
const tn = this.getTarget(target.name, target.flowId);
|
||||
if (tn) {
|
||||
const targs = this.getTargets(tn.name);
|
||||
const idx = getIndex(targs, tn.id);
|
||||
if (idx > -1) {
|
||||
targs.splice(idx, 1);
|
||||
}
|
||||
if (targs.length === 0) {
|
||||
delete registry.name[tn.name];
|
||||
}
|
||||
}
|
||||
delete registry.id[target.id];
|
||||
},
|
||||
|
||||
@@ -639,7 +639,7 @@
|
||||
onadd: function() {
|
||||
if (this.name === '_DEFAULT_') {
|
||||
this.name = ''
|
||||
RED.actions.invoke("core:generate-node-names", this)
|
||||
RED.actions.invoke("core:generate-node-names", this, {generateHistory: false})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -44,6 +44,14 @@ module.exports = function(RED) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function parseEnv(key) {
|
||||
var match = /^env\.(.+)/.exec(key);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Mustache Context capable to collect message property and node
|
||||
* flow and global context
|
||||
@@ -74,6 +82,11 @@ module.exports = function(RED) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// try env
|
||||
if (parseEnv(name)) {
|
||||
return this.cachedContextTokens[name];
|
||||
}
|
||||
|
||||
// try flow/global context:
|
||||
var context = parseContext(name);
|
||||
if (context) {
|
||||
@@ -156,6 +169,17 @@ module.exports = function(RED) {
|
||||
var tokens = extractTokens(mustache.parse(template));
|
||||
var resolvedTokens = {};
|
||||
tokens.forEach(function(name) {
|
||||
var env_name = parseEnv(name);
|
||||
if (env_name) {
|
||||
var promise = new Promise((resolve, reject) => {
|
||||
var val = RED.util.evaluateNodeProperty(env_name, 'env', node)
|
||||
resolvedTokens[name] = val;
|
||||
resolve();
|
||||
});
|
||||
promises.push(promise);
|
||||
return;
|
||||
}
|
||||
|
||||
var context = parseContext(name);
|
||||
if (context) {
|
||||
var type = context.type;
|
||||
|
||||
@@ -89,6 +89,9 @@ module.exports = function(RED) {
|
||||
else if (msg.payload[s][t].toString().indexOf(node.sep) !== -1) { // add quotes if any "commas"
|
||||
msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo;
|
||||
}
|
||||
else if (msg.payload[s][t].toString().indexOf("\n") !== -1) { // add quotes if any "\n"
|
||||
msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo;
|
||||
}
|
||||
}
|
||||
ou += msg.payload[s].join(node.sep) + node.ret;
|
||||
}
|
||||
@@ -112,7 +115,7 @@ module.exports = function(RED) {
|
||||
q = q.replace(/"/g, '""');
|
||||
ou += node.quo + q + node.quo + node.sep;
|
||||
}
|
||||
else if (q.indexOf(node.sep) !== -1) { // add quotes if any "commas"
|
||||
else if (q.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n"
|
||||
ou += node.quo + q + node.quo + node.sep;
|
||||
}
|
||||
else { ou += q + node.sep; } // otherwise just add
|
||||
@@ -134,7 +137,7 @@ module.exports = function(RED) {
|
||||
p = p.replace(/"/g, '""');
|
||||
ou += node.quo + p + node.quo + node.sep;
|
||||
}
|
||||
else if (p.indexOf(node.sep) !== -1) { // add quotes if any "commas"
|
||||
else if (p.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n"
|
||||
ou += node.quo + p + node.quo + node.sep;
|
||||
}
|
||||
else { ou += p + node.sep; } // otherwise just add
|
||||
|
||||
@@ -314,11 +314,13 @@ module.exports = function(RED) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
msgInfo.send({payload: result});
|
||||
msgInfo.msg.payload = result;
|
||||
msgInfo.send(msgInfo.msg);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
msgInfo.send({payload: result});
|
||||
msgInfo.msg.payload = result;
|
||||
msgInfo.send(msgInfo.msg);
|
||||
done();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<p>返却/sendの対象は次のとおりです:</p>
|
||||
<ul>
|
||||
<li>単一メッセージオブジェクト - 最初の出力に接続されたノードに渡されます</li>
|
||||
<li>メッセージオブジェクトの配列 - 対応する出力に接続されたノードに渡されます</li>
|
||||
<li>メッセージオブジェクトの配列 - 対応する出力に接続されたノードに渡されます</li>
|
||||
</ul>
|
||||
<p>注: 初期化処理の実行はノードの初期化中に行われます。そのため、初期化処理タブにsendを記述した場合に後続ノードでメッセージを受け取れないことがあります。</p>
|
||||
<p>配列要素が配列の場合には、複数のメッセージを対応する出力に送出します。</p>
|
||||
|
||||
@@ -928,6 +928,7 @@
|
||||
"write": "write file",
|
||||
"read": "read file",
|
||||
"filename": "ファイル名",
|
||||
"path": "パス",
|
||||
"action": "動作",
|
||||
"addnewline": "メッセージの入力のたびに改行を追加",
|
||||
"createdir": "ディレクトリが存在しない場合は作成",
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<dt class="optional">userProperties <span class="property-type">オブジェクト</span></dt>
|
||||
<dd><b>MQTTv5</b>: メッセージのユーザプロパティ</dd>
|
||||
<dt class="optional">messageExpiryInterval <span class="property-type">数値</span></dt>
|
||||
<dd><b>MQTTv5</b>: 秒単位のメッセージの有効期限</dd>
|
||||
<dd><b>MQTTv5</b>: 秒単位のメッセージの有効期限</dd>
|
||||
<dt class="optional">topicAlias <span class="property-type">数値</span></dt>
|
||||
<dd><b>MQTTv5</b>: 使用するMQTTトピックエイリアス</dd>
|
||||
</dl>
|
||||
|
||||
@@ -359,6 +359,7 @@ function loadNodeSet(node) {
|
||||
try {
|
||||
var loadPromise = null;
|
||||
var r = require(node.file);
|
||||
r = r.__esModule ? r.default : r
|
||||
if (typeof r === "function") {
|
||||
|
||||
var red = registryUtil.createNodeApi(node);
|
||||
|
||||
@@ -91,7 +91,7 @@ var api = module.exports = {
|
||||
safeSettings.context = runtime.nodes.listContextStores();
|
||||
if (runtime.settings.editorTheme && runtime.settings.editorTheme.codeEditor) {
|
||||
safeSettings.codeEditor = runtime.settings.editorTheme.codeEditor || {};
|
||||
safeSettings.codeEditor.lib = safeSettings.codeEditor.lib || "ace";
|
||||
safeSettings.codeEditor.lib = safeSettings.codeEditor.lib || "monaco";
|
||||
safeSettings.codeEditor.options = safeSettings.codeEditor.options || {};
|
||||
}
|
||||
safeSettings.libraries = runtime.library.getLibraries();
|
||||
|
||||
2
packages/node_modules/node-red/settings.js
vendored
2
packages/node_modules/node-red/settings.js
vendored
@@ -401,7 +401,7 @@ module.exports = {
|
||||
* packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
|
||||
* e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
|
||||
*/
|
||||
theme: "vs",
|
||||
// theme: "vs",
|
||||
/** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc.
|
||||
* for the full list, see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IStandaloneEditorConstructionOptions.html
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
var should = require("should");
|
||||
var linkNode = require("nr-test-utils").require("@node-red/nodes/core/common/60-link.js");
|
||||
var helper = require("node-red-node-test-helper");
|
||||
var clone = require("clone");
|
||||
|
||||
describe('link Node', function() {
|
||||
|
||||
@@ -320,48 +319,6 @@ describe('link Node', function() {
|
||||
linkCall.receive({ payload: "hello", target: "double payload" });
|
||||
});
|
||||
})
|
||||
it('should not raise error after deploying a name change to a duplicate link-in node', async function () {
|
||||
this.timeout(400);
|
||||
const flow = [
|
||||
{ id: "tab-flow-1", type: "tab", label: "Flow 1" },
|
||||
{ id: "link-in-1", z: "tab-flow-1", type: "link in", name: "duplicate", wires: [["link-out-1"]] },
|
||||
{ id: "link-in-2", z: "tab-flow-1", type: "link in", name: "duplicate", wires: [["link-out-1"]] }, //duplicate name
|
||||
{ id: "link-out-1", z: "tab-flow-1", type: "link out", mode: "return" },
|
||||
{ id: "link-call", z: "tab-flow-1", type: "link call", linkType: "dynamic", links: [], wires: [["n4"]] },
|
||||
{ id: "n4", z: "tab-flow-1", type: "helper" }
|
||||
];
|
||||
|
||||
await helper.load(linkNode, flow)
|
||||
|
||||
const linkIn2before = helper.getNode("link-in-2");
|
||||
linkIn2before.should.have.property("name", "duplicate") // check link-in-2 has been deployed with the duplicate name
|
||||
|
||||
//modify the flow and deploy change
|
||||
const newConfig = clone(flow);
|
||||
newConfig[2].name = "add" // change nodes name
|
||||
await helper.setFlows(newConfig, "nodes") // deploy "nodes" only
|
||||
|
||||
const helperNode = helper.getNode("n4");
|
||||
const linkCall2 = helper.getNode("link-call");
|
||||
const linkIn2after = helper.getNode("link-in-2");
|
||||
linkIn2after.should.have.property("name", "add") // check link-in-2 no longer has a duplicate name
|
||||
|
||||
//poke { payload: "hello", target: "add" } into the link-call node and
|
||||
//ensure that a message arrives via the link-in node named "add"
|
||||
await new Promise((resolve, reject) => {
|
||||
helperNode.on("input", function (msg) {
|
||||
try {
|
||||
msg.should.have.property("target", "add");
|
||||
msg.should.not.have.property("error");
|
||||
resolve()
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
linkCall2.receive({ payload: "hello", target: "add" });
|
||||
});
|
||||
|
||||
})
|
||||
it('should allow nested link-call flows', function(done) {
|
||||
this.timeout(500);
|
||||
var flow = [/** Multiply by 2 link flow **/
|
||||
|
||||
@@ -144,6 +144,28 @@ describe('template node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('env var', function() {
|
||||
before(function() {
|
||||
process.env.TEST = 'xyzzy';
|
||||
})
|
||||
after(function() {
|
||||
delete process.env.TEST;
|
||||
})
|
||||
|
||||
it('should modify payload from env variable', function(done) {
|
||||
var flow = [{id:"n1",z:"t1", type:"template", field:"payload", template:"payload={{env.TEST}}",wires:[["n2"]]},{id:"n2",z:"t1",type:"helper"}];
|
||||
helper.load(templateNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
msg.should.have.property('payload', 'payload=xyzzy');
|
||||
done();
|
||||
});
|
||||
n1.receive({payload:"foo",topic: "bar"});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should modify payload from flow context', function(done) {
|
||||
var flow = [{id:"n1",z:"t1", type:"template", field:"payload", template:"payload={{flow.value}}",wires:[["n2"]]},{id:"n2",z:"t1",type:"helper"}];
|
||||
helper.load(templateNode, flow, function() {
|
||||
|
||||
@@ -693,19 +693,19 @@ describe('CSV node', function() {
|
||||
describe('json object to csv', function() {
|
||||
|
||||
it('should convert a simple object back to a csv', function(done) {
|
||||
var flow = [ { id:"n1", type:"csv", temp:"a,b,c,,e", wires:[["n2"]] },
|
||||
var flow = [ { id:"n1", type:"csv", temp:"a,b,c,,e,f", wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(csvNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload', '4,foo,true,,0\n');
|
||||
msg.should.have.property('payload', '4,foo,true,,0,"Hello\nWorld"\n');
|
||||
done();
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = { e:0, d:1, b:"foo", c:true, a:4 };
|
||||
var testJson = { e:0, d:1, b:"foo", c:true, a:4, f:"Hello\nWorld" };
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
@@ -777,7 +777,7 @@ describe('CSV node', function() {
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = [{ d: 1, b: 3, c: 2, a: 4 },{d:4,a:1,c:3,b:2}];
|
||||
var testJson = [{ d:1, b:3, c:2, a:4 },{d:4, a:1, c:3, b:2}];
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
@@ -790,12 +790,12 @@ describe('CSV node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload', 'a,b,c,d\n4,3,2,1\n1,2,3,4\n');
|
||||
msg.should.have.property('payload', 'a,b,c,d\n4,3,2,1\n1,2,3,"a\nb"\n');
|
||||
done();
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = [{ d: 1, b: 3, c: 2, a: 4 },{d:4,a:1,c:3,b:2}];
|
||||
var testJson = [{ d:1, b:3, c:2, a:4 },{d:"a\nb", a:1, c:3, b:2}];
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
@@ -826,12 +826,12 @@ describe('CSV node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload', 'd,b,c,a\n1,3,2,4\n4,2,3,1\n');
|
||||
msg.should.have.property('payload', 'd,b,c,a\n1,3,2,4\n4,"f\ng",3,1\n');
|
||||
done();
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = [{ d: 1, b: 3, c: 2, a: 4 },{d:4,a:1,c:3,b:2}];
|
||||
var testJson = [{ d: 1, b: 3, c: 2, a: 4 },{d:4,a:1,c:3,b:"f\ng"}];
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
@@ -844,12 +844,12 @@ describe('CSV node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload', ',0,1,foo,"ba""r","di,ng"\n');
|
||||
msg.should.have.property('payload', ',0,1,foo,"ba""r","di,ng","fa\nba"\n');
|
||||
done();
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = ["",0,1,"foo",'ba"r','di,ng'];
|
||||
var testJson = ["",0,1,"foo",'ba"r','di,ng',"fa\nba"];
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
@@ -898,12 +898,12 @@ describe('CSV node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload', 'col1,col2,col3,col4\r\nH1,H2,H3,H4\r\nA,B,,\r\nA,,C,\r\nA,,,D\r\n');
|
||||
msg.should.have.property('payload', 'col1,col2,col3,col4\r\nH1,H2,H3,H4\r\nA,B,,\r\nA,,C,\r\nA,,,"D\nE"\r\n');
|
||||
done();
|
||||
}
|
||||
catch(e) { done(e); }
|
||||
});
|
||||
var testJson = [{"col1":"H1","col2":"H2","col3":"H3","col4":"H4"},{"col1":"A","col2":"B"},{"col1":"A","col3":"C"},{"col1":"A","col4":"D"}];
|
||||
var testJson = [{"col1":"H1","col2":"H2","col3":"H3","col4":"H4"},{"col1":"A","col2":"B"},{"col1":"A","col3":"C"},{"col1":"A","col4":"D\nE"}];
|
||||
n1.emit("input", {payload:testJson});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user