Hi,
I would like to know how to redirect tab using ui control. The following is what I had tried:
[{"id":"f7511300.c34c4","type":"mui_form","z":"6ddaac4.fd62654","name":"login-form","label":"<center><font color=\"#004080\">Welcome to <b>I4</b>Inari</font></center>","group":"b4e7b289.a5dd4","order":0,"width":0,"height":0,"options":[{"label":"Username","value":"username","type":"text","required":true},{"label":"Password","value":"password","type":"password","required":true}],"formValue":{"username":"","password":""},"payload":"","topic":"","x":100,"y":120,"wires":[["69c991a1.ab4da"]]},{"id":"69c991a1.ab4da","type":"function","z":"6ddaac4.fd62654","name":"select-query","func":"//Read username and password\nvar username = {payload: (msg.payload.username)};\nvar password = {payload: (msg.payload.password)};\n\n//SELECT Query\nmsg.topic=\"SELECT COUNT(*) AS count FROM users WHERE name='\" + username.payload + \"' AND user_name='\" + password.payload + \"'\";\n\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":120,"wires":[["2417a41b.7a67bc"]]},{"id":"2417a41b.7a67bc","type":"mysql","z":"6ddaac4.fd62654","mydb":"272ea16.4569d5e","name":"database","x":440,"y":120,"wires":[["f1d2d3f5.96db4"]]},{"id":"f1d2d3f5.96db4","type":"function","z":"6ddaac4.fd62654","name":"check","func":"var count = msg.payload[0].count;\n\nif (count > 0)\n{\n msg.payload = {tab: \"Machine Management\"};\n}\nelse\n{\n msg.payload = \"Login failed\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":120,"wires":[["f840d235.50469","9a1cb371.7387c"]]},{"id":"9a1cb371.7387c","type":"mui_text","z":"6ddaac4.fd62654","group":"b4e7b289.a5dd4","order":0,"width":0,"height":0,"name":"login-result","label":"","format":"{{msg.payload}}","layout":"col-center","x":750,"y":120,"wires":[]},{"id":"f840d235.50469","type":"mui_ui_control","z":"6ddaac4.fd62654","name":"","x":740,"y":180,"wires":[[]]},{"id":"b4e7b289.a5dd4","type":"mui_group","z":"","name":"Welcome to I4Inari","tab":"c6b47aa.71d9788","order":2,"disp":false,"width":"6","collapse":false},{"id":"272ea16.4569d5e","type":"MySQLdatabase","z":"","host":"10.21.11.15","port":"3306","db":"i4inari","tz":""},{"id":"c6b47aa.71d9788","type":"mui_tab","z":"","name":"I4Inari","icon":"home","order":1}]
Thanks for helping.