Implement ?gotodevicername url option (#7131)

* update default.handlebars to implement gotodevicername Adding a new gotodevicername url option to reach the device page * update default3.handlebars to implement gotodevicername Adding a new gotodevicername url option to reach the device page * update mobile.handlebars to implement gotodevicername Adding a new gotodevicername url option to reach the device page --------- Co-authored-by: rida.abou <rida.abouechcharaf@pytech.it>

Rida Abou committed Jul 2, 2025 at 21:38 UTC cb9bc580d022b22fb1bf2a97a0058e5116ed03b4
3 files changed +16 -1
views/default-mobile.handlebars
+5
@@ -1304,6 +1304,7 @@
1304 delete urlargs.viewmode;
1305 delete urlargs.gotonode;
1306 delete urlargs.gotodevicename;
1307 + delete urlargs.gotodevicername;
1308 delete urlargs.gotodeviceip;
1309 delete urlargs.gotomesh;
1310 delete urlargs.panel;
@@ -2251,6 +2252,10 @@
2252 var foundNode = null;
2253 if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } }
2254 if (foundNode) { gotoDevice(foundNode, xviewmode); go(xviewmode); }
2255 + } else if (args.gotodevicername != null) {
2256 + var foundNode = null;
2257 + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } }
2258 + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }
2259 } else if (args.gotodeviceip != null) {
2260 var foundNode = null;
2261 if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } }
views/default.handlebars
+5
@@ -1647,6 +1647,7 @@
1647 delete urlargs.viewmode;
1648 delete urlargs.gotonode;
1649 delete urlargs.gotodevicename;
1650 + delete urlargs.gotodevicername;
1651 delete urlargs.gotodeviceip;
1652 delete urlargs.gotomesh;
1653 delete urlargs.gotouser;
@@ -4061,6 +4062,10 @@
4062 var foundNode = null;
4063 if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } }
4064 if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }
4065 + } else if (args.gotodevicername != null) {
4066 + var foundNode = null;
4067 + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } }
4068 + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }
4069 } else if (args.gotodeviceip != null) {
4070 var foundNode = null;
4071 if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } }
views/default3.handlebars
+6 -1
@@ -2072,6 +2072,7 @@
2072 delete urlargs.viewmode;
2073 delete urlargs.gotonode;
2074 delete urlargs.gotodevicename;
2075 + delete urlargs.gotodevicername;
2076 delete urlargs.gotodeviceip;
2077 delete urlargs.gotomesh;
2078 delete urlargs.gotouser;
@@ -4528,7 +4529,11 @@
4529 var foundNode = null;
4530 if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } }
4531 if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }
4531 - } else if (args.gotodeviceip != null) {
4532 + } else if (args.gotodevicername != null) {
4533 + var foundNode = null;
4534 + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } }
4535 + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }
4536 + else if (args.gotodeviceip != null) {
4537 var foundNode = null;
4538 if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } }
4539 if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }