From a6644ad5ffa0e542a95f2e95fc092471bb13183f Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 19 Aug 2015 21:14:45 +0100 Subject: [PATCH] Add status node --- nodes/core/core/25-status.html | 281 +++++++++++++++++++++++++ nodes/core/core/25-status.js | 29 +++ nodes/core/locales/en-US/messages.json | 16 ++ red/nodes/Flow.js | 75 +++++-- red/nodes/Node.js | 3 +- red/nodes/flows.js | 27 +-- 6 files changed, 395 insertions(+), 36 deletions(-) create mode 100644 nodes/core/core/25-status.html create mode 100644 nodes/core/core/25-status.js diff --git a/nodes/core/core/25-status.html b/nodes/core/core/25-status.html new file mode 100644 index 000000000..869a64e32 --- /dev/null +++ b/nodes/core/core/25-status.html @@ -0,0 +1,281 @@ + + + + + + diff --git a/nodes/core/core/25-status.js b/nodes/core/core/25-status.js new file mode 100644 index 000000000..f779ecd00 --- /dev/null +++ b/nodes/core/core/25-status.js @@ -0,0 +1,29 @@ +/** + * Copyright 2015 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +module.exports = function(RED) { + "use strict"; + + function StatusNode(n) { + RED.nodes.createNode(this,n); + var node = this; + this.on("input", function(msg) { + this.send(msg); + }); + } + + RED.nodes.registerType("status",StatusNode); +} diff --git a/nodes/core/locales/en-US/messages.json b/nodes/core/locales/en-US/messages.json index 680b25606..67279846f 100644 --- a/nodes/core/locales/en-US/messages.json +++ b/nodes/core/locales/en-US/messages.json @@ -83,6 +83,22 @@ "selected": "selected nodes" } }, + "status": { + "status": "status (all)", + "statusNodes": "status (__number__)", + "label": { + "source": "Report status from", + "node": "node", + "type": "type", + "selectAll": "select all", + "sortByLabel": "sort by label", + "sortByType": "sort by type" + }, + "scope": { + "all": "all nodes", + "selected": "selected nodes" + } + }, "debug": { "output": "Output", "msgprop": "message property", diff --git a/red/nodes/Flow.js b/red/nodes/Flow.js index 671d5583c..54a8c5684 100644 --- a/red/nodes/Flow.js +++ b/red/nodes/Flow.js @@ -68,7 +68,7 @@ function createSubflow(sf,sfn,subflows) { node.z = sfn.id; newNodes.push(node); } - // Look for any catch nodes and update their scope ids + // Look for any catch/status nodes and update their scope ids // Update all subflow interior wiring to reflect new node IDs for (i=0;i