How to start a dashboard with some group hiden

Hello,

I'm new in here and as used of the node-red, I've been facing a problem trying to hide so groups of my dashboard when I first start my dashboard... I would like to see if anyone could help me. I'm dashboard is hosted in IBM cloudant.

I've created a simple dashboard with some gauges and a form node, each gauge and also the form is in a different group. I'm using the form node to make a login screen, receiving the username and password input from the user, then I use the fuction node to check if the username and password is correct, after that I user some more nodes to send a {hide:, show:} to the UI control to show the gauges and hide the form node group, but I am facing a problem when I first connect to my dashboard... at the first access, all the group show up in the browser screen not only the login group. So I would like to know if there is anyway to access the link of my dashboard and first start it with some groups hiden?

you would need to send the collapse command when they connect using the ui_control node - but you may be better to use different tabs so they only see the front page first instead.

1 Like

But wouldn´t in this case the two tab be available for the user? If so, make no sense have a login screen. I would like that the user would have access to the dashboard only if he enters with the corrrect password and user name

I don't know if it will be useful, but I have an idea.

You could insert a logoff button on any of the tabs.

Work with logic using a ui_control and hide the other menus when the button is pressed, and you can still make a system that redirects you to the login screen.

You know that ui_control can return to your messages if any menu is accessed. Use this to your advantage in the first access: when you open the dashboard for the first time but the user did not enter any password or anything, hide the other menus and redirect to the login screen.

I'm also new, but my system works, despite having a few more menus.

If useful, try to adapt.

[{"id":"7310a95c.9f4ef8","type":"ui_form","z":"cfbb6e4f.6526a","name":"","label":"","group":"69c973c5.44f9ec","order":1,"width":6,"height":3,"options":[{"label":"Usuário","value":"User","type":"text","required":true,"rows":null},{"label":"Senha","value":"Senha","type":"password","required":true,"rows":null}],"formValue":{"User":"","Senha":""},"payload":"","submit":"OK","cancel":"Cancelar","topic":"mi","x":4410,"y":120,"wires":[["5d0ab572.47de0c","acd464a0.cedbe8"]]},{"id":"1ff388c.5ae5877","type":"ui_ui_control","z":"cfbb6e4f.6526a","name":"","events":"change","x":4760,"y":80,"wires":[["a2bfe5fb.da9838"]]},{"id":"6de5fa3e.a6bf34","type":"ui_ui_control","z":"cfbb6e4f.6526a","name":"","events":"all","x":4760,"y":400,"wires":[[]]},{"id":"7afbab33.e12a94","type":"join","z":"cfbb6e4f.6526a","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":4750,"y":180,"wires":[["df0667fb.475718","c73c64b4.6d8ea8","c9f111a3.cc4c7","aa1c6b7a.2c1068","cc634f5f.4fa56","91395916.17bd18","b202aa3d.0b0db8","470c62c9.27f43c","7ee6a929.817948","6554b809.54fe38","95e4b51d.176f38","7e32f91d.86e5e8","e3157e11.a37a4","93da441e.674128","3572867c.a0493a","b9e02f4d.a48bd","fc8f5d24.9ce7e"]]},{"id":"5d0ab572.47de0c","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if ((msg.payload.User == \"admin\")&& (msg.payload.Senha == \"123\"))\n{msg.payload = \"concedida\"\nmsg.topic = \"auto\"\n    return msg;\n    \n}\nelse \n{\n    msg.payload = \"negada\"\n    msg.topic = \"auto\"\nreturn msg;\n}","outputs":1,"noerr":0,"x":4420,"y":80,"wires":[["7afbab33.e12a94","324a1b2d.8ce6d4"]]},{"id":"a2bfe5fb.da9838","type":"function","z":"cfbb6e4f.6526a","name":"","func":"\nmsg.topic = \"menu\"\nmsg.payload = msg.tab;\nreturn msg;","outputs":1,"noerr":0,"x":4770,"y":120,"wires":[["7afbab33.e12a94"]]},{"id":"3572867c.a0493a","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\n    msg.payload = {\"tab\":\"Login\"}\n    return msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Login\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}  \nreturn msg;\n}","outputs":1,"noerr":0,"x":4760,"y":340,"wires":[["6de5fa3e.a6bf34"]]},{"id":"c73c64b4.6d8ea8","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"HC-SR04 - Distância\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"HC-SR04 - Distância\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\n","outputs":1,"noerr":0,"x":4460,"y":280,"wires":[["6de5fa3e.a6bf34"]]},{"id":"df0667fb.475718","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Início\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Início\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":300,"wires":[["6de5fa3e.a6bf34"]]},{"id":"c9f111a3.cc4c7","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Notificações\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Notificações\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":320,"wires":[["6de5fa3e.a6bf34"]]},{"id":"aa1c6b7a.2c1068","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"DHT22 - Temperatura \", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"DHT22 - Temperatura \", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":340,"wires":[["6de5fa3e.a6bf34"]]},{"id":"cc634f5f.4fa56","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"  DHT22 - Umidade\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"  DHT22 - Umidade\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":360,"wires":[["6de5fa3e.a6bf34"]]},{"id":"91395916.17bd18","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"DHT22 - Gráfico comparativo\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"DHT22 - Gráfico comparativo\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":380,"wires":[["6de5fa3e.a6bf34"]]},{"id":"b202aa3d.0b0db8","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"DS18B20 - Temperatura\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"DS18B20 - Temperatura\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":400,"wires":[["6de5fa3e.a6bf34"]]},{"id":"470c62c9.27f43c","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"LDR - Luminosidade\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"LDR - Luminosidade\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":420,"wires":[["6de5fa3e.a6bf34"]]},{"id":"7ee6a929.817948","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"ACS712 - Corrente\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"ACS712 - Corrente\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":440,"wires":[["6de5fa3e.a6bf34"]]},{"id":"6554b809.54fe38","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Entradas auxiliares\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Entradas auxiliares\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":460,"wires":[["6de5fa3e.a6bf34"]]},{"id":"95e4b51d.176f38","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Relés\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Relés\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":480,"wires":[["6de5fa3e.a6bf34"]]},{"id":"7e32f91d.86e5e8","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Ponte H\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Ponte H\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":500,"wires":[["6de5fa3e.a6bf34"]]},{"id":"e3157e11.a37a4","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Servomotores\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Servomotores\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":520,"wires":[["6de5fa3e.a6bf34"]]},{"id":"93da441e.674128","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Saídas auxliares\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Saídas auxliares\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"x":4460,"y":540,"wires":[["6de5fa3e.a6bf34"]]},{"id":"acd464a0.cedbe8","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if ((msg.payload.User == \"admin\")&& (msg.payload.Senha == \"123\"))\n{\n    msg.payload = \" \"\n    return msg;\n    \n}\nelse \n{\n    msg.payload = \"Usuário ou senha incorretos.\"\n    msg.topic = \"auto\"\nreturn msg;\n}","outputs":1,"noerr":0,"x":4410,"y":160,"wires":[["f9acc720.30fee8"]]},{"id":"f9acc720.30fee8","type":"ui_text","z":"cfbb6e4f.6526a","group":"69c973c5.44f9ec","order":2,"width":6,"height":1,"name":"","label":"","format":"{{msg.payload}}","layout":"col-center","x":4410,"y":200,"wires":[]},{"id":"b7a75c8f.55951","type":"ui_button","z":"cfbb6e4f.6526a","name":"","group":"7c70dffa.9eb6f","order":38,"width":8,"height":1,"passthru":false,"label":"Sair","tooltip":"","color":"","bgcolor":"","icon":"","payload":"negada","payloadType":"str","topic":"auto","x":4610,"y":160,"wires":[["7afbab33.e12a94","a9641b21.e8ac98"]]},{"id":"1d74ac4.b9b9054","type":"ui_ui_control","z":"cfbb6e4f.6526a","name":"","events":"all","x":4820,"y":700,"wires":[[]]},{"id":"c9353a22.b662a8","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload == \"concedida\")\n{\n    msg.payload = {\"tab\":\"Início\"}\n    return msg;\n}","outputs":1,"noerr":0,"x":4620,"y":700,"wires":[["1d74ac4.b9b9054","bd3cee34.d1228","14b3e3a9.a7d36c"]]},{"id":"324a1b2d.8ce6d4","type":"delay","z":"cfbb6e4f.6526a","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":4750,"y":440,"wires":[["c9353a22.b662a8"]]},{"id":"bd3cee34.d1228","type":"function","z":"cfbb6e4f.6526a","name":"","func":"\nmsg.payload.User = ''\nreturn msg;","outputs":1,"noerr":0,"x":4420,"y":660,"wires":[["7310a95c.9f4ef8"]]},{"id":"14b3e3a9.a7d36c","type":"function","z":"cfbb6e4f.6526a","name":"","func":"msg.payload.Senha = ''\nreturn msg;","outputs":1,"noerr":0,"x":4420,"y":740,"wires":[["7310a95c.9f4ef8"]]},{"id":"a9641b21.e8ac98","type":"function","z":"cfbb6e4f.6526a","name":"","func":"msg.payload = {\"tabs\": {\"show\": \"Login\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}  \nreturn msg;","outputs":1,"noerr":0,"x":4630,"y":80,"wires":[["1ff388c.5ae5877"]]},{"id":"b9e02f4d.a48bd","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Entradas auxiliares 0 - 5 V\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Entradas auxiliares 0 - 5 V\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":4460,"y":560,"wires":[["6de5fa3e.a6bf34"]]},{"id":"fc8f5d24.9ce7e","type":"function","z":"cfbb6e4f.6526a","name":"","func":"if (msg.payload.auto == \"negada\")\n{\nmsg.payload = {\"tabs\": {\"hide\": \"Entradas auxiliares 4 - 20 mA\", \"disable\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}\nif (msg.payload.auto == \"concedida\")\n{\nmsg.payload = {\"tabs\": {\"show\": \"Entradas auxiliares 4 - 20 mA\", \"enabled\": [\"secret_tab\", \"unused_stuff\"]}}\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":4460,"y":580,"wires":[["6de5fa3e.a6bf34"]]},{"id":"69c973c5.44f9ec","type":"ui_group","z":"","name":"Indique suas credenciais","tab":"cd76a714.a90978","disp":true,"width":6,"collapse":false},{"id":"7c70dffa.9eb6f","type":"ui_group","z":"","name":"","tab":"87539029.82597","disp":true,"width":16,"collapse":false},{"id":"cd76a714.a90978","type":"ui_tab","z":"","name":"Login","icon":"lock","order":16,"disabled":false,"hidden":false},{"id":"87539029.82597","type":"ui_tab","z":"","name":"Início","icon":"insert_emoticon","order":1,"disabled":false,"hidden":false}]
1 Like

Thank you guys for your help!! I really appreciate it!

I found some one thing that worked to me with 3 nodes.... but tell you the true I didnt understand the code in the template node.(I am new in node-red).

This is the node that I used to solve my problem:

[{"id":"4565a4b0.3b09cc","type":"ui_template","z":"6855350.3416ecc","group":"12630b83.ac21a4","name":"","order":2,"width":0,"height":0,"format":"<script>\n(function() {\n    var count = 0\n    function testit(msg,scope) {\n        count = count+1;\n        console.log(\"In testit \" + msg.payload + \"  count = \" + count);\n        scope.send({payload: \"from testit \" + msg.payload + \"  count = \" + count});\n    }\n    \n    (function(scope) {\n        scope.send({payload: \"preload\"});   // this gets sent when the view is opened in the browser\n        scope.$watch('msg', function(msg) {\n            if (msg) {\n                testit(msg, scope);\n            }\n        });\n    })(scope);\n})();\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":480,"y":360,"wires":[["19ca2f52.4b5f61"]]},{"id":"19ca2f52.4b5f61","type":"change","z":"6855350.3416ecc","name":"muda payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Home_Voltage_Gauge\",\"Home_Current_Gauge\",\"Home_Switch_State\",\"Home_Switch_Mode\",\"Home_Pot_Gauge\",\"Home_Logout\"],\"show\":[\"Home_Login\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":360,"wires":[["42094ab9.a02cd4"]]},{"id":"42094ab9.a02cd4","type":"ui_ui_control","z":"6855350.3416ecc","name":"","events":"all","x":1040,"y":260,"wires":[[]]},{"id":"12630b83.ac21a4","type":"ui_group","z":"","name":"Login","tab":"7507efb3.1d90f","order":7,"disp":true,"width":"6","collapse":false},{"id":"7507efb3.1d90f","type":"ui_tab","z":0,"name":"Home","icon":"dashboard","order":2}]

According to the site where i found it, the template node send a msg when the browser is accessed, but I didn´t understand how, could someone help me on this?

This is whole flow:

[{"id":"7b00c2c1.30704c","type":"ui_form","z":"6855350.3416ecc","name":"","label":"","group":"12630b83.ac21a4","order":1,"width":0,"height":0,"options":[{"label":"Login","value":"login","type":"text","required":true,"rows":null},{"label":"Senha","value":"senha","type":"text","required":true,"rows":null}],"formValue":{"login":"","senha":""},"payload":"","submit":"submit","cancel":"cancel","topic":"","x":270,"y":260,"wires":[["745e4ce.26b45b4"]]},{"id":"745e4ce.26b45b4","type":"function","z":"6855350.3416ecc","name":"check login","func":"var login = msg.payload.login.toLowerCase();\n\nif(msg.payload.login.toLowerCase() == 'smartmeter' && msg.payload.senha == 'smartmeter')\n{\n    var password = msg.payload.senha;\n    msg.payload = 'correto';\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":260,"wires":[["2ba32ab0.a0c1d6"]]},{"id":"2ba32ab0.a0c1d6","type":"switch","z":"6855350.3416ecc","name":"Redireciona","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"correto","vt":"str","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":260,"wires":[["35db7433.457cdc"],[]]},{"id":"35db7433.457cdc","type":"change","z":"6855350.3416ecc","name":"muda payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Home_Login\"],\"show\":[\"Home_Voltage_Gauge\",\"Home_Current_Gauge\",\"Home_Pot_Gauge\",\"Home_Switch_Mode\",\"Home_Logout\",\"Home_Current_Chart\",\"Home_Switch_State\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":260,"wires":[["42094ab9.a02cd4"]]},{"id":"42094ab9.a02cd4","type":"ui_ui_control","z":"6855350.3416ecc","name":"","events":"all","x":1040,"y":260,"wires":[[]]},{"id":"e7c6b88b.637a98","type":"ui_button","z":"6855350.3416ecc","name":"","group":"62de6519.019a3c","order":1,"width":0,"height":0,"passthru":false,"label":"Logout","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{\"group\":{\"hide\":[\"Home_Voltage_Gauge\",\"Home_Current_Gauge\",\"Home_Switch_State\",\"Home_Switch_Mode\",\"Home_Pot_Gauge\",\"Home_Logout\"],\"show\":[\"Home_Login\"]}}","payloadType":"json","topic":"","x":670,"y":140,"wires":[["42094ab9.a02cd4","a864a947.562bf8"]]},{"id":"a864a947.562bf8","type":"function","z":"6855350.3416ecc","name":"Clean fields","func":"\n    msg.payload.login='';\n    msg.payload.senha='';\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":200,"wires":[["7b00c2c1.30704c"]]},{"id":"4565a4b0.3b09cc","type":"ui_template","z":"6855350.3416ecc","group":"12630b83.ac21a4","name":"","order":2,"width":0,"height":0,"format":"<script>\n(function() {\n    var count = 0\n    function testit(msg,scope) {\n        count = count+1;\n        console.log(\"In testit \" + msg.payload + \"  count = \" + count);\n        scope.send({payload: \"from testit \" + msg.payload + \"  count = \" + count});\n    }\n    \n    (function(scope) {\n        scope.send({payload: \"preload\"});   // this gets sent when the view is opened in the browser\n        scope.$watch('msg', function(msg) {\n            if (msg) {\n                testit(msg, scope);\n            }\n        });\n    })(scope);\n})();\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":480,"y":360,"wires":[["19ca2f52.4b5f61"]]},{"id":"19ca2f52.4b5f61","type":"change","z":"6855350.3416ecc","name":"muda payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"group\":{\"hide\":[\"Home_Voltage_Gauge\",\"Home_Current_Gauge\",\"Home_Switch_State\",\"Home_Switch_Mode\",\"Home_Pot_Gauge\",\"Home_Logout\"],\"show\":[\"Home_Login\"]}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":360,"wires":[["42094ab9.a02cd4"]]},{"id":"12630b83.ac21a4","type":"ui_group","z":"","name":"Login","tab":"7507efb3.1d90f","order":7,"disp":true,"width":"6","collapse":false},{"id":"62de6519.019a3c","type":"ui_group","z":"","name":"Logout","tab":"7507efb3.1d90f","order":6,"disp":false,"width":3,"collapse":false},{"id":"7507efb3.1d90f","type":"ui_tab","z":0,"name":"Home","icon":"dashboard","order":2}]

Thank you

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