1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
5 Live runtime information
Nick O'Leary edited this page 2014-05-03 16:18:10 -07:00

Whilst we are not a dashboard, there is some runtime information that we do want to expose in the UI. Currently, this includes:

  • 'state' of a node
  • performance/through-put indicators
  • ...

Each of these will be individually toggle-able

'State' of a node

What 'state' means will be specific to the individual node. The main use case will be for nodes that connect to external services (MQTT for eg) to indicate their connection state.

The state indicators will be on the bottom edge of the node, away from the 'edit state' indicators on the top edge of the node.

Question: should there be a single dot indicator that the node can control the colour of, or can the shape be customised from a small selection of choices (dot/square/star/hexagon...)... can there be multiple indicators per node (Nick thinks: single dot indicator to begin with - unless a use case for multiple/varied shape becomes obvious)

The runtime Node api will have a setState (maybe emit('state') instead) to update the status. The state value will be either a number (0,1,2..) or an object of the form (exact property names tbd):

{state:1,msg:"connected"}

The state updates the indicator and the message is provided as a hover/tool-tip on the indicator. (what about touch ui for tool-tip?)

Question: should there be a limited palette of colours with well-defined state values, or do individual node types have to provide a mapping for state value to colour. (Nick thinks: limited palette, with suitable constants STATE_RED STATE_GREEN - what about blinking?)

Performance/through-put indicators

Communication

This will require a websocket connection to efficiently share the state updates from the runtime to the browser. Debug node already has its own, but this should be generalised.

  1. have a comms module in the runtime and browser
  2. provide pub/sub like semantics - debug subscribes to 'debug' topic etc
  3. not a replacement for the REST api - this is for the runtime information only

References