MeshCentral Router desktop/files can be launched from site link.

Ylian Saint-Hilaire committed May 21, 2021 at 09:52 UTC dabb6b358e92c0fa974ff9a44ae78e5ec1195bb0
3 files changed +5 -5
agents/MeshCentralRouter.exe
Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ
meshcentral-config-schema.json
+1 -1
@@ -317,7 +317,7 @@
317 "type": "string"
318 },
319 "protocol": {
320 - "description": "Protocol. Valid values are: custom,http,https,rdp,ssh,scp.",
320 + "description": "Protocol. Valid values are: custom,http,https,rdp,ssh,scp,mcrdesktop,mcrfiles.",
321 "type": "string"
322 },
323 "port": {
views/default.handlebars
+4 -4
@@ -2484,7 +2484,7 @@
2484 if (message.localRelay) { url += '&local=1'; }
2485 if (message.localport) { url += '&localport=' + message.localport; }
2486 if (message.ip != null) { url += ('&remoteip=' + message.ip); }
2487 - url += ('&appid=' + message.protocol + '&autoexit=1'); // Protocol: 0 = Custom, 1 = HTTP, 2 = HTTPS, 3 = RDP, 4 = PuTTY, 5 = WinSCP
2487 + url += ('&appid=' + message.protocol + '&autoexit=1'); // Protocol: 0 = Custom, 1 = HTTP, 2 = HTTPS, 3 = RDP, 4 = PuTTY, 5 = WinSCP, 6 = MCRDesktop, 7 = MCRFiles
2488 downloadFile(url, '');
2489 } else if (message.tag == 'novnc') {
2490 var vncurl = window.location.origin + domainUrl + 'novnc/vnc.html?ws=wss%3A%2F%2F' + window.location.host + encodeURIComponentEx(domainUrl) + (message.localRelay?'local':'mesh') + 'relay.ashx%3Fauth%3D' + message.cookie + '&show_dot=1' + (urlargs.key?('&key=' + urlargs.key):'') + '&l={{{lang}}}';
@@ -4222,7 +4222,7 @@
4222 for (var i in serverinfo.devicemeshrouterlinks.extralinks) {
4223 var r = serverinfo.devicemeshrouterlinks.extralinks[i], p = 0;
4224 if (doesDeviceMatchFilterTags(node, r.filter)) {
4225 - 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; }
4225 + 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; } else if (r.protocol == 'mcrdesktop') { p = 6; } else if (r.protocol == 'mcrfiles') { p = 7; }
4226 x += '<a href=# onclick=p10MCRouter("' + node._id + '",' + p + ',' + r.port + (r.ip?(',\"' + r.ip + '\"'):'') + ')>' + r.name + '</a>&nbsp;';
4227 }
4228 }
@@ -6502,7 +6502,7 @@
6502 for (var i in serverinfo.devicemeshrouterlinks.extralinks) {
6503 var r = serverinfo.devicemeshrouterlinks.extralinks[i], p = 0;
6504 if (doesDeviceMatchFilterTags(node, r.filter)) {
6505 - 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; }
6505 + 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; } else if (r.protocol == 'mcrdesktop') { p = 6; } else if (r.protocol == 'mcrfiles') { p = 7; }
6506 x += '<a href=# onclick=p10MCRouter("' + node._id + '",' + p + ',' + r.port + (r.ip?(',\"' + r.ip + '\"'):',null') + ',' + (r.localport?r.localport:0) + ') title="' + "Requires installation of MeshCentral Router." + '">' + r.name + '</a>&nbsp;';
6507 }
6508 }
@@ -7287,7 +7287,7 @@
7287 function p10MCRouter(nodeid, protocol, port, ip, localport) {
7288 var node = getNodeFromId(nodeid);
7289 if ((protocol == 3) && (port == null)) { if (node.rdpport != null) { port = node.rdpport; } else { port = 3389; } }
7290 - meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, ip: ip, tag: 'MCRouter', protocol: protocol, localport: localport }); // Protocol: 0 = Custom, 1 = HTTP, 2 = HTTPS, 3 = RDP, 4 = PuTTY, 5 = WinSCP
7290 + meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, ip: ip, tag: 'MCRouter', protocol: protocol, localport: localport }); // Protocol: 0 = Custom, 1 = HTTP, 2 = HTTPS, 3 = RDP, 4 = PuTTY, 5 = WinSCP, 6 = MCRDesktop, 7 = MCRFiles
7291 return false;
7292 }
7293