From cb9bc580d022b22fb1bf2a97a0058e5116ed03b4 Mon Sep 17 00:00:00 2001 From: Rida Abou <133781192+kyl00h@users.noreply.github.com> Date: Wed, 2 Jul 2025 21:38:03 +0200 Subject: [PATCH] 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 --- views/default-mobile.handlebars | 5 +++++ views/default.handlebars | 5 +++++ views/default3.handlebars | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 6473a2b8..f21d76e1 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -1304,6 +1304,7 @@ delete urlargs.viewmode; delete urlargs.gotonode; delete urlargs.gotodevicename; + delete urlargs.gotodevicername; delete urlargs.gotodeviceip; delete urlargs.gotomesh; delete urlargs.panel; @@ -2251,6 +2252,10 @@ var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } } if (foundNode) { gotoDevice(foundNode, xviewmode); go(xviewmode); } + } else if (args.gotodevicername != null) { + var foundNode = null; + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } } + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); } } else if (args.gotodeviceip != null) { var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } } diff --git a/views/default.handlebars b/views/default.handlebars index 9066b712..c5cf8d17 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -1647,6 +1647,7 @@ delete urlargs.viewmode; delete urlargs.gotonode; delete urlargs.gotodevicename; + delete urlargs.gotodevicername; delete urlargs.gotodeviceip; delete urlargs.gotomesh; delete urlargs.gotouser; @@ -4061,6 +4062,10 @@ var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } } if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); } + } else if (args.gotodevicername != null) { + var foundNode = null; + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } } + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); } } else if (args.gotodeviceip != null) { var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } } diff --git a/views/default3.handlebars b/views/default3.handlebars index 08bec01b..b67679f2 100644 --- a/views/default3.handlebars +++ b/views/default3.handlebars @@ -2072,6 +2072,7 @@ delete urlargs.viewmode; delete urlargs.gotonode; delete urlargs.gotodevicename; + delete urlargs.gotodevicername; delete urlargs.gotodeviceip; delete urlargs.gotomesh; delete urlargs.gotouser; @@ -4528,7 +4529,11 @@ var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].name == args.gotodevicename) { foundNode = nodes[i]._id; } } } if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); } - } else if (args.gotodeviceip != null) { + } else if (args.gotodevicername != null) { + var foundNode = null; + if (nodes != null) { for (var i in nodes) { if (nodes[i].rname == args.gotodevicername) { foundNode = nodes[i]._id; } } } + if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); } + else if (args.gotodeviceip != null) { var foundNode = null; if (nodes != null) { for (var i in nodes) { if (nodes[i].ip == args.gotodeviceip) { foundNode = nodes[i]._id; } } } if (foundNode) { gotoDevice(foundNode, xviewmode); goBackStack.push(1); }