Whilst running, a node is able to share status information with the editor UI. For example, the MQTT nodes can indicate if they are currently connected or not.
To set its current status, a node uses the status
function. For example, the
following two calls are used by the MQTT node to set the statuses seen in the
image above:
By default, the node status information is displayed in the editor. It can be disabled and re-enabled by selecting the Display Node Status option in the drop-down menu.
A status object consists of three properties: fill
, shape
and text
.
The first two define the appearance of the status icon and the third is an optional short piece of text (under <20 characters) to display alongside the icon.
The shape
property can be: ring
or dot
.
The fill
property can be: red
, green
, yellow
, blue
or grey
This allows for the following icons to be used:
If the status object is an empty object, {}
, then the status entry is cleared from the
node.
From Node-RED v0.12.x the Status node can be used to catch any node status updates, for example connect and disconnect messages, in order to trigger other flows.
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy