Archived
new file: monitoring/node-red/data/.config.nodes.json
new file: monitoring/node-red/data/.config.runtime.json new file: monitoring/node-red/data/.config.runtime.json.backup new file: monitoring/node-red/data/.config.users.json new file: monitoring/node-red/data/.config.users.json.backup new file: monitoring/node-red/data/.flows.json.backup new file: monitoring/node-red/data/.flows_cred.json.backup new file: monitoring/node-red/data/.npm/_cacache/content-v2/sha512/b0/47/c1458664fa9b6a08e9035110b523127a96bd7285d19472dc702f5dc498b927412b0ecd3273708fbf9d61754520599ac0b0e11f3e4c4d4ac784e78d7d97fe new file: monitoring/node-red/data/.npm/_cacache/content-v2/sha512/c2/c2/b64870ea5c5a42b5772106f51123cf684d3c8381de10ccc07d01168d111d0a1ab79ee26fda320b3027c76cfc856119f7b440845a83c9f22d7d731643e62f new file: monitoring/node-red/data/.npm/_cacache/index-v5/15/a4/2638498d877ec2c8c3d88cb9c08d7867c52d3fceb6fc64cc5abde73b01a9 new file: monitoring/node-red/data/.npm/_cacache/index-v5/48/03/b8903b717bbc1ad41b3f37148db48f54e0828c1aef870973f6672895d689 new file: monitoring/node-red/data/.npm/_logs/2026-04-05T01_36_15_515Z-debug-0.log new file: monitoring/node-red/data/context/00b02bbd01c91485/flow.json new file: monitoring/node-red/data/context/global/global.json new file: monitoring/node-red/data/flows.json new file: monitoring/node-red/data/flows_cred.json new file: monitoring/node-red/data/node_modules/.package-lock.json new file: monitoring/node-red/data/node_modules/node-red-debugger/CHANGELOG.md new file: monitoring/node-red/data/node_modules/node-red-debugger/LICENSE new file: monitoring/node-red/data/node_modules/node-red-debugger/README.md new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.html new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/flow-debugger.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/MessageQueue.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/MessageQueue.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/debugger.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/debugger.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/location.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/location.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/types.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/lib/types.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/locales/en-US/flow-debugger.json new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/locales/ja/flow-debugger.json new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/nr-types.js new file: monitoring/node-red/data/node_modules/node-red-debugger/dist/nr-types.js.map new file: monitoring/node-red/data/node_modules/node-red-debugger/package.json new file: monitoring/node-red/data/node_modules/node-red-debugger/resources/style.css new file: monitoring/node-red/data/package-lock.json new file: monitoring/node-red/data/package.json new file: monitoring/node-red/data/settings.js new file: monitoring/node-red/data/test-container.sh new file: monitoring/node-red/data/test-container.sh.old new file: monitoring/node-red/data/webhook.json
This commit is contained in:
1 parent
8c5a902613
commit
d519139615
43 files changed
+4621
No files matched your search
+19
@@ -0,0 +1,19 @@
|
||||
### 1.1.1
|
||||
|
||||
- Do not send full message object in messageQueued event Fixes #8
|
||||
|
||||
### 1.1.0
|
||||
|
||||
- Require Node-RED 2.0.0-beta.2
|
||||
- Allow debugger to pause just breakpoint nodes
|
||||
- Better display >99 message queue count on node annotation
|
||||
- Publish debugger state as retained to make resync easier
|
||||
- Add Japanese translations (#7) @kazuhitoyokoi
|
||||
|
||||
### 1.0.1
|
||||
|
||||
- Fix case sensitivity of filenames due to TypeScript being TypeScript
|
||||
|
||||
### 1.0.0
|
||||
|
||||
- First public release of the Flow Debugger
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
# Node-RED Flow Debugger
|
||||
|
||||
This module is a Plugin for Node-RED 2.x. It provides a flow debugger with the following
|
||||
features:
|
||||
|
||||
- set breakpoints on node inputs or outputs
|
||||
- pause the runtime manually or when a message arrives at a breakpoint
|
||||
- once paused you can:
|
||||
- inspect the queued up messages
|
||||
- step forward individual messages
|
||||
- drop messages
|
||||
|
||||
## Installation
|
||||
|
||||
Install this module in your Node-RED user directory or via the Palette Manager
|
||||
then restart Node-RED
|
||||
|
||||
npm install node-red-debugger
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
The Flow Debugger adds a new sidebar tab in the editor. Select it from the dropdown
|
||||
menu.
|
||||
|
||||
By default, the debugger is disabled. Click the 'disabled' toggle button to enable it.
|
||||
|
||||
The sidebar has two sections - a list of the breakpoints you have set and a list
|
||||
of any messages queued up in the runtime.
|
||||
|
||||
### Working with breakpoints
|
||||
|
||||
With the debugger enabled, when you hover over a node's port a breakpoint indicator
|
||||
will appear. Move your mouse over the indicator and click once - it will turn solid blue
|
||||
and an entry will appear in the sidebar.
|
||||
|
||||
If you click on it again, the breakpoint will be deactivated but remain in place (light blue).
|
||||
|
||||
Clicking on it again will remove the breakpoint entirely (dotted outline).
|
||||
|
||||
You can also deactive a breakpoint using its checkbox in the sidebar, and remove it by
|
||||
clicking the `x` button.
|
||||
|
||||
### Pausing the runtime
|
||||
|
||||
The runtime will by paused whenever a message arrives at an active breakpoint. You
|
||||
can also manually pause the runtime using the pause button in the sidebar.
|
||||
|
||||
Once paused, the flow will show how many messages are queued up at each node input
|
||||
and output. Those messages will also be listed in the sidebar - in the order the
|
||||
runtime will process them.
|
||||
|
||||
If you click the step button at the top of the sidebar, the runtime will process
|
||||
the next message in the list. You can step individual messages by clicking the
|
||||
step button that appears when you hover over the message.
|
||||
|
||||
You can also delete any message from the queue by clicking its delete button. This
|
||||
will prevent the message from passing any further in the flow.
|
||||
|
||||
You can click the play button to resume the flows.
|
||||
|
||||
|
||||
## Limitations
|
||||
|
||||
- Due to the way Subflows work, breakpoints on Subflow outputs will be ignored
|
||||
|
||||
## Roadmap
|
||||
|
||||
- Set conditions on individual breakpoints
|
||||
- Allow queued messages to be edited
|
||||
- Pause only selected nodes/flows/groups
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
This plugin has been developed using TypeScript. This means that when running
|
||||
from the source code rather than npm, it must first be built.
|
||||
|
||||
git clone https://github.com/node-red/node-red-debugger.git
|
||||
cd node-red-debugger
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
This will generate all of the plugin files in the `dist` folder - which is where
|
||||
Node-RED will expect to load the files from.
|
||||
|
||||
|
||||
Then, in your Node-RED user directory (`~/.node-red`) run:
|
||||
|
||||
npm install `<path to node-red-debugger directory>`
|
||||
|
||||
### Themeing
|
||||
|
||||
The Debugger sidebar will use the active Node-RED theme. For the breakpoints
|
||||
drawn within the flow workspace, the following CSS variables will be used if they
|
||||
are set by the active theme.
|
||||
|
||||
- `--red-ui-flow-debugger-breakpoint-fill`
|
||||
- `--red-ui-flow-debugger-breakpoint-stroke`
|
||||
- `--red-ui-flow-debugger-breakpoint-active-fill`
|
||||
- `--red-ui-flow-debugger-breakpoint-active-stroke`
|
||||
- `--red-ui-flow-debugger-breakpoint-inactive-fill`
|
||||
- `--red-ui-flow-debugger-breakpoint-inactive-stroke`
|
||||
- `--red-ui-flow-debugger-breakpoint-label`
|
||||
- `--red-ui-flow-debugger-breakpoint-label-active`
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
<link rel="stylesheet" href="resources/node-red-debugger/style.css">
|
||||
<script type="text/javascript">!function(){var z;function B(){RED.sidebar.show("flow-debugger")}RED.view.annotations?RED.plugins.registerPlugin("node-red-debugger",{onadd:function(){function c(e){var t=/^(.*?)\/([^\/\[]+)\[(i|o)\]\[(\d+)\]$/.exec(e),o=RED.nodes.node(t[2]);return{location:e,z:o?o.z:null,path:t[1],id:t[2],portType:"i"===t[3]?"input":"output",portIndex:t[4]}}function d(e,t){h[e.id]=h[e.id]||{input:{},output:{}},h[e.id][e.portType][e.portIndex]!==t&&(h[e.id][e.portType][e.portIndex]=t,!v[e.id]||(e=v[e.id][e.portType][e.portIndex])&&(e.pulse(),0<t?(e.el.classList.add("hasMessages"),t<100?(e.label.classList.remove("small"),e.label.textContent=t):(e.label.classList.add("small"),e.label.textContent=t<1e3?t:"999+")):(e.el.classList.remove("hasMessages"),e.label.textContent="")))}function e(o){if(b[o.id]&&b[o.id].forEach(function(e){var t=RED.utils.createNodeIcon(o,!0);e.listLabel.replaceWith(t),e.listLabel=t}),f[o.id])for(var e in f[o.id]){var t;f[o.id].hasOwnProperty(e)&&(t=RED.utils.createNodeIcon(o,!0),f[o.id][e].listLabel.replaceWith(t),f[o.id][e].listLabel=t)}(u.has("*")||u.has(o.id))&&(o._debugger_paused=!0)}function o(e){var t,o,a,n;if(s=e,u=new Set(e.pausedLocations||[]),s.paused=0<u.size,p!==e.enabled&&(m=!0,E.prop("checked",!!e.enabled).trigger("change"),m=!1),0<u.size?P():l&&O(),e.breakpoints&&(t=Object.keys(r),o={},a={},n={},e.breakpoints.forEach(function(e){var t;r.hasOwnProperty(e.id)?(t=r[e.id]).active!==e.active?(n[e.id]=e,t.setActive(e.active,!0)):a[e.id]=e:(T.editableList("addItem",e),o[e.id]=e)}),t.filter(function(e){return!a[e]&&!n[e]}).forEach(function(e){T.editableList("removeItem",r[e])})),e.queues)for(var i in e.queues)e.queues.hasOwnProperty(i)&&d(c(i),e.queues[i].depth)}function g(e,t){e={url:"flow-debugger/"+e,type:"POST",error:function(e,t,o){console.log(e,t,o)}};t&&(e.contentType="application/json",e.data=JSON.stringify(t)),$.ajax(e)}var s,l,r={},b={},f={},v={},h={},w={},u=new Set,p=!1,m=!1;z=$("<div>").addClass("red-ui-flow-debugger disabled").css({position:"relative",height:"100%"});var t=$("<div></div>");RED.sidebar.addTab({id:"flow-debugger",label:RED._("node-red-debugger/flow-debugger:label.debuggerShort"),name:RED._("node-red-debugger/flow-debugger:label.debugger"),iconClass:"fa fa-flask",content:z,toolbar:t,enableOnEdit:!0,action:"core:show-flow-debugger-tab"});var a=$("<div>",{class:"red-ui-sidebar-header"}).appendTo(z),n=$("<span>").css({"flex-grow":1,"text-align":"left"}).appendTo(a),t=$("<span>",{class:"red-ui-flow-debugger-toolbar"}).appendTo(a),a=$("<span>",{class:"button-group"}).appendTo(t),t=$("<span>",{class:"button-group"}).appendTo(t),E=$('<input type="checkbox"/>').appendTo(n).toggleButton({enabledIcon:"fa-toggle-on",disabledIcon:"fa-toggle-off",baseClass:"red-ui-sidebar-header-button"}).on("change",function(){p=this.checked,m?z.toggleClass("disabled",!p):$.ajax({url:"flow-debugger",contentType:"application/json",type:"PUT",data:JSON.stringify({enabled:p}),success:function(e){z.toggleClass("disabled",!p)},error:function(e,t,o){console.log(e,t,o)}}),p?(RED.hooks.add("viewAddPort.flow-debugger",function(e){M(e.node,e.portType,e.portIndex,e.port)}),RED.hooks.add("viewRemovePort.flow-debugger",function(e){delete v[e.node.id][e.portType][e.portIndex]}),RED.hooks.add("viewRemoveNode.flow-debugger",function(e){delete v[e.node.id]}),RED.view.annotations.register("red-ui-flow-debugger-paused",{type:"badge",class:"red-ui-flow-debugger-annotation-paused",show:"_debugger_paused",element:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","g");e.setAttribute("transform","translate(0,-2)");var t=document.createElementNS("http://www.w3.org/2000/svg","rect");t.setAttribute("rx",2),t.setAttribute("width",12),t.setAttribute("height",12),t.setAttribute("fill","white"),t.setAttribute("stroke-width","1");var o=document.createElementNS("http://www.w3.org/2000/svg","path");return o.setAttribute("d","M 4 2 v 8 M 8 2 v 8"),o.setAttribute("stroke-width","3"),e.appendChild(t),e.appendChild(o),e}}),q(".red-ui-flow-port-output"),q(".red-ui-flow-port-input")):(T.editableList("empty"),N.editableList("empty"),RED.hooks.remove("*.flow-debugger"),$(".red-ui-flow-debugger-port-overlay").each(function(){var e=$(this).parent()[0];e.removeEventListener("mouseenter",e.__breakpoint__.onenter),e.removeEventListener("mouseleave",e.__breakpoint__.onleave),$(this).remove()}),r={},b={},v={},h={},w={},RED.view.annotations.unregister("red-ui-flow-debugger-paused"))}),n=$('<button type="button" class="red-ui-sidebar-header-button red-ui-flow-debugger-btn-pauseresume"><i class="fa fa-pause"/></button>').appendTo(a).on("click",function(e){s.paused?g("resume"):g("pause")});RED.popover.tooltip(n,function(){return RED._("node-red-debugger/flow-debugger:label."+(s.paused?"resume":"pause"))});a=$('<button type="button" disabled class="red-ui-sidebar-header-button red-ui-flow-debugger-btn-step"><i class="fa fa-step-forward"/></button>').appendTo(a).on("click",function(e){g("step")});REDLine truncated
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const debugger_1 = require("./lib/debugger");
|
||||
const location_1 = require("./lib/location");
|
||||
module.exports = (RED) => {
|
||||
const apiRoot = "/flow-debugger";
|
||||
RED.plugins.registerPlugin("node-red-debugger", {
|
||||
onadd: () => {
|
||||
const flowDebugger = new debugger_1.Debugger(RED);
|
||||
const routeAuthHandler = RED.auth.needsPermission("flow-debugger.write");
|
||||
RED.comms.publish("flow-debugger/connected", true, true);
|
||||
function publishState() {
|
||||
RED.comms.publish("flow-debugger/state", flowDebugger.getState());
|
||||
}
|
||||
flowDebugger.on("paused", (event) => {
|
||||
RED.comms.publish("flow-debugger/paused", event);
|
||||
});
|
||||
flowDebugger.on("resumed", (event) => {
|
||||
RED.comms.publish("flow-debugger/resumed", event);
|
||||
});
|
||||
flowDebugger.on("messageQueued", (event) => {
|
||||
// Don't include the full message on the event
|
||||
// event.msg = RED.util.encodeObject({msg:event.msg}, {maxLength: 100});
|
||||
delete event.msg;
|
||||
RED.comms.publish("flow-debugger/messageQueued", event);
|
||||
});
|
||||
flowDebugger.on("messageDispatched", (event) => {
|
||||
RED.comms.publish("flow-debugger/messageDispatched", event);
|
||||
});
|
||||
// flowDebugger.on("step", (event) => {
|
||||
//
|
||||
// });
|
||||
RED.httpAdmin.get(`${apiRoot}`, (_, res) => {
|
||||
res.json(flowDebugger.getState());
|
||||
});
|
||||
RED.httpAdmin.put(`${apiRoot}`, routeAuthHandler, (req, res) => {
|
||||
let stateChanged = false;
|
||||
if (req.body.hasOwnProperty("enabled")) {
|
||||
const enabled = !!req.body.enabled;
|
||||
if (enabled && !flowDebugger.enabled) {
|
||||
flowDebugger.enable();
|
||||
stateChanged = true;
|
||||
}
|
||||
else if (!enabled && flowDebugger.enabled) {
|
||||
flowDebugger.disable();
|
||||
stateChanged = true;
|
||||
}
|
||||
}
|
||||
if (req.body.hasOwnProperty("config")) {
|
||||
stateChanged = flowDebugger.setConfig(req.body.config);
|
||||
}
|
||||
if (stateChanged) {
|
||||
publishState();
|
||||
}
|
||||
res.json(flowDebugger.getState());
|
||||
});
|
||||
RED.httpAdmin.get(`${apiRoot}/breakpoints`, routeAuthHandler, (_, res) => {
|
||||
res.json(flowDebugger.getBreakpoints());
|
||||
});
|
||||
RED.httpAdmin.put(`${apiRoot}/breakpoints/:id`, routeAuthHandler, (req, res) => {
|
||||
flowDebugger.setBreakpointActive(req.params.id, req.body.active);
|
||||
res.json(flowDebugger.getBreakpoint(req.params.id));
|
||||
});
|
||||
RED.httpAdmin.delete(`${apiRoot}/breakpoints/:id`, routeAuthHandler, (req, res) => {
|
||||
flowDebugger.clearBreakpoint(req.params.id);
|
||||
res.sendStatus(200);
|
||||
});
|
||||
RED.httpAdmin.post(`${apiRoot}/breakpoints`, routeAuthHandler, (req, res) => {
|
||||
// req.body.location
|
||||
const breakpointId = flowDebugger.setBreakpoint(new location_1.Location(req.body.id, req.body.path, req.body.portType, req.body.portIndex));
|
||||
res.json(flowDebugger.getBreakpoint(breakpointId));
|
||||
});
|
||||
RED.httpAdmin.get(`${apiRoot}/messages`, routeAuthHandler, (_, res) => {
|
||||
res.json(Array.from(flowDebugger.getMessageQueue()).map(m => {
|
||||
const result = {
|
||||
id: m.id,
|
||||
location: m.location.toString(),
|
||||
destination: undefined,
|
||||
msg: RED.util.encodeObject({ msg: m.event.msg }, { maxLength: 100 })
|
||||
};
|
||||
if (m.event.hasOwnProperty('source')) {
|
||||
// SendEvent - so include the destination location id
|
||||
result.destination = m.event.destination.id + "[i][0]";
|
||||
}
|
||||
return result;
|
||||
}));
|
||||
});
|
||||
RED.httpAdmin.get(`${apiRoot}/messages/:id`, routeAuthHandler, (req, res) => {
|
||||
const id = req.params.id;
|
||||
const messageEvent = flowDebugger.getMessageQueue().get(parseInt(id, 10));
|
||||
if (messageEvent) {
|
||||
const result = {
|
||||
id: messageEvent.id,
|
||||
location: messageEvent.location,
|
||||
destination: undefined,
|
||||
msg: RED.util.encodeObject({ msg: messageEvent.event.msg }, { maxLength: 100 })
|
||||
};
|
||||
if (messageEvent.event.hasOwnProperty('source')) {
|
||||
// SendEvent - so include the destination location id
|
||||
result.destination = messageEvent.event.destination.id + "[i][0]";
|
||||
}
|
||||
res.json(result);
|
||||
}
|
||||
else {
|
||||
res.sendStatus(404);
|
||||
}
|
||||
});
|
||||
RED.httpAdmin.delete(`${apiRoot}/messages/:id`, routeAuthHandler, (req, res) => {
|
||||
flowDebugger.deleteMessage(parseInt(req.params.id, 10));
|
||||
res.sendStatus(200);
|
||||
});
|
||||
RED.httpAdmin.post(`${apiRoot}/pause`, routeAuthHandler, (_, res) => {
|
||||
flowDebugger.pause();
|
||||
res.sendStatus(200);
|
||||
});
|
||||
RED.httpAdmin.post(`${apiRoot}/step`, routeAuthHandler, (req, res) => {
|
||||
let stepMessage = null;
|
||||
if (req.body && req.body.message) {
|
||||
stepMessage = req.body.message;
|
||||
}
|
||||
flowDebugger.step(stepMessage);
|
||||
res.sendStatus(200);
|
||||
});
|
||||
RED.httpAdmin.post(`${apiRoot}/resume`, routeAuthHandler, (_, res) => {
|
||||
flowDebugger.resume();
|
||||
res.sendStatus(200);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
|
||||
/flow-debugger/enable
|
||||
/flow-debugger/disable
|
||||
/flow-debugger/breakpoint
|
||||
|
||||
|
||||
|
||||
*/
|
||||
//# sourceMappingURL=flow-debugger.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flow-debugger.js","sourceRoot":"","sources":["../src/flow-debugger.ts"],"names":[],"mappings":";;AAAA,6CAAuC;AAEvC,6CAAuC;AAEvC,MAAM,CAAC,OAAO,GAAG,CAAC,GAAO,EAAE,EAAE;IAEzB,MAAM,OAAO,GAAG,gBAAgB,CAAC;IAEjC,GAAG,CAAC,OAAO,CAAC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AE,EAAC,SAAS,EAAE,GAAG,EAAC,CAAC;qBAC7E,CAAA;oBACD,IAAI,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;wBAC7C,qDAAqD;wBACrD,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,GAAC,QAAQ,CAAA;qBAClE;oBACD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;iBACnB;qBAAM;oBACH,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;iBACvB;YACL,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,OAAO,eAAe,EAAE,gBAAgB,EAAE,CAAC,GAAO,EAAE,GAAO,EAAE,EAAE;gBACnF,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,CAAC;gBACvD,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAGLine truncated
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MessageQueue = void 0;
|
||||
class MessageQueue {
|
||||
constructor(queueName) {
|
||||
this.queueName = queueName;
|
||||
this.previousName = `previousBy${queueName}`;
|
||||
this.nextName = `nextBy${queueName}`;
|
||||
this.length = 0;
|
||||
}
|
||||
enqueue(event) {
|
||||
if (!this.head) {
|
||||
this.head = event;
|
||||
}
|
||||
event[this.previousName] = this.tail;
|
||||
if (this.tail) {
|
||||
this.tail[this.nextName] = event;
|
||||
}
|
||||
this.tail = event;
|
||||
this.length++;
|
||||
}
|
||||
next() {
|
||||
const result = this.head;
|
||||
if (result) {
|
||||
this.remove(result);
|
||||
this.length--;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
peek() {
|
||||
return this.head;
|
||||
}
|
||||
get(id) {
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
if (p.id === id) {
|
||||
return p;
|
||||
}
|
||||
p = p[this.nextName];
|
||||
}
|
||||
}
|
||||
remove(event) {
|
||||
const previousEvent = event[this.previousName];
|
||||
const nextEvent = event[this.nextName];
|
||||
if (previousEvent) {
|
||||
previousEvent[this.nextName] = nextEvent;
|
||||
}
|
||||
else {
|
||||
this.head = nextEvent;
|
||||
}
|
||||
if (nextEvent) {
|
||||
nextEvent[this.previousName] = previousEvent;
|
||||
}
|
||||
else {
|
||||
this.tail = previousEvent;
|
||||
}
|
||||
this.length--;
|
||||
}
|
||||
*[Symbol.iterator]() {
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
yield p;
|
||||
p = p[this.nextName];
|
||||
}
|
||||
}
|
||||
dump() {
|
||||
let result = `MessageQueue ${this.queueName} [${this.length}]
|
||||
head: ${this.head.id}
|
||||
tail: ${this.tail.id}
|
||||
list: `;
|
||||
let p = this.head;
|
||||
while (p) {
|
||||
result = result + p.id;
|
||||
p = p[this.nextName];
|
||||
if (p) {
|
||||
result += " > ";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
exports.MessageQueue = MessageQueue;
|
||||
//# sourceMappingURL=MessageQueue.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MessageQueue.js","sourceRoot":"","sources":["../../src/lib/MessageQueue.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY;IAQrB,YAAY,SAAgB;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,aAAa,SAAS,EAAE,CAAA;QAC5C,IAAI,CAAC,QAAQ,GAAG,SAAS,SAAS,EAAE,CAAA;QACpC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,KAAkB;QACtB,IAAI,CAAC,IAAI,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AAC;SAChD;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;SAC7B;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IACD,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QACd,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAClB,OAAM,CAAC,EAAE;YACL,MAAM,CAAC,CAAC;YACR,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACxB;IACL,CAAC;IACD,IAAI;QACA,IAAI,MAAM,GAAG,gBAAgB,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,MAAM;UACzD,IAAI,CAAC,IAAI,CAAC,EAAE;UACZ,IAAI,CAAC,IAAI,CAAC,EAAE;SACb,CAAC;QACF,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAClB,OAAM,CAAC,EAAE;YACL,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;YACvB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,IAAI,CAAC,EAAE;gBACH,MAAM,IAAI,KAAK,CAAC;aACnB;SACJ;QACD,OAAO,MAAM,CAAA;IAEjB,CAAC;CACJ;AAnFD,oCAmFC"}
|
||||
+370
@@ -0,0 +1,370 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Debugger = void 0;
|
||||
const Location = __importStar(require("./location"));
|
||||
const MessageQueue_1 = require("./MessageQueue");
|
||||
const events_1 = require("events");
|
||||
const DEBUGGER_PAUSED = Symbol("node-red-debugger: paused");
|
||||
let BREAKPOINT_ID = 1;
|
||||
class Debugger extends events_1.EventEmitter {
|
||||
// Events:
|
||||
// paused / resumed
|
||||
constructor(RED) {
|
||||
super();
|
||||
this.config = {
|
||||
breakpointAction: "pause-all"
|
||||
};
|
||||
this.RED = RED;
|
||||
this.enabled = false;
|
||||
this.breakpoints = new Map();
|
||||
this.pausedLocations = new Set();
|
||||
this.breakpointsByLocation = new Map();
|
||||
this.queuesByLocation = {};
|
||||
this.messageQueue = new MessageQueue_1.MessageQueue("Time");
|
||||
this.eventNumber = 0;
|
||||
}
|
||||
log(message) {
|
||||
this.RED.log.info(`[flow-debugger] ${message}`);
|
||||
}
|
||||
checkLocation(location, event, done) {
|
||||
const breakpointId = location.getBreakpointLocation();
|
||||
if (this.isNodePaused(location.id)) {
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
if (event.msg && event.msg[DEBUGGER_PAUSED]) {
|
||||
this.pause({
|
||||
reason: "step",
|
||||
node: location.id
|
||||
});
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
const bp = this.breakpointsByLocation.get(breakpointId);
|
||||
if (bp && bp.active) {
|
||||
this.pause({
|
||||
reason: "breakpoint",
|
||||
node: location.id,
|
||||
breakpoint: bp.id
|
||||
});
|
||||
this.queueEvent(location, event, done);
|
||||
}
|
||||
else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
enable() {
|
||||
this.log("Enabled");
|
||||
this.enabled = true;
|
||||
this.RED.hooks.add("preRoute.flow-debugger", (sendEvent, done) => {
|
||||
if (isNodeInSubflowModule(sendEvent.source.node)) {
|
||||
// Inside a subflow module - don't pause the event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (sendEvent.source.node._flow.TYPE !== "flow" && sendEvent.source.node.id === sendEvent.source.node._flow.id) {
|
||||
// This is the subflow output which, in the current implementation
|
||||
// means the message is actually about to be routed to the first node
|
||||
// inside the subflow, not the output of actual subflow.
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (sendEvent.cloneMessage) {
|
||||
sendEvent.msg = this.RED.util.cloneMessage(sendEvent.msg);
|
||||
sendEvent.cloneMessage = false;
|
||||
}
|
||||
const eventLocation = Location.createLocation(sendEvent);
|
||||
// console.log("preRoute",eventLocation.toString());
|
||||
this.checkLocation(eventLocation, sendEvent, done);
|
||||
});
|
||||
this.RED.hooks.add("onReceive.flow-debugger", (receiveEvent, done) => {
|
||||
if (receiveEvent.destination.node.type === "inject") {
|
||||
// Never pause an Inject node's internal receive event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
if (isNodeInSubflowModule(receiveEvent.destination.node)) {
|
||||
// Inside a subflow module - don't pause the event
|
||||
done();
|
||||
return;
|
||||
}
|
||||
const eventLocation = Location.createLocation(receiveEvent);
|
||||
// console.log("onReceive",eventLocation.toString());
|
||||
this.checkLocation(eventLocation, receiveEvent, done);
|
||||
});
|
||||
}
|
||||
disable() {
|
||||
this.log("Disabled");
|
||||
this.enabled = false;
|
||||
this.RED.hooks.remove("*.flow-debugger");
|
||||
this.pausedLocations.clear();
|
||||
this.drainQueues(true);
|
||||
}
|
||||
pause(event) {
|
||||
if (this.enabled) {
|
||||
let logReason;
|
||||
if (event) {
|
||||
if (this.config.breakpointAction === "pause-all") {
|
||||
this.pausedLocations.clear();
|
||||
this.pausedLocations.add("*");
|
||||
}
|
||||
else {
|
||||
this.pausedLocations.add(event.node);
|
||||
}
|
||||
if (event.reason === "breakpoint") {
|
||||
logReason = "@" + this.breakpoints.get(event.breakpoint).location.toString();
|
||||
}
|
||||
else if (event.reason === "step") {
|
||||
logReason = "@" + event.node;
|
||||
}
|
||||
event.pausedLocations = [...this.pausedLocations];
|
||||
}
|
||||
else {
|
||||
// Manual pause
|
||||
this.pausedLocations.clear();
|
||||
this.pausedLocations.add("*");
|
||||
logReason = "manual";
|
||||
}
|
||||
this.log(`Flows paused: ${logReason}`);
|
||||
this.emit("paused", event || { reason: "manual" });
|
||||
}
|
||||
}
|
||||
resume(nodeId) {
|
||||
if (this.pausedLocations.size === 0) {
|
||||
return;
|
||||
}
|
||||
if (!nodeId || nodeId === "*") {
|
||||
console.log("resume - clear all locations");
|
||||
this.pausedLocations.clear();
|
||||
}
|
||||
else if (nodeId && this.pausedLocations.has(nodeId)) {
|
||||
this.pausedLocations.delete(nodeId);
|
||||
}
|
||||
else {
|
||||
// Nothing has been unpaused
|
||||
return;
|
||||
}
|
||||
this.log("Flows resumed");
|
||||
this.emit("resumed", { node: nodeId });
|
||||
this.drainQueues();
|
||||
}
|
||||
deleteMessage(messageId) {
|
||||
const nextEvent = this.messageQueue.get(messageId);
|
||||
if (nextEvent) {
|
||||
this.messageQueue.remove(nextEvent);
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
// Call done with false to prevent any further processing
|
||||
nextEvent.done(false);
|
||||
}
|
||||
}
|
||||
isNodePaused(nodeId) {
|
||||
return this.pausedLocations.has("*") || this.pausedLocations.has(nodeId);
|
||||
}
|
||||
drainQueues(quiet) {
|
||||
for (const nextEvent of this.messageQueue) {
|
||||
const eventNodeId = nextEvent.location.id;
|
||||
if (!this.isNodePaused(eventNodeId)) {
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
if (!quiet) {
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
}
|
||||
if (nextEvent.event.msg[DEBUGGER_PAUSED]) {
|
||||
delete nextEvent.event.msg[DEBUGGER_PAUSED];
|
||||
}
|
||||
nextEvent.done();
|
||||
this.messageQueue.remove(nextEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
setBreakpoint(location) {
|
||||
const bp = {
|
||||
id: (BREAKPOINT_ID++) + "",
|
||||
location,
|
||||
active: true,
|
||||
mode: "all"
|
||||
};
|
||||
this.breakpoints.set(bp.id, bp);
|
||||
this.breakpointsByLocation.set(location.toString(), bp);
|
||||
return bp.id;
|
||||
}
|
||||
getBreakpoint(breakpointId) {
|
||||
return this.breakpoints.get(breakpointId);
|
||||
}
|
||||
setBreakpointActive(breakpointId, state) {
|
||||
const bp = this.breakpoints.get(breakpointId);
|
||||
if (bp) {
|
||||
bp.active = state;
|
||||
}
|
||||
}
|
||||
clearBreakpoint(breakpointId) {
|
||||
const bp = this.breakpoints.get(breakpointId);
|
||||
if (bp) {
|
||||
this.breakpoints.delete(breakpointId);
|
||||
this.breakpointsByLocation.delete(bp.location.toString());
|
||||
}
|
||||
}
|
||||
getBreakpoints() {
|
||||
return Array.from(this.breakpoints.values());
|
||||
}
|
||||
step(messageId) {
|
||||
if (this.enabled) {
|
||||
let nextEvent;
|
||||
if (messageId) {
|
||||
nextEvent = this.messageQueue.get(messageId);
|
||||
if (nextEvent) {
|
||||
this.messageQueue.remove(nextEvent);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nextEvent = this.messageQueue.next();
|
||||
}
|
||||
if (nextEvent) {
|
||||
const nextEventLocation = nextEvent.location.toString();
|
||||
this.log("Step: " + nextEventLocation);
|
||||
this.queuesByLocation[nextEventLocation].remove(nextEvent);
|
||||
const queueDepth = this.queuesByLocation[nextEventLocation].length;
|
||||
if (queueDepth === 0) {
|
||||
delete this.queuesByLocation[nextEventLocation];
|
||||
}
|
||||
nextEvent.event.msg[DEBUGGER_PAUSED] = true;
|
||||
this.emit("messageDispatched", { id: nextEvent.id, location: nextEventLocation, depth: queueDepth });
|
||||
nextEvent.done();
|
||||
}
|
||||
}
|
||||
}
|
||||
setConfig(newConfig) {
|
||||
let changed = false;
|
||||
for (const key in this.config) {
|
||||
if (newConfig.hasOwnProperty(key) && this.config[key] !== newConfig[key]) {
|
||||
changed = true;
|
||||
this.config[key] = newConfig[key];
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
getState() {
|
||||
if (!this.enabled) {
|
||||
return { enabled: false };
|
||||
}
|
||||
return {
|
||||
enabled: true,
|
||||
pausedLocations: [...this.pausedLocations],
|
||||
config: this.config,
|
||||
breakpoints: this.getBreakpoints(),
|
||||
queues: this.getMessageQueueDepths()
|
||||
};
|
||||
}
|
||||
getMessageSummary() {
|
||||
return Array.from(this.messageQueue).map(m => {
|
||||
return {
|
||||
id: m.id,
|
||||
location: m.location
|
||||
};
|
||||
});
|
||||
}
|
||||
getMessageQueue() {
|
||||
return this.messageQueue;
|
||||
}
|
||||
getMessageQueueDepths() {
|
||||
if (!this.enabled) {
|
||||
return {};
|
||||
}
|
||||
const result = {};
|
||||
for (const [locationId, queue] of Object.entries(this.queuesByLocation)) {
|
||||
result[locationId] = { depth: queue.length };
|
||||
}
|
||||
return result;
|
||||
}
|
||||
dump() {
|
||||
let result = `Debugger State
|
||||
---
|
||||
${this.messageQueue.dump()}
|
||||
`;
|
||||
const locationIds = Object.keys(this.queuesByLocation);
|
||||
locationIds.forEach(id => {
|
||||
result += `---
|
||||
Location: ${id}
|
||||
${this.queuesByLocation[id].dump()}
|
||||
`;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
queueEvent(location, event, done) {
|
||||
const locationId = location.toString();
|
||||
if (!this.queuesByLocation[locationId]) {
|
||||
this.queuesByLocation[locationId] = new MessageQueue_1.MessageQueue("Location");
|
||||
}
|
||||
const messageEvent = {
|
||||
id: this.eventNumber++,
|
||||
event,
|
||||
location,
|
||||
done,
|
||||
nextByLocation: null,
|
||||
previousByLocation: null,
|
||||
nextByTime: null,
|
||||
previousByTime: null
|
||||
};
|
||||
this.queuesByLocation[locationId].enqueue(messageEvent);
|
||||
this.messageQueue.enqueue(messageEvent);
|
||||
const queuedEvent = {
|
||||
id: messageEvent.id,
|
||||
location: locationId,
|
||||
msg: event.msg,
|
||||
depth: this.queuesByLocation[locationId].length,
|
||||
destination: null,
|
||||
};
|
||||
if (event.hasOwnProperty('source')) {
|
||||
// SendEvent - so include the destination location id
|
||||
queuedEvent.destination = "/" + event.destination.id + "[i][0]";
|
||||
}
|
||||
this.emit("messageQueued", queuedEvent);
|
||||
}
|
||||
}
|
||||
exports.Debugger = Debugger;
|
||||
const MODULE_TYPE_RE = /^module:/;
|
||||
function isNodeInSubflowModule(node) {
|
||||
let f = node._flow;
|
||||
do {
|
||||
if (f.TYPE === "flow") {
|
||||
return false;
|
||||
}
|
||||
if (MODULE_TYPE_RE.test(f.TYPE)) {
|
||||
return true;
|
||||
}
|
||||
f = f.parent;
|
||||
} while (f && f.TYPE);
|
||||
return false;
|
||||
}
|
||||
//# sourceMappingURL=debugger.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src/lib/debugger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAsC;AAGtC,iDAA6C;AAC7C,mCAAqC;AAErC,MAAM,eAAe,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAS5D,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB,MAAa,QAAS,SAAQ,qBAAY;IAYtC,UA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,CAAC,MAAM,CAAC,CAAC;SACvC;aAAM;YACH,4BAA4B;YAC5B,OAAO;SACV;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QACtC,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IACD,aAAa,CAAC,SAAgB;QAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACpC,MAAM,iBAAiB,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACxD,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,gBLine truncated
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createLocation = exports.Location = void 0;
|
||||
class Location {
|
||||
constructor(nodeId, nodePath, portType = "o", portIndex = 0) {
|
||||
this.inSubflow = false;
|
||||
this.id = nodeId;
|
||||
this.path = nodePath;
|
||||
this.portType = portType;
|
||||
this.portIndex = portIndex;
|
||||
}
|
||||
getBreakpointLocation() {
|
||||
if (this.inSubflow) {
|
||||
return `*/${this.id}[${this.portType}][${this.portIndex}]`;
|
||||
}
|
||||
else {
|
||||
return this.toString();
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return `${this.path}/${this.id}[${this.portType}][${this.portIndex}]`;
|
||||
}
|
||||
}
|
||||
exports.Location = Location;
|
||||
function createLocation(event) {
|
||||
let node;
|
||||
let portType;
|
||||
let portIndex;
|
||||
if (event.hasOwnProperty("source")) {
|
||||
node = event.source.node;
|
||||
portType = "o";
|
||||
portIndex = event.source.port;
|
||||
}
|
||||
else {
|
||||
node = event.destination.node;
|
||||
portType = "i";
|
||||
portIndex = 0;
|
||||
}
|
||||
const l = new Location(node._alias || node.id, node._flow.path, portType, portIndex);
|
||||
if (node._alias) {
|
||||
l.inSubflow = true;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
exports.createLocation = createLocation;
|
||||
//# sourceMappingURL=location.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/lib/location.ts"],"names":[],"mappings":";;;AAIA,MAAa,QAAQ;IAYjB,YAAY,MAAa,EAAE,QAAe,EAAE,WAAkB,GAAG,EAAE,SAAS,GAAC,CAAC;QAF9E,cAAS,GAAW,KAAK,CAAC;QAGtB,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IACD,qBAAqB;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,OAAO,KAAK,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,GAAG,CAAA;SAC7D;aAAM;YACH,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC1B;IACL,CAAC;IACD,QAAQ;QACJ,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,GAAG,CAAA;IACzE,CAAC;CACJ;AA5BD,4BA4BC;AAED,SAAgB,cAAc,CAAC,KAA4B;IACvD,IAAI,IAAQ,CAAC;IACb,IAAI,QAAiB,CAAC;IACtB,IAAI,SAAgB,CAAC;IACrB,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAChC,IAAI,GAAI,KAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,QAAQ,GAAG,GAAG,CAAC;QACf,SAAS,GAAI,KAAmB,CAAC,MAAM,CAAC,IAAI,CAAC;KAChD;SAAM;QACH,IAAI,GAAI,KAAsB,CAAC,WAAW,CAAC,IAAI,CAAC;QAChD,QAAQ,GAAG,GAAG,CAAC;QACf,SAAS,GAAG,CAAC,CAAC;KACjB;IACD,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrF,IAAI,IAAI,CAAC,MAAM,EAAE;QACb,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;KACtB;IACD,OAAO,CAAC,CAAC;AACb,CAAC;AAlBD,wCAkBC"}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=types.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":""}
|
||||
Generated
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"label": {
|
||||
"debugger": "Flow Debugger",
|
||||
"debuggerShort": "debugger",
|
||||
"breakpoints": "Breakpoints",
|
||||
"messages":"Messages",
|
||||
"output": "output",
|
||||
"input": "input",
|
||||
"paused": "Flows paused",
|
||||
"resume": "Resume flows",
|
||||
"step": "Step flows",
|
||||
"pause": "Pause flows",
|
||||
"deleteMessage": "Delete message",
|
||||
"stepMessage": "Step message",
|
||||
"filter": {
|
||||
"label": "Filter messages",
|
||||
"all": "all nodes",
|
||||
"flow": "current flow"
|
||||
},
|
||||
"settings": "Debugger options",
|
||||
"breakpointAction": {
|
||||
"label": "Breakpoint action",
|
||||
"pause-all": "pause all nodes",
|
||||
"pause-bp": "pause at breakpoint"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"label": {
|
||||
"debugger": "フローデバッガ",
|
||||
"debuggerShort": "デバッガ",
|
||||
"breakpoints": "ブレイクポイント",
|
||||
"messages": "メッセージ",
|
||||
"output": "出力",
|
||||
"input": "入力",
|
||||
"paused": "フローを停止しました",
|
||||
"resume": "フローを再開",
|
||||
"step": "フローをステップ実行",
|
||||
"pause": "フローを停止",
|
||||
"deleteMessage": "メッセージを削除",
|
||||
"stepMessage": "メッセージをステップ実行",
|
||||
"filter": {
|
||||
"label": "メッセージの絞り込み",
|
||||
"all": "全てのノード",
|
||||
"flow": "現在のフロー"
|
||||
},
|
||||
"settings": "デバッガオプション",
|
||||
"breakpointAction": {
|
||||
"label": "ブレイクポイントの動作",
|
||||
"pause-all": "全てのノードを停止",
|
||||
"pause-bp": "ブレイクポイントで停止"
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=nr-types.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"nr-types.js","sourceRoot":"","sources":["../src/nr-types.ts"],"names":[],"mappings":""}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "node-red-debugger",
|
||||
"version": "1.1.1",
|
||||
"description": "A flow debugger for Node-RED 2.x",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/node-red/node-red-debugger.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "(tsc || exit 1) && npm run tslint && npm run copyAssets",
|
||||
"tslint": "tslint -c tslint.json -p tsconfig.json",
|
||||
"copyAssets": "node scripts/copy-static-assets.js",
|
||||
"dev": "nodemon --exec 'npm run build' -i dist -i resources -e 'ts html css'",
|
||||
"test": "npm run build"
|
||||
},
|
||||
"keywords": ["node-red","debugger"],
|
||||
"author": "Nick O'Leary <nick.oleary@gmail.com>",
|
||||
"files": [
|
||||
"dist",
|
||||
"resources"
|
||||
],
|
||||
"license": "Apache-2",
|
||||
"node-red": {
|
||||
"version": ">=2.0.0",
|
||||
"plugins": {
|
||||
"flow-debugger": "dist/flow-debugger.js"
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^15.12.2",
|
||||
"fs-extra": "^10.0.0",
|
||||
"html-minifier": "^4.0.0",
|
||||
"nodemon": "^2.0.7",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
.red-ui-flow-debugger{height:100%;display:flex;flex-direction:column}.red-ui-flow-debugger-stack{overflow-y:scroll;background:var(--red-ui-primary-background)}.red-ui-flow-debugger-stack .red-ui-palette-category:last-child{border-bottom:1px solid var(--red-ui-secondary-border-color)}.red-ui-flow-debugger.disabled .red-ui-sidebar-header>:not(:first-child){display:none}.red-ui-flow-debugger.disabled .red-ui-flow-debugger-stack{display:none}.red-ui-flow-debugger .red-ui-sidebar-header{flex:0 0 auto;display:flex}.red-ui-flow-debugger .red-ui-sidebar-header>*{flex-shrink:0}.red-ui-flow-debugger .red-ui-editableList-border{border:none;border-radius:0}.red-ui-flow-debugger .red-ui-editableList-container{padding:0}.red-ui-flow-debugger .red-ui-editableList-container li{padding:0}.red-ui-flow-debugger .red-ui-editableList-container li .red-ui-editableList-item-remove{right:3px}.red-ui-flow-debugger-breakpoint-list,.red-ui-flow-debugger-message-list{min-height:30px}.red-ui-flow-debugger-breakpoint-list .red-ui-editableList-item-content{padding:6px 8px}.red-ui-flow-debugger-message-list .red-ui-editableList-item-content{padding:6px 0}.red-ui-flow-debugger-message .red-ui-debug-msg-meta{display:flex;padding-left:10px}.red-ui-flow-debugger-breakpoint{user-select:none;display:flex;align-items:center}.red-ui-flow-debugger-breakpoint .red-ui-node-icon{margin-left:6px;margin-right:6px}.red-ui-flow-debugger-breakpoint.red-ui-flow-debugger-breakpoint-input .red-ui-node-icon:before,.red-ui-flow-debugger-breakpoint.red-ui-flow-debugger-breakpoint-output .red-ui-node-icon:after{position:absolute;top:calc(50% - 4px);left:-5px;width:7px;height:7px;display:block;content:"";background:var(--red-ui-node-port-background);border:1px solid var(--red-ui-node-border);border-radius:2px}.red-ui-flow-debugger-breakpoint.red-ui-flow-debugger-breakpoint-output .red-ui-node-icon:after{left:20px}.red-ui-flow-debugger .red-ui-editableList-container li.highlight{background:#e6e6e6}.red-ui-flow-debugger .red-ui-editableList-container li.pending{opacity:.4}.red-ui-flow-debugger-breakpoint input[type=checkbox]{margin-top:0;margin-right:4px}.red-ui-flow-debugger-breakpoint>:nth-child(2){flex-grow:1;flex-shrink:1;overflow:hidden}.red-ui-flow-debugger-breakpoint:not(.active) :not(:first-child){opacity:.7}.red-ui-flow-debugger-breakpoint-port{flex-shrink:0;height:22px}.red-ui-flow-debugger-breakpoint-port svg{stroke:red;stroke-width:1;fill:none}.red-ui-flow-debugger-port-overlay{cursor:pointer;display:none}.red-ui-flow-debugger-port-overlay-background{fill:var(--red-ui-flow-debugger-breakpoint-fill,#fff);stroke-width:1;stroke:var(--red-ui-flow-debugger-breakpoint-stroke,#58d)}.red-ui-flow-debugger-port-overlay-background.red-ui-flow-debugger-port-overlay-pulse{fill:none!important;stroke-width:1;stroke:var(--red-ui-flow-debugger-breakpoint-stroke,#58d);animation:red-ui-flow-debugger-port-overlay-pulse-kf .6s linear}@keyframes red-ui-flow-debugger-port-overlay-pulse-kf{0%{transform:scale(.8);opacity:1}50%{opacity:.5}70%{opacity:.2}100%{transform:scale(2,1.5);opacity:0}}.red-ui-flow-debugger-port-overlay.active .red-ui-flow-debugger-port-overlay-background{fill:var(--red-ui-flow-debugger-breakpoint-active-fill,#59e);stroke:var(--red-ui-flow-debugger-breakpoint-active-stroke,#36b)}.red-ui-flow-debugger-port-overlay.inactive .red-ui-flow-debugger-port-overlay-background{fill:var(--red-ui-flow-debugger-breakpoint-inactive-fill,#def);stroke:var(--red-ui-flow-debugger-breakpoint-inactive-stroke,#59e)}.red-ui-flow-debugger-port-overlay.pending .red-ui-flow-debugger-port-overlay-background{fill:var(--red-ui-flow-debugger-breakpoint-inactive-fill,#def);stroke:var(--red-ui-flow-debugger-breakpoint-inactive-stroke,#59e);stroke-dasharray:4 2;opacity:.8}.red-ui-flow-debugger-port-overlay-highlight{stroke-width:1.5;fill:none;stroke-dasharray:4 2;stroke:var(--red-ui-node-selected-color,#ff7f0e);transform:scale(1.2,1.5)}.red-ui-flow-debugger-port-overlay.active,.red-ui-flow-debugger-port-overlay.hasMessages,.red-ui-flow-debugger-port-overlay.inactive,.red-ui-flow-debugger-port-overlay.pending{display:inherit}.red-ui-flow-debugger-port-overlay-label{stroke-width:0;fill:var(--red-ui-flow-debugger-breakpoint-label,var(--red-ui-node-label-color,#000));font-size:9pt;text-anchor:end}.red-ui-flow-debugger-port-overlay-label.small{font-size:7pt;transform:translate(2px,-1px)}.red-ui-flow-debugger-port-overlay.active .red-ui-flow-debugger-port-overlay-label{fill:var(--red-ui-flow-debugger-breakpoint-label-active,#fff)}.red-ui-flow-debugger-notification{display:flex}.red-ui-flow-debugger-notification>.red-ui-flow-debugger-toolbar{flex-grow:1;text-align:right}.red-ui-flow-debugger-message:hover .red-ui-flow-debugger-msg-tools{display:inline}.red-ui-flow-debugger-msg-tools{position:absolute;right:5px;display:none}.red-ui-flow-debugger-settings{background:var(--red-ui-tertiary-background);color:var(--red-ui-primary-text-color)}.red-ui-flow-debugger-settings div{margin:0 0 6px 0}.red-uLine truncated
|
||||
Reference in new issue
Block a user