Skip to content

Commit

Permalink
Added support for &gotodeviceip=x.x.x.x (#6672)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmmclwhitehead authored Jan 8, 2025
1 parent 90b71e9 commit 1a02539
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions views/default-mobile.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,7 @@
delete urlargs.viewmode;
delete urlargs.gotonode;
delete urlargs.gotodevicename;
delete urlargs.gotodeviceip;
delete urlargs.gotomesh;
delete urlargs.panel;

Expand Down Expand Up @@ -2229,6 +2230,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.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); 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);
Expand Down
7 changes: 6 additions & 1 deletion views/default.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,7 @@
delete urlargs.viewmode;
delete urlargs.gotonode;
delete urlargs.gotodevicename;
delete urlargs.gotodeviceip;
delete urlargs.gotomesh;
delete urlargs.gotouser;
delete urlargs.gotougrp;
Expand Down Expand Up @@ -4018,6 +4019,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.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); }
} 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);
Expand Down Expand Up @@ -19271,4 +19276,4 @@

</script>
</body>
</html>
</html>
7 changes: 6 additions & 1 deletion views/default3.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,7 @@
delete urlargs.viewmode;
delete urlargs.gotonode;
delete urlargs.gotodevicename;
delete urlargs.gotodeviceip;
delete urlargs.gotomesh;
delete urlargs.gotouser;
delete urlargs.gotougrp;
Expand Down Expand Up @@ -4474,6 +4475,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.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); }
} 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);
Expand Down Expand Up @@ -20572,4 +20577,4 @@
</script>
</body>

</html>
</html>

0 comments on commit 1a02539

Please sign in to comment.