New to Node-RED. I have a table of data. I want to display it.
The Status field will be either "In Use" or "Not in Use", depending on the values from the query. I would like to have the text green if the Status is "In Use", and red if the Status is "Not in Use".
This is being displayed on a (dashboard) template node, and the template is as follows:
<div layout="row" layout-align="start center">
<span flex><b>Station</b></span>
<span flex><b>Status</b></span>
<span flex><b>Current Part</b></span>
<span flex><b>In Box</b></span>
<span flex><b>Operator</b></span>
<span flex><b>Boxes Filled</b></span>
<span flex><b>Scrapped</b></span>
<span flex><b>Rework</b></span>
</div>
<div layout="row" layout-align="start center" ng-repeat="x in msg.payload | limitTo:20">
<span flex>{{msg.payload[$index].Station}}</span>
if (msg.payload[$index].Status="In Progress" {
<span flex style="color: green">{{msg.payload[$index].Status}}</span>
}
else (
<span flex style="color: red">{{msg.payload[$index].Status}}</span>
}
<span flex>{{msg.payload[$index].CurrentPart}}</span>
<span flex>{{msg.payload[$index].CurrentQty}}</span>
<span flex>{{msg.payload[$index].OperatorName}}</span>
<span flex>{{msg.payload[$index].FullBoxesToday}}</span>
<span flex>{{msg.payload[$index].ScrapToday}}</span>
<span flex>{{msg.payload[$index].ReworkToday}}</span>
</div>
The whole IF statement is showing. I tried a couple of other different methods... but no luck. Any ideas please?