mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-14 20:11:52 +00:00
Added device MeshCentral Router link filtering.
This commit is contained in:
parent
852fadeaf5
commit
069656f632
3 changed files with 11 additions and 3 deletions
|
@ -246,6 +246,11 @@
|
||||||
"port": {
|
"port": {
|
||||||
"description": "The port on the remote device.",
|
"description": "The port on the remote device.",
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"filter": {
|
||||||
|
"description": "Array of node/domain/id or mesh/domain/id strings. When set, the link will only show up for the specified devices or device groups.",
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,8 @@
|
||||||
{
|
{
|
||||||
"name": "HTTP",
|
"name": "HTTP",
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"port": 80
|
"port": 80,
|
||||||
|
"_filter": [ "mesh//xxxx", "node//xxxx" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "HTTPS",
|
"name": "HTTPS",
|
||||||
|
|
|
@ -6115,12 +6115,14 @@
|
||||||
if ((serverinfo.devicemeshrouterlinks != null) && (Array.isArray(serverinfo.devicemeshrouterlinks.extralinks))) {
|
if ((serverinfo.devicemeshrouterlinks != null) && (Array.isArray(serverinfo.devicemeshrouterlinks.extralinks))) {
|
||||||
for (var i in serverinfo.devicemeshrouterlinks.extralinks) {
|
for (var i in serverinfo.devicemeshrouterlinks.extralinks) {
|
||||||
var r = serverinfo.devicemeshrouterlinks.extralinks[i], p = 0;
|
var r = serverinfo.devicemeshrouterlinks.extralinks[i], p = 0;
|
||||||
|
if ((r.filter == null) || (Array.isArray(r.filter) && ((r.filter.indexOf(mesh._id) >= 0) || (r.filter.indexOf(node._id) >= 0)))) {
|
||||||
if (typeof r.protocol == 'number') { p = r.protocol; } else if (r.protocol == 'http') { p = 1; } else if (r.protocol == 'https') { p = 2; } else if (r.protocol == 'rdp') { p = 3; } else if (r.protocol == 'ssh') { p = 4; } else if (r.protocol == 'scp') { p = 5; }
|
if (typeof r.protocol == 'number') { p = r.protocol; } else if (r.protocol == 'http') { p = 1; } else if (r.protocol == 'https') { p = 2; } else if (r.protocol == 'rdp') { p = 3; } else if (r.protocol == 'ssh') { p = 4; } else if (r.protocol == 'scp') { p = 5; }
|
||||||
x += '<a href=# onclick=p10MCRouter("' + node._id + '",' + p + ',' + r.port + ') title="' + "Requires installation of MeshCentral Router." + '">' + r.name + '</a> ';
|
x += '<a href=# onclick=p10MCRouter("' + node._id + '",' + p + ',' + r.port + ') title="' + "Requires installation of MeshCentral Router." + '">' + r.name + '</a> ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// noVNC link
|
// noVNC link
|
||||||
if (((connectivity & 1) != 0) && (node.agent) && ((meshrights & 8) != 0) && ((features & 0x20000000) == 0) && (node.agent.id != 14)) {
|
if (((connectivity & 1) != 0) && (node.agent) && ((meshrights & 8) != 0) && ((features & 0x20000000) == 0) && (node.agent.id != 14)) {
|
||||||
|
|
Loading…
Reference in a new issue