# Show status from webpages in Dashboard with colors

**URL:** <https://discourse.nodered.org/t/show-status-from-webpages-in-dashboard-with-colors/29783>\
**Category:** Dashboard\
**Created:** [9 July 2020 12:46 UTC](https://discourse.nodered.org/t/show-status-from-webpages-in-dashboard-with-colors/29783 "2020-07-09T12:46:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grawsom](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grawsom/32/53070_2.png) [@grawsom](https://discourse.nodered.org/u/grawsom)\
**Post date:** [9 July 2020 12:46 UTC](https://discourse.nodered.org/t/show-status-from-webpages-in-dashboard-with-colors/29783/1 "2020-07-09T12:46:08Z")

</div>

Hello - this is new to me about asking for help (not good at it), but I'm stuck.

I have made some Node-red stuff, where I monitor some webpages for status information.  
Here is a sample of my flow.

```auto
[{"id":"b45c1a1.2b56768","type":"function","z":"8b4b8492.a8d448","name":"","func":"var url = msg.responseUrl;\nurl = url.replace(\"common/status/stati.php\", \"\")\n\nif (msg.payload == \"Error\") {\n var Fejl = \"FEJL!\";\n msg.payload = Fejl + \" - \" + url;\n return [msg, null, null];\n} else if (msg.payload == \"Check status\") {\n var StatusFejl = \"Tjek status!\";\n msg.payload = StatusFejl + \" - \" + url;\n return [null, msg, null];\n} else {\nreturn [null, null, msg];\n}","outputs":3,"noerr":0,"x":350,"y":220,"wires":[["7b40a313.98b58c"],["3c658338.ff78e4"],["df7db74a.96c388"]]}]

```

To melt it down I have 3 different statuses "Error, Warning and OK".  
My dream Is to have a Node-red gui page where you easly can see the statuses by Red, Orange or Green, but in a nice formatted way.  
Name - Status (Color)

When I get the result from the page I use msg.topic as Name of page (customer)

I have made this test circuit where I use led - but don't need to be led's - but some clear color.

```auto
[{"id":"66cd028.4fe2e7c","type":"tab","label":"GUI Test","disabled":false,"info":""},{"id":"efe436c2.0ad7b","type":"debug","z":"66cd028.4fe2e7c","name":"Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":160,"wires":[]},{"id":"8d9c179a.4f058","type":"function","z":"66cd028.4fe2e7c","name":"","func":"//var url = msg.responseUrl;\n//url = url.replace(\"common/status/stati.php\", \"\")\n\nif (msg.payload == \"Error\") {\n var Fejl = \"FEJL!\";\n msg.payload = Fejl;\n return [msg, null, null, msg];\n} else if (msg.payload == \"Check status\") {\n var StatusFejl = \"Tjek status!\";\n msg.payload = StatusFejl;\n return [null, msg, null, msg];\n} else {\nreturn [null, null, msg, msg];\n}","outputs":4,"noerr":0,"x":290,"y":200,"wires":[["efe436c2.0ad7b"],["fb69f441.4159a"],["9a8d26c1.638018"],["7d7dc6de.864e08","406e07d0.bb0758"]]},{"id":"fb69f441.4159a","type":"debug","z":"66cd028.4fe2e7c","name":"Status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":490,"y":200,"wires":[]},{"id":"9a8d26c1.638018","type":"debug","z":"66cd028.4fe2e7c","name":"OK","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":490,"y":240,"wires":[]},{"id":"4ae4b45a.deacec","type":"inject","z":"66cd028.4fe2e7c","name":"Error","topic":"Test1","payload":"Error","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":160,"wires":[["8d9c179a.4f058","d72c484c.843fe"]]},{"id":"d72c484c.843fe","type":"debug","z":"66cd028.4fe2e7c","name":"Test","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":410,"y":60,"wires":[]},{"id":"938a1a93.de0bd8","type":"inject","z":"66cd028.4fe2e7c","name":"Error","topic":"Test2","payload":"Check status","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":200,"wires":[["8d9c179a.4f058"]]},{"id":"7b7f104b.bfddd","type":"inject","z":"66cd028.4fe2e7c","name":"OK","topic":"Test3","payload":"OK","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":240,"wires":[["8d9c179a.4f058"]]},{"id":"7d7dc6de.864e08","type":"debug","z":"66cd028.4fe2e7c","name":"Color","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":490,"y":320,"wires":[]},{"id":"6910b6cd.9477a","type":"ui_led","z":"66cd028.4fe2e7c","group":"39d5024.01dd3fe","order":1,"width":"2","height":"2","label":"Test 1","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"FEJL!","valueType":"str"},{"color":"orange","value":"Tjek status!","valueType":"str"},{"color":"green","value":"OK","valueType":"str"}],"allowColorForValueInMessage":false,"name":"","x":490,"y":380,"wires":[]},{"id":"31a754c5.c529d4","type":"ui_led","z":"66cd028.4fe2e7c","group":"39d5024.01dd3fe","order":1,"width":"2","height":"2","label":"Test 2","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"FEJL!","valueType":"str"},{"color":"orange","value":"Tjek status!","valueType":"str"},{"color":"green","value":"OK","valueType":"str"}],"allowColorForValueInMessage":false,"name":"","x":490,"y":420,"wires":[]},{"id":"406e07d0.bb0758","type":"switch","z":"66cd028.4fe2e7c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Test1","vt":"str"},{"t":"eq","v":"Test2","vt":"str"},{"t":"eq","v":"Test3","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":300,"y":400,"wires":[["6910b6cd.9477a"],["31a754c5.c529d4"],["9ccc4aac.e6a2"]]},{"id":"9ccc4aac.e6a2","type":"ui_led","z":"66cd028.4fe2e7c","group":"39d5024.01dd3fe","order":1,"width":"2","height":"2","label":"Test 3","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"FEJL!","valueType":"str"},{"color":"orange","value":"Tjek status!","valueType":"str"},{"color":"green","value":"OK","valueType":"str"}],"allowColorForValueInMessage":false,"name":"","x":490,"y":460,"wires":[]},{"id":"39d5024.01dd3fe","type":"ui_group","z":"","name":"Test","tab":"8b05d426.5a55b","disp":true,"width":"6","collapse":false},{"id":"8b05d426.5a55b","type":"ui_tab","z":"","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

```

Got stuck in finding out dashboard formating, transfering msg.topic to dashboard as name etc.  
Some idears are welcome

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 August 2020 12:46 UTC](https://discourse.nodered.org/t/show-status-from-webpages-in-dashboard-with-colors/29783/2 "2020-08-08T12:46:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
