@5minds/node-red-contrib-processcube 1.8.4-develop-d81c9d-m7pcbct5 → 1.8.5-develop-bbf751-m7pcta62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/externaltask-input.js +15 -1
- package/package.json +1 -1
package/externaltask-input.js
CHANGED
@@ -174,21 +174,35 @@ module.exports = function (RED) {
|
|
174
174
|
this.showStatus();
|
175
175
|
};
|
176
176
|
|
177
|
+
node.sendStatus = (status, message) => {
|
178
|
+
RED.events.emit("processcube:healthcheck:update", {
|
179
|
+
nodeId: node.id,
|
180
|
+
status: status,
|
181
|
+
nodeName: node.name,
|
182
|
+
nodeType: 'externaltask-input',
|
183
|
+
message: message
|
184
|
+
};
|
185
|
+
|
177
186
|
node.showStatus = () => {
|
178
187
|
const msgCounter = Object.keys(this.started_external_tasks).length;
|
179
188
|
|
180
189
|
if (this._subscribed === false) {
|
181
|
-
this.status({ fill: 'red', shape: 'ring', text: `subscription failed (${msgCounter}).` })
|
190
|
+
this.status({ fill: 'red', shape: 'ring', text: `subscription failed (${msgCounter}).` });
|
191
|
+
|
192
|
+
this.sendStatus('NotOk', `subscription failed (${msgCounter}).`);
|
182
193
|
} else {
|
183
194
|
if (msgCounter >= 1) {
|
184
195
|
if (node._step) {
|
185
196
|
this.status({ fill: 'green', shape: 'dot', text: `tasks(${msgCounter}) ->'${node._step}'.` });
|
197
|
+
this.sendStatus('Ok', `tasks(${msgCounter}) ->'${node._step}'.`);
|
186
198
|
} else {
|
187
199
|
this.status({ fill: 'green', shape: 'dot', text: `tasks(${msgCounter}).` });
|
200
|
+
this.sendStatus('Ok', `tasks(${msgCounter}).`);
|
188
201
|
}
|
189
202
|
this.log(`handling tasks ${msgCounter}.`);
|
190
203
|
} else {
|
191
204
|
this.status({ fill: 'blue', shape: 'ring', text: `subcribed.` });
|
205
|
+
this.sendStatus('Ok', `subcribed.`);
|
192
206
|
}
|
193
207
|
}
|
194
208
|
};
|