Configuring a dashboard tab in response to a URL

I send you the http part with the iframe and a function in which you only have to add the position of the dashboard board (I recommend taking a look at the post I published on the dashboard menu variable)

[{"id":"2935e9a4.c5ba56","type":"http in","z":"dfd21047.842e8","name":"","url":"/mydashtest","method":"get","upload":false,"swaggerDoc":"","x":980,"y":740,"wires":[["39ef8038.2ee7"]]},{"id":"f7744679.470738","type":"http response","z":"dfd21047.842e8","name":"","statusCode":"","headers":{},"x":1370,"y":840,"wires":[]},{"id":"d52fbc17.07c9e","type":"template","z":"dfd21047.842e8","name":"Iframe","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<body>\n    <table><tr><th>\n    <iframe id=\"MyIFrame\"  align=\"left\" > Tu navegador no soporta iframes</iframe> </th>\n    </tr></table>\n</body>\n\n<style>\n    #MyIFrame {border: 0;  top:0px;  bottom:0px; width:100vw; height:100vh;   overflow:hidden; }\n    html{overflow:hidden;}  \n    body{margin:0px;}\n</style>\n\n<script>\n\nvar host=window.location.host\nvar dashboardDir=\"ui\"\nvar index={{payload}}\nvar tabName=window.location.href\nconsole.log(tabName)\n\nvar URL=\"http://\"+host+\"/\"+dashboardDir+\"/#!/\"+index;\nconsole.log(URL)\nvar URLtabName=\"http://\"+host+\"/\"+dashboardDir+\"/#!/\"+index;\nvar iframe = document.getElementById(\"MyIFrame\");\niframe.src = URL;\n\nconsole.log(iframe)\n\n\n</script>\n\n\n\n","output":"str","x":1170,"y":840,"wires":[["f7744679.470738"]]},{"id":"39ef8038.2ee7","type":"function","z":"dfd21047.842e8","name":"indexOf My Tab","func":"\nmsg.payload=2\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":800,"wires":[["d52fbc17.07c9e"]]}]