mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
15 Commits
4.0.2
...
allow-name
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d457c81547 | ||
|
|
83acc4836b | ||
|
|
db51307e7f | ||
|
|
a2430b772b | ||
|
|
b3acd1a588 | ||
|
|
8af821d380 | ||
|
|
97ee6c6745 | ||
|
|
b5fb15cd9b | ||
|
|
998219ae9a | ||
|
|
e8f0f80f65 | ||
|
|
45936285cc | ||
|
|
ff35c46d5d | ||
|
|
05c924a9df | ||
|
|
14ac309b6e | ||
|
|
8c5ddd68a4 |
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18, 20, 22]
|
||||
node-version: [18, 20, 22.4.x]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"description": "Low-code programming for event-driven applications",
|
||||
"homepage": "https://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-api",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "4.0.2",
|
||||
"@node-red/editor-client": "4.0.2",
|
||||
"@node-red/util": "4.1.0-beta.0",
|
||||
"@node-red/editor-client": "4.1.0-beta.0",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.20.2",
|
||||
"clone": "2.1.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -164,7 +164,7 @@ RED.multiplayer = (function () {
|
||||
$(this).show()
|
||||
}
|
||||
})
|
||||
if (users.length < maxShown + 1) {
|
||||
if (users.length < maxShown + 1) {
|
||||
userCountIcon.hide()
|
||||
} else {
|
||||
userCountSpan.text('+'+(users.length - maxShown))
|
||||
@@ -365,12 +365,12 @@ RED.multiplayer = (function () {
|
||||
border.setAttribute("r",radius/2);
|
||||
border.setAttribute("class", "red-ui-multiplayer-annotation-border")
|
||||
group.appendChild(border)
|
||||
|
||||
|
||||
|
||||
|
||||
return group
|
||||
}
|
||||
|
||||
|
||||
RED.view.annotations.register("red-ui-multiplayer",{
|
||||
type: 'badge',
|
||||
align: 'left',
|
||||
@@ -411,7 +411,7 @@ RED.multiplayer = (function () {
|
||||
// } else {
|
||||
log('Session ID', activeSessionId)
|
||||
// }
|
||||
|
||||
|
||||
headerWidget = $('<li><ul id="red-ui-multiplayer-user-list"></ul></li>').prependTo('.red-ui-header-toolbar')
|
||||
|
||||
RED.comms.on('connect', () => {
|
||||
@@ -422,6 +422,9 @@ RED.multiplayer = (function () {
|
||||
if (location.workspace !== 0) {
|
||||
connectInfo.location = location
|
||||
}
|
||||
if (localStorage.getItem("multiplayer-name") !== undefined && localStorage.getItem("multiplayer-name").length >0) {
|
||||
connectInfo.name = localStorage.getItem("multiplayer-name");
|
||||
}
|
||||
RED.comms.send('multiplayer/connect', connectInfo)
|
||||
})
|
||||
RED.comms.subscribe('multiplayer/#', (topic, msg) => {
|
||||
|
||||
@@ -32,24 +32,28 @@ RED.contextMenu = (function () {
|
||||
const canRemoveFromGroup = hasSelection && !!selection.nodes[0].g
|
||||
let hasGroup, isAllGroups = true, hasDisabledNode, hasEnabledNode, hasLabeledNode, hasUnlabeledNode;
|
||||
if (hasSelection) {
|
||||
selection.nodes.forEach(n => {
|
||||
const nodes = selection.nodes.slice();
|
||||
while (nodes.length) {
|
||||
const n = nodes.shift();
|
||||
if (n.type === 'group') {
|
||||
hasGroup = true;
|
||||
nodes.push(...n.nodes);
|
||||
} else {
|
||||
isAllGroups = false;
|
||||
}
|
||||
if (n.d) {
|
||||
hasDisabledNode = true;
|
||||
} else {
|
||||
hasEnabledNode = true;
|
||||
if (n.d) {
|
||||
hasDisabledNode = true;
|
||||
} else {
|
||||
hasEnabledNode = true;
|
||||
}
|
||||
}
|
||||
if (n.l === undefined || n.l) {
|
||||
hasLabeledNode = true;
|
||||
} else {
|
||||
hasUnlabeledNode = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const offset = $("#red-ui-workspace-chart").offset()
|
||||
|
||||
let addX = options.x - offset.left + $("#red-ui-workspace-chart").scrollLeft()
|
||||
|
||||
@@ -46,12 +46,12 @@
|
||||
|
||||
<div class="form-row inject-time-row hidden" id="inject-time-row-interval">
|
||||
<span data-i18n="inject.every"></span>
|
||||
<input id="inject-time-interval-count" class="inject-time-count" value="1"></input>
|
||||
<input id="inject-time-interval-count" class="inject-time-count" value="1">
|
||||
<select style="width:100px" id="inject-time-interval-units">
|
||||
<option value="s" data-i18n="inject.seconds"></option>
|
||||
<option value="m" data-i18n="inject.minutes"></option>
|
||||
<option value="h" data-i18n="inject.hours"></option>
|
||||
</select><br/>
|
||||
</select><br>
|
||||
</div>
|
||||
|
||||
<div class="form-row inject-time-row hidden" id="inject-time-row-interval-time">
|
||||
@@ -68,46 +68,46 @@
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
<option value="0">60</option>
|
||||
</select> <span data-i18n="inject.minutes"></span><br/>
|
||||
</select> <span data-i18n="inject.minutes"></span><br>
|
||||
<span data-i18n="inject.between"></span> <select id="inject-time-interval-time-start" class="inject-time-times"></select>
|
||||
<span data-i18n="inject.and"></span> <select id="inject-time-interval-time-end" class="inject-time-times"></select><br/>
|
||||
<span data-i18n="inject.and"></span> <select id="inject-time-interval-time-end" class="inject-time-times"></select><br>
|
||||
<div id="inject-time-interval-time-days" class="inject-time-days" style="margin-top:5px">
|
||||
<div style="display:inline-block; vertical-align:top; margin-right:5px;" data-i18n="inject.on">on</div>
|
||||
<div style="display:inline-block;">
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='1'/> <span data-i18n="inject.days.0"></span></label>
|
||||
<label><input type='checkbox' checked value='2'/> <span data-i18n="inject.days.1"></span></label>
|
||||
<label><input type='checkbox' checked value='3'/> <span data-i18n="inject.days.2"></span></label>
|
||||
<label><input type='checkbox' checked value='1'> <span data-i18n="inject.days.0"></span></label>
|
||||
<label><input type='checkbox' checked value='2'> <span data-i18n="inject.days.1"></span></label>
|
||||
<label><input type='checkbox' checked value='3'> <span data-i18n="inject.days.2"></span></label>
|
||||
</div>
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='4'/> <span data-i18n="inject.days.3"></span></label>
|
||||
<label><input type='checkbox' checked value='5'/> <span data-i18n="inject.days.4"></span></label>
|
||||
<label><input type='checkbox' checked value='6'/> <span data-i18n="inject.days.5"></span></label>
|
||||
<label><input type='checkbox' checked value='4'> <span data-i18n="inject.days.3"></span></label>
|
||||
<label><input type='checkbox' checked value='5'> <span data-i18n="inject.days.4"></span></label>
|
||||
<label><input type='checkbox' checked value='6'> <span data-i18n="inject.days.5"></span></label>
|
||||
</div>
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='0'/> <span data-i18n="inject.days.6"></span></label>
|
||||
<label><input type='checkbox' checked value='0'> <span data-i18n="inject.days.6"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row inject-time-row hidden" id="inject-time-row-time">
|
||||
<span data-i18n="inject.at"></span> <input type="text" id="inject-time-time" value="12:00"></input><br/>
|
||||
<span data-i18n="inject.at"></span> <input type="text" id="inject-time-time" value="12:00"><br>
|
||||
<div id="inject-time-time-days" class="inject-time-days">
|
||||
<div style="display:inline-block; vertical-align:top; margin-right:5px;" data-i18n="inject.on"></div>
|
||||
<div style="display:inline-block;">
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='1'/> <span data-i18n="inject.days.0"></span></label>
|
||||
<label><input type='checkbox' checked value='2'/> <span data-i18n="inject.days.1"></span></label>
|
||||
<label><input type='checkbox' checked value='3'/> <span data-i18n="inject.days.2"></span></label>
|
||||
<label><input type='checkbox' checked value='1'> <span data-i18n="inject.days.0"></span></label>
|
||||
<label><input type='checkbox' checked value='2'> <span data-i18n="inject.days.1"></span></label>
|
||||
<label><input type='checkbox' checked value='3'> <span data-i18n="inject.days.2"></span></label>
|
||||
</div>
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='4'/> <span data-i18n="inject.days.3"></span></label>
|
||||
<label><input type='checkbox' checked value='5'/> <span data-i18n="inject.days.4"></span></label>
|
||||
<label><input type='checkbox' checked value='6'/> <span data-i18n="inject.days.5"></span></label>
|
||||
<label><input type='checkbox' checked value='4'> <span data-i18n="inject.days.3"></span></label>
|
||||
<label><input type='checkbox' checked value='5'> <span data-i18n="inject.days.4"></span></label>
|
||||
<label><input type='checkbox' checked value='6'> <span data-i18n="inject.days.5"></span></label>
|
||||
</div>
|
||||
<div>
|
||||
<label><input type='checkbox' checked value='0'/> <span data-i18n="inject.days.6"></span></label>
|
||||
<label><input type='checkbox' checked value='0'> <span data-i18n="inject.days.6"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="switch.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width: calc(100% - 105px)"/>
|
||||
<input type="hidden" id="node-input-outputs"/>
|
||||
<input type="text" id="node-input-property" style="width: calc(100% - 105px)">
|
||||
<input type="hidden" id="node-input-outputs">
|
||||
</div>
|
||||
<div class="form-row node-input-rule-container-row">
|
||||
<ol id="node-input-rule-container"></ol>
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="checkbox" id="node-input-repair" style="display: inline-block; width: auto; vertical-align: top;">
|
||||
<label style="width: auto;" for="node-input-repair"><span data-i18n="switch.label.repair"></span></label></input>
|
||||
<label style="width: auto;" for="node-input-repair"><span data-i18n="switch.label.repair"></span></label>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<script type="text/html" data-template-name="range">
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="common.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:calc(70% - 1px)"/>
|
||||
<input type="text" id="node-input-property" style="width:calc(70% - 1px)">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-action"><i class="fa fa-dot-circle-o"></i> <span data-i18n="range.label.action"></span></label>
|
||||
@@ -13,23 +13,23 @@
|
||||
<option value="drop" data-i18n="range.scale.drop"></option>
|
||||
</select>
|
||||
</div>
|
||||
<br/>
|
||||
<br>
|
||||
<div class="form-row"><i class="fa fa-sign-in"></i> <span data-i18n="range.label.inputrange"></span>:</div>
|
||||
<div class="form-row"><label></label>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minin" data-i18n="[placeholder]range.placeholder.min" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxin" data-i18n="[placeholder]range.placeholder.maxin" style="width:100px;"/>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minin" data-i18n="[placeholder]range.placeholder.min" style="width:100px;">
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxin" data-i18n="[placeholder]range.placeholder.maxin" style="width:100px;">
|
||||
</div>
|
||||
<div class="form-row"><i class="fa fa-sign-out"></i> <span data-i18n="range.label.resultrange"></span>:</div>
|
||||
<div class="form-row"><label></label>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minout" data-i18n="[placeholder]range.placeholder.min" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxout" data-i18n="[placeholder]range.placeholder.maxout" style="width:100px;"/>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minout" data-i18n="[placeholder]range.placeholder.min" style="width:100px;">
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxout" data-i18n="[placeholder]range.placeholder.maxout" style="width:100px;">
|
||||
</div>
|
||||
<br/>
|
||||
<br>
|
||||
<div class="form-row"><label></label>
|
||||
<input type="checkbox" id="node-input-round" style="display: inline-block; width: auto; vertical-align: top;">
|
||||
<label style="width: auto;" for="node-input-round"><span data-i18n="range.label.roundresult"></span></label></input>
|
||||
<label style="width: auto;" for="node-input-round"><span data-i18n="range.label.roundresult"></span></label>
|
||||
</div>
|
||||
<br/>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<li><span data-i18n="trigger.label.resetPayload"></span> <input type="text" id="node-input-reset" style="width:150px" data-i18n="[placeholder]trigger.label.resetprompt"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<br/>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<label data-i18n="trigger.for" for="node-input-bytopic"></label>
|
||||
<select id="node-input-bytopic" style="width:120px;">
|
||||
@@ -71,12 +71,12 @@
|
||||
<option value="topic" data-i18n="trigger.bytopics"></option>
|
||||
</select>
|
||||
<span class="form-row" id="node-stream-topic">
|
||||
<input type="text" id="node-input-topic" style="width:46%;"/>
|
||||
<input type="text" id="node-input-topic" style="width:46%;">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name"></input>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
<input type="hidden" id="node-input-outputs" value="1">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
||||
<input type="text" id="node-input-property" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row" style="margin-bottom: 0px;">
|
||||
<label> </label>
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label> </label>
|
||||
<input type="text" id="node-input-topi" style="width:70%;"/>
|
||||
<input type="text" id="node-input-topi" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="rbe.label.name"></span></label>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
<div id="node-row-newline" class="form-row hidden" style="padding-left:110px;">
|
||||
<span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width:110px;" data-i18n="[placeholder]tcpin.label.optional"><br/>
|
||||
<span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width:110px;" data-i18n="[placeholder]tcpin.label.optional"><br>
|
||||
<input type="checkbox" id="node-input-trim" style="display:inline-block; width:auto; vertical-align:top;"> <span data-i18n="tcpin.label.reattach"></span>
|
||||
</div>
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
<span id="node-units"></span>
|
||||
</div>
|
||||
<div id="node-row-newline" class="form-row hidden" style="padding-left:162px;">
|
||||
<span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width:110px;" data-i18n="[placeholder]tcpin.label.optional"><br/>
|
||||
<span data-i18n="tcpin.label.delimited"></span> <input type="text" id="node-input-newline" style="width:110px;" data-i18n="[placeholder]tcpin.label.optional"><br>
|
||||
<input type="checkbox" id="node-input-trim" style="display:inline-block; width:auto; vertical-align:top;"> <span data-i18n="tcpin.label.reattach"></span>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
@@ -35,21 +35,21 @@
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
<hr align="middle"/>
|
||||
<hr align="middle">
|
||||
<div class="form-row">
|
||||
<label style="width:100%;"><span data-i18n="csv.label.c2o"></span></label>
|
||||
</div>
|
||||
<div class="form-row" style="padding-left:20px;">
|
||||
<label><i class="fa fa-sign-in"></i> <span data-i18n="csv.label.input"></span></label>
|
||||
<span data-i18n="csv.label.skip-s"></span> <input type="text" id="node-input-skip" style="width:40px; height:25px;"/> <span data-i18n="csv.label.skip-e"></span><br/>
|
||||
<span data-i18n="csv.label.skip-s"></span> <input type="text" id="node-input-skip" style="width:40px; height:25px;"> <span data-i18n="csv.label.skip-e"></span><br>
|
||||
<label> </label>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-hdrin"><label style="width:auto; margin-top:7px;" for="node-input-hdrin"><span data-i18n="csv.label.firstrow"></span></label><br/>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-hdrin"><label style="width:auto; margin-top:7px;" for="node-input-hdrin"><span data-i18n="csv.label.firstrow"></span></label><br>
|
||||
<label> </label>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-strings"><label style="width:auto; margin-top:7px;" for="node-input-strings"><span data-i18n="csv.label.usestrings"></span></label><br/>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-strings"><label style="width:auto; margin-top:7px;" for="node-input-strings"><span data-i18n="csv.label.usestrings"></span></label><br>
|
||||
<label> </label>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-include_empty_strings"><label style="width:auto; margin-top:7px;" for="node-input-include_empty_strings"><span data-i18n="csv.label.include_empty_strings"></span></label><br/>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-include_empty_strings"><label style="width:auto; margin-top:7px;" for="node-input-include_empty_strings"><span data-i18n="csv.label.include_empty_strings"></span></label><br>
|
||||
<label> </label>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-include_null_values"><label style="width:auto; margin-top:7px;" for="node-input-include_null_values"><span data-i18n="csv.label.include_null_values"></span></label><br/>
|
||||
<input style="width:20px; vertical-align:baseline; margin-right:5px;" type="checkbox" id="node-input-include_null_values"><label style="width:auto; margin-top:7px;" for="node-input-include_null_values"><span data-i18n="csv.label.include_null_values"></span></label><br>
|
||||
</div>
|
||||
<div class="form-row" style="padding-left:20px;">
|
||||
<label><i class="fa fa-sign-out"></i> <span data-i18n="csv.label.output"></span></label>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<label for="node-input-chr" style="width: 230px;"><i class="fa fa-tag"></i> <span data-i18n="html.label.prefix"></span></label>
|
||||
<input type="text" id="node-input-chr" style="text-align:center; width: 40px;" placeholder="_">
|
||||
</div>
|
||||
<br/>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" style="width:70%" data-i18n="[placeholder]common.label.name">
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="json.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
||||
<input type="text" id="node-input-property" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
<hr align="middle"/>
|
||||
<hr align="middle">
|
||||
<div class="form-row node-json-to-json-options">
|
||||
<label style="width:100%;"><span data-i18n="json.label.o2j"></span></label>
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<script type="text/html" data-template-name="xml">
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="common.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
||||
<input type="text" id="node-input-property" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
<hr align="middle"/>
|
||||
<hr align="middle">
|
||||
<div class="form-row">
|
||||
<label style="width:100%;"><span data-i18n="xml.label.x2o"></span></label>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<script type="text/html" data-template-name="yaml">
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="common.label.property"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
||||
<input type="text" id="node-input-property" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-property"><i class="fa fa-forward"></i> <span data-i18n="split.split"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;"/>
|
||||
<label for="node-input-property"><i class="fa fa-forward"></i> <span data-i18n="split.splitThe"></span></label>
|
||||
<input type="text" id="node-input-property" style="width:70%;">
|
||||
</div>
|
||||
<div class="form-row"><span data-i18n="[html]split.strBuff"></span></div>
|
||||
<div class="form-row">
|
||||
@@ -202,7 +202,7 @@
|
||||
<div class="form-row">
|
||||
<label> </label>
|
||||
<input type="checkbox" id="node-input-reduceRight" style="display:inline-block; width:auto; vertical-align:top; margin-left:10px;">
|
||||
<label for="node-input-reduceRight" style="width:70%;" data-i18n="join.reduce.right" style="margin-left:10px;"/>
|
||||
<label for="node-input-reduceRight" data-i18n="join.reduce.right" style="width:70%; margin-left:10px;"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-tips form-tips-auto hide" data-i18n="[html]join.tip"></div>
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
<label style="margin-left: 10px; width: 175px;" for="node-input-overlap" data-i18n="batch.count.overlap"></label>
|
||||
<input type="text" id="node-input-overlap" style="width: 50px;">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="checkbox" id="node-input-honourParts" style="margin-left: 10px; margin-right:10px; vertical-align:top; width:auto;">
|
||||
<label for="node-input-honourParts" style="width:auto;" data-i18n="batch.honourParts"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="node-row-msg-interval">
|
||||
@@ -45,7 +49,7 @@
|
||||
<span data-i18n="batch.interval.seconds"></span>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="checkbox" id="node-input-allowEmptySequence" style="margin-left:20px; margin-right: 10px; vertical-align:top; width:auto;">
|
||||
<input type="checkbox" id="node-input-allowEmptySequence" style="margin-left:20px; margin-right:10px; vertical-align:top; width:auto;">
|
||||
<label for="node-input-allowEmptySequence" style="width:auto;" data-i18n="batch.interval.empty"></label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,6 +105,7 @@
|
||||
}
|
||||
},
|
||||
allowEmptySequence: {value:false},
|
||||
honourParts: {value:false},
|
||||
topics: {value:[{topic:""}]}
|
||||
},
|
||||
inputs:1,
|
||||
|
||||
@@ -181,6 +181,8 @@ module.exports = function(RED) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var node = this;
|
||||
var mode = n.mode || "count";
|
||||
var eof = false;
|
||||
node.honourParts = n.honourParts || false;
|
||||
|
||||
node.pending_count = 0;
|
||||
if (mode === "count") {
|
||||
@@ -201,9 +203,12 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
var queue = node.pending;
|
||||
if (node.honourParts && msg.hasOwnProperty("parts")) {
|
||||
if (msg.parts.index + 1 === msg.parts.count) { eof = true; }
|
||||
}
|
||||
queue.push({msg, send, done});
|
||||
node.pending_count++;
|
||||
if (queue.length === count) {
|
||||
if (queue.length === count || eof === true) {
|
||||
send_msgs(node, queue, is_overlap);
|
||||
for (let i = 0; i < queue.length-overlap; i++) {
|
||||
queue[i].done();
|
||||
@@ -211,6 +216,7 @@ module.exports = function(RED) {
|
||||
node.pending =
|
||||
(overlap === 0) ? [] : queue.slice(-overlap);
|
||||
node.pending_count = 0;
|
||||
eof = false;
|
||||
}
|
||||
var max_msgs = max_kept_msgs_count(node);
|
||||
if ((max_msgs > 0) && (node.pending_count > max_msgs)) {
|
||||
|
||||
@@ -912,6 +912,7 @@
|
||||
"objectSend": "Sende eine Nachricht für jedes Schlüssel/Wert-Paar",
|
||||
"strBuff": "<b>string</b> / <b>buffer</b>",
|
||||
"array": "<b>array</b>",
|
||||
"splitThe": "Split",
|
||||
"splitUsing": "Aufteilung",
|
||||
"splitLength": "feste Längen von",
|
||||
"stream": "Als Nachrichtenstrom behandeln (Streaming-Modus)",
|
||||
|
||||
@@ -1011,12 +1011,13 @@
|
||||
"tip": "Tip: The filename should be an absolute path, otherwise it will be relative to the working directory of the Node-RED process."
|
||||
},
|
||||
"split": {
|
||||
"split": "Split",
|
||||
"split": "split",
|
||||
"intro": "Split <code>msg.payload</code> based on type:",
|
||||
"object": "<b>Object</b>",
|
||||
"objectSend": "Send a message for each key/value pair",
|
||||
"strBuff": "<b>String</b> / <b>Buffer</b>",
|
||||
"array": "<b>Array</b>",
|
||||
"splitThe": "Split the",
|
||||
"splitUsing": "Split using",
|
||||
"splitLength": "Fixed length of",
|
||||
"stream": "Handle as a stream of messages",
|
||||
@@ -1113,6 +1114,7 @@
|
||||
"too-many": "too many pending messages in batch node",
|
||||
"unexpected": "unexpected mode",
|
||||
"no-parts": "no parts property in message",
|
||||
"honourParts": "Allow msg.parts to also complete batch operation.",
|
||||
"error": {
|
||||
"invalid-count": "Invalid count",
|
||||
"invalid-overlap": "Invalid overlap",
|
||||
|
||||
@@ -1017,6 +1017,7 @@
|
||||
"objectSend": "各key/valueペアのメッセージを送信",
|
||||
"strBuff": "<b>文字列</b> / <b>バッファ</b>",
|
||||
"array": "<b>配列</b>",
|
||||
"splitThe": "に基づく",
|
||||
"splitUsing": "分割",
|
||||
"splitLength": "固定長",
|
||||
"stream": "メッセージのストリームとして処理",
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"global": "contexto global",
|
||||
"str": "Cadeia de caracteres",
|
||||
"num": "número",
|
||||
"bool": "booliano",
|
||||
"bool": "booliano",
|
||||
"json": "objeto",
|
||||
"bin": "Armazenamento temporário",
|
||||
"date": "Carimbo de data/hora",
|
||||
@@ -352,8 +352,8 @@
|
||||
}
|
||||
},
|
||||
"trigger": {
|
||||
"send": "Enviar",
|
||||
"then": "então",
|
||||
"send": "Enviar",
|
||||
"then": "então",
|
||||
"then-send": "então enviem",
|
||||
"output": {
|
||||
"string": "a cadeia de caracteres",
|
||||
@@ -446,7 +446,7 @@
|
||||
"staticTopic": "Assinar um tópico único",
|
||||
"dynamicTopic": "Assinatura dinâmica",
|
||||
"auto-connect": "Conectar automaticamente",
|
||||
"auto-mode-depreciated": "Esta opção está deprecada. Favor utilizar o novo modo de auto-detecção."
|
||||
"auto-mode-depreciated": "Esta opção está deprecada. Favor utilizar o novo modo de auto-detecção."
|
||||
},
|
||||
"sections-label": {
|
||||
"birth-message": "Mensagem enviada na conexão (mensagem de nascimento)",
|
||||
@@ -466,8 +466,8 @@
|
||||
"close-topic": "Deixe em branco para desativar a mensagem de fechamento"
|
||||
},
|
||||
"state": {
|
||||
"connected": "Conectado ao negociante: _ broker _",
|
||||
"disconnected": "Desconectado do negociante: _ broker _",
|
||||
"connected": "Conectado ao negociante: _ broker _",
|
||||
"disconnected": "Desconectado do negociante: _ broker _",
|
||||
"connect-failed": "Falha na conexão com o negociante: __broker__",
|
||||
"broker-disconnected": "Cliente de negociante __broker__ desconectado: __reasonCode__ __reasonString__"
|
||||
},
|
||||
@@ -898,7 +898,7 @@
|
||||
"o2j": "Objeto para opções JSON",
|
||||
"pretty": "Formatar cadeia de caracteres JSON",
|
||||
"action": "Ação",
|
||||
"property": "Propriedade",
|
||||
"property": "Propriedade",
|
||||
"actions": {
|
||||
"toggle": "Converter entre cadeia de caracteres JSON e Objeto",
|
||||
"str": "Sempre converter em cadeia de caracteres JSON",
|
||||
@@ -929,7 +929,7 @@
|
||||
"write": "escrever arquivo",
|
||||
"read": "ler arquivo",
|
||||
"filename": "Nome do arquivo",
|
||||
"path": "caminho",
|
||||
"path": "caminho",
|
||||
"action": "Ação",
|
||||
"addnewline": "Adicionar nova linha (\\n) a cada carga útil?",
|
||||
"createdir": "Criar diretório se não existir?",
|
||||
@@ -994,6 +994,7 @@
|
||||
"objectSend": "Envia uma mensagem para cada par chave/valor",
|
||||
"strBuff": "<b>Cadeia de caracteres</b> / <b>Armazenamento Temporário</b>",
|
||||
"array": "<b>Matriz</b>",
|
||||
"splitThe": "Dividir",
|
||||
"splitUsing": "Dividir usando",
|
||||
"splitLength": "Comprimento fixo de",
|
||||
"stream": "Tratar como uma transmissão de mensagens",
|
||||
@@ -1066,9 +1067,9 @@
|
||||
"batch" : {
|
||||
"batch": "lote",
|
||||
"mode": {
|
||||
"label": "Modo",
|
||||
"num-msgs": "Agrupar por número de mensagens",
|
||||
"interval": "Agrupar por intervalo de tempo",
|
||||
"label": "Modo",
|
||||
"num-msgs": "Agrupar por número de mensagens",
|
||||
"interval": "Agrupar por intervalo de tempo",
|
||||
"concat": "Concatenar sequências"
|
||||
},
|
||||
"count": {
|
||||
|
||||
@@ -874,6 +874,7 @@
|
||||
"objectSend":"Отправлять сообщение для каждой пары ключ/значение",
|
||||
"strBuff":"<b>Строка</b> / <b>Буфер</b>",
|
||||
"array":"<b>Массив</b>",
|
||||
"splitThe": "Pазделить",
|
||||
"splitUsing":"С помощью",
|
||||
"splitLength":"Фикс. длина",
|
||||
"stream":"Обрабатывать как поток сообщений",
|
||||
|
||||
@@ -997,6 +997,7 @@
|
||||
"objectSend": "每个键值对作为单个消息发送",
|
||||
"strBuff": "<b>字符串</b> / <b>Buffer</b>",
|
||||
"array": "<b>数组</b>",
|
||||
"splitThe": "Split",
|
||||
"splitUsing": "拆分使用",
|
||||
"splitLength": "固定长度",
|
||||
"stream": "作为消息流处理",
|
||||
|
||||
@@ -866,6 +866,7 @@
|
||||
"objectSend": "每個鍵值對作為單個消息發送",
|
||||
"strBuff": "<b>字串</b> / <b>Buffer</b>",
|
||||
"array": "<b>陣列</b>",
|
||||
"splitThe": "Split",
|
||||
"splitUsing": "拆分使用",
|
||||
"splitLength": "固定長度",
|
||||
"stream": "作為消息流處理",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/nodes",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/registry",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "4.0.2",
|
||||
"@node-red/util": "4.1.0-beta.0",
|
||||
"clone": "2.1.2",
|
||||
"fs-extra": "11.2.0",
|
||||
"semver": "7.5.4",
|
||||
|
||||
@@ -42,7 +42,7 @@ module.exports = {
|
||||
let user = opts.user
|
||||
if (!user || user.anonymous) {
|
||||
user = user || { anonymous: true }
|
||||
user.username = `Anon ${Math.floor(Math.random()*100)}`
|
||||
user.username = opts?.data?.name || `Anon ${Math.floor(Math.random()*100)}`
|
||||
}
|
||||
session = {
|
||||
session: opts.data.session,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/runtime",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/registry": "4.0.2",
|
||||
"@node-red/util": "4.0.2",
|
||||
"@node-red/registry": "4.1.0-beta.0",
|
||||
"@node-red/util": "4.1.0-beta.0",
|
||||
"async-mutex": "0.5.0",
|
||||
"clone": "2.1.2",
|
||||
"express": "4.19.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/util",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
10
packages/node_modules/node-red/package.json
vendored
10
packages/node_modules/node-red/package.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0-beta.0",
|
||||
"description": "Low-code programming for event-driven applications",
|
||||
"homepage": "https://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
@@ -31,10 +31,10 @@
|
||||
"flow"
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/editor-api": "4.0.2",
|
||||
"@node-red/runtime": "4.0.2",
|
||||
"@node-red/util": "4.0.2",
|
||||
"@node-red/nodes": "4.0.2",
|
||||
"@node-red/editor-api": "4.1.0-beta.0",
|
||||
"@node-red/runtime": "4.1.0-beta.0",
|
||||
"@node-red/util": "4.1.0-beta.0",
|
||||
"@node-red/nodes": "4.1.0-beta.0",
|
||||
"basic-auth": "2.0.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"cors": "2.8.5",
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('BATCH node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
check_data(n1, n2, results, done);
|
||||
for(var i = 0; i < 6; i++) {
|
||||
n1.receive({payload: i});
|
||||
n1.receive({payload: i, parts: { count:6, index:i }});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -168,6 +168,25 @@ describe('BATCH node', function() {
|
||||
check_count(flow, results, done);
|
||||
});
|
||||
|
||||
it('should create seq. with count (more sent than count)', function(done) {
|
||||
var flow = [{id:"n1", type:"batch", name: "BatchNode", mode: "count", count: 4, overlap: 0, interval: 10, allowEmptySequence: false, topics: [], wires:[["n2"]]},
|
||||
{id:"n2", type:"helper"}];
|
||||
var results = [
|
||||
[0, 1, 2, 3]
|
||||
];
|
||||
check_count(flow, results, done);
|
||||
});
|
||||
|
||||
it('should create seq. with count and terminate early if parts honoured', function(done) {
|
||||
var flow = [{id:"n1", type:"batch", name: "BatchNode", mode: "count", count: 4, overlap: 0, interval: 10, allowEmptySequence:false, honourParts:true, topics: [], wires:[["n2"]]},
|
||||
{id:"n2", type:"helper"}];
|
||||
var results = [
|
||||
[0, 1, 2, 3],
|
||||
[4, 5]
|
||||
];
|
||||
check_count(flow, results, done);
|
||||
});
|
||||
|
||||
it('should create seq. with count and overlap', function(done) {
|
||||
var flow = [{id:"n1", type:"batch", name: "BatchNode", mode: "count", count: 3, overlap: 2, interval: 10, allowEmptySequence: false, topics: [], wires:[["n2"]]},
|
||||
{id:"n2", type:"helper"}];
|
||||
@@ -455,7 +474,7 @@ describe('BATCH node', function() {
|
||||
function mapiDoneTestHelper(done, mode, count, overlap, interval, allowEmptySequence, msgAndTimings) {
|
||||
const completeNode = require("nr-test-utils").require("@node-red/nodes/core/common/24-complete.js");
|
||||
const catchNode = require("nr-test-utils").require("@node-red/nodes/core/common/25-catch.js");
|
||||
const flow = [{id:"batchNode1", type:"batch", name: "BatchNode", mode, count, overlap, interval,
|
||||
const flow = [{id:"batchNode1", type:"batch", name: "BatchNode", mode, count, overlap, interval,
|
||||
allowEmptySequence, topics: [{topic: "TA"}], wires:[[]]},
|
||||
{id:"completeNode1",type:"complete",scope: ["batchNode1"],uncaught:false,wires:[["helperNode1"]]},
|
||||
{id:"catchNode1", type:"catch",scope: ["batchNode1"],uncaught:false,wires:[["helperNode1"]]},
|
||||
@@ -482,13 +501,13 @@ describe('BATCH node', function() {
|
||||
}
|
||||
|
||||
it('should call done() when message is sent (mode: count)', function(done) {
|
||||
mapiDoneTestHelper(done, "count", 2, 0, 2, false, [
|
||||
mapiDoneTestHelper(done, "count", 2, 0, 2, false, [
|
||||
{ msg: {payload: 0}, delay: 0, avr: 0, var: 100},
|
||||
{ msg: {payload: 1}, delay: 0, avr: 0, var: 100}
|
||||
]);
|
||||
});
|
||||
it('should call done() when reset (mode: count)', function(done) {
|
||||
mapiDoneTestHelper(done, "count", 2, 0, 2, false, [
|
||||
mapiDoneTestHelper(done, "count", 2, 0, 2, false, [
|
||||
{ msg: {payload: 0}, delay: 0, avr: 200, var: 100},
|
||||
{ msg: {payload: 1, reset:true}, delay: 200, avr: 200, var: 100}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user