Added support for &gotodevicename=xxx as web site URL argument, #3894.

This commit is contained in:
Ylian Saint-Hilaire 2022-04-19 11:06:13 -07:00
parent 3a1d3433cf
commit d2b95fa59e
2 changed files with 10 additions and 0 deletions

View File

@ -1205,6 +1205,7 @@
delete urlargs.pass;
delete urlargs.viewmode;
delete urlargs.gotonode;
delete urlargs.gotodevicename;
delete urlargs.gotomesh;
delete urlargs.panel;
@ -2091,6 +2092,10 @@
if (getNodeFromId('node/' + domain + '/' + args.gotonode) == null) return; // This node is not loaded yet
if (args.panel) { currentDevicePanel = parseInt(args.panel); }
gotoDevice('node/' + domain + '/' + args.gotonode, xviewmode);
} else if (args.gotodevicename != null) {
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.gotomesh != null) {
if (meshes['mesh/' + domain + '/' + args.gotomesh] == null) return; // This device group is not loaded yet
gotoMesh('mesh/' + domain + '/' + args.gotomesh);

View File

@ -1465,6 +1465,7 @@
delete urlargs.pass;
delete urlargs.viewmode;
delete urlargs.gotonode;
delete urlargs.gotodevicename;
delete urlargs.gotomesh;
delete urlargs.gotouser;
delete urlargs.gotougrp;
@ -3657,6 +3658,10 @@
if (getNodeFromId('node/' + domain + '/' + args.gotonode) == null) return; // This node is not loaded yet
gotoDevice('node/' + domain + '/' + args.gotonode, xviewmode);
goBackStack.push(1);
} else if (args.gotodevicename != null) {
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.gotomesh != null) {
if (meshes['mesh/' + domain + '/' + args.gotomesh] == null) return; // This device group is not loaded yet
gotoMesh('mesh/' + domain + '/' + args.gotomesh);