I found a flow from the forum to add dynamic code to the browser's Node-Red Dashboard Header.
Request help revising the flow to only show the text, on the dashboard header of the tab, on which the flow is installed.
Below is the forum code that adds dynamic text to all tabs.
Alan
[
{
"id": "b66356528745219a",
"type": "ui_template",
"z": "699947d1aebaa7ac",
"group": "876fb52665fd9bec",
"name": "",
"order": 0,
"width": 0,
"height": 0,
"format": "<script>\n (function(scope) {\n scope.$watch('msg', function(data) {\n var elem = document.getElementById(\"headerStatus\")\n if(elem !== null) {\n elem.className = data.payload;\n elem.innerHTML = data.payload;\n }\n });\n })(scope);\n</script>",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": false,
"templateScope": "local",
"className": "",
"x": 4600,
"y": 660,
"wires": [
[]
]
},
{
"id": "374af03ea286d159",
"type": "inject",
"z": "699947d1aebaa7ac",
"name": "",
"props": [
{
"p": "payload",
"v": "online",
"vt": "str"
},
{
"p": "topic",
"v": "",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "online",
"payloadType": "str",
"x": 4410,
"y": 640,
"wires": [
[
"b66356528745219a"
]
]
},
{
"id": "dbdcf27634699e40",
"type": "ui_template",
"z": "699947d1aebaa7ac",
"group": "876fb52665fd9bec",
"name": "Header Status",
"order": 2,
"width": "0",
"height": "0",
"format": "<style>\n #headerStatus {\n font-weight: bold;\n text-transform: uppercase;\n }\n #headerStatus.online {\n color: lime;\n }\n #headerStatus.offline {\n color: tomato;\n }\n</style>\n\n<script id=\"titleScript\" type=\"text/javascript\">\n$(function() {\n if($('.md-toolbar-tools').length){\n initHeader();\n } else setTimeout(initHeader, 500)\n});\n\nfunction initHeader(){\n if (!$('#headerStatus').length) {\n var toolbar = $('.md-toolbar-tools');\n var div = $('<div/>');\n var p = $('<p id=\"headerStatus\" />');\n div[0].style.margin = '5px 5px 5px auto';\n div.append(p);\n toolbar.append(div);\n }\n}\n</script>",
"storeOutMessages": false,
"fwdInMessages": false,
"resendOnRefresh": false,
"templateScope": "global",
"className": "",
"x": 4420,
"y": 580,
"wires": [
[]
]
},
{
"id": "1615fd91c3717b9c",
"type": "inject",
"z": "699947d1aebaa7ac",
"name": "",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "offline",
"payloadType": "str",
"x": 4410,
"y": 680,
"wires": [
[
"b66356528745219a"
]
]
},
{
"id": "876fb52665fd9bec",
"type": "ui_group",
"name": "Memory-Select",
"tab": "4b29b624.234878",
"order": 1,
"disp": true,
"width": "3",
"collapse": false,
"className": ""
},
{
"id": "4b29b624.234878",
"type": "ui_tab",
"name": "Memory",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]