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>
This commit is contained in:
Rida Abou 2025-07-02 21:38:03 +02:00 committed by GitHub
parent 11eee2f5eb
commit cb9bc580d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View File

@ -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; } } }

View File

@ -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; } } }

View File

@ -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); }