diff --git a/meshcentral.js b/meshcentral.js index 8b8df868..bc99000f 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1473,6 +1473,7 @@ function CreateMeshCentralServer(config, args) { 24: { id: 24, localname: 'meshagent_arm-linaro', rname: 'meshagent', desc: 'Linux ARM Linaro', update: true, amt: false, platform: 'linux', core: 'linux-noamt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' }, 25: { id: 25, localname: 'meshagent_armhf', rname: 'meshagent', desc: 'Linux ARM - HardFloat', update: true, amt: false, platform: 'linux', core: 'linux-noamt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' }, // "armv6l" and "armv7l" 26: { id: 26, localname: 'meshagent_arm64', rname: 'meshagent', desc: 'Linux ARMv8-64', update: true, amt: false, platform: 'linux', core: 'linux-noamt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' }, // "aarch64" + 30: { id: 30, localname: 'meshagent_freebsd64', rname: 'meshagent', desc: 'FreeBSD x86-64', update: true, amt: false, platform: 'freebsd', core: 'linux-noamt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' }, // FreeBSD x64 10003: { id: 3, localname: 'MeshService.exe', rname: 'meshagent.exe', desc: 'Windows x86-32 service', update: true, amt: true, platform: 'win32', core: 'windows-amt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' }, // Unsigned version of the Windows MeshAgent x86 10004: { id: 4, localname: 'MeshService64.exe', rname: 'meshagent.exe', desc: 'Windows x86-64 service', update: true, amt: true, platform: 'win32', core: 'windows-amt', rcore: 'linux-recovery', arcore: 'linux-agentrecovery' } // Unsigned version of the Windows MeshAgent x64 }; diff --git a/public/scripts/meshcentral.js b/public/scripts/meshcentral.js index 73cc13ee..08188510 100644 --- a/public/scripts/meshcentral.js +++ b/public/scripts/meshcentral.js @@ -10,6 +10,7 @@ var MeshServerCreateControl = function (domain, authCookie) { obj.connectstate = 0; obj.pingTimer = null; obj.authCookie = authCookie; + obj.trace = false; obj.xxStateChange = function (newstate, errCode) { if (obj.State == newstate) return; @@ -46,10 +47,16 @@ var MeshServerCreateControl = function (domain, authCookie) { try { message = JSON.parse(e.data); } catch (e) { return; } if ((typeof message != 'object') || (message.action == 'pong')) { return; } if (message.action == 'close') { if (message.msg) { console.log(message.msg); } obj.Stop(message.cause); return; } + if (obj.trace) { console.log('RECV', message); } if (obj.onMessage) obj.onMessage(obj, message); }; - obj.send = function (x) { if (obj.socket != null && obj.connectstate == 1) { obj.socket.send(JSON.stringify(x)); } } + obj.send = function (x) { + if (obj.socket != null && obj.connectstate == 1) { + if (obj.trace) { console.log('SEND', x); } + obj.socket.send(JSON.stringify(x)); + } + } return obj; } diff --git a/views/default-min.handlebars b/views/default-min.handlebars index 2cacedff..67f364f4 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -111,6 +111,7 @@ var MeshServerCreateControl = function (domain, authCookie) { obj.connectstate = 0; obj.pingTimer = null; obj.authCookie = authCookie; + obj.trace = false; obj.xxStateChange = function (newstate, errCode) { if (obj.State == newstate) return; @@ -147,10 +148,16 @@ var MeshServerCreateControl = function (domain, authCookie) { try { message = JSON.parse(e.data); } catch (e) { return; } if ((typeof message != 'object') || (message.action == 'pong')) { return; } if (message.action == 'close') { if (message.msg) { console.log(message.msg); } obj.Stop(message.cause); return; } + if (obj.trace) { console.log('RECV', message); } if (obj.onMessage) obj.onMessage(obj, message); }; - obj.send = function (x) { if (obj.socket != null && obj.connectstate == 1) { obj.socket.send(JSON.stringify(x)); } } + obj.send = function (x) { + if (obj.socket != null && obj.connectstate == 1) { + if (obj.trace) { console.log('SEND', x); } + obj.socket.send(JSON.stringify(x)); + } + } return obj; } @@ -7061,6 +7068,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this meshserver = MeshServerCreateControl(domainUrl, authCookie); meshserver.onStateChanged = onStateChanged; meshserver.onMessage = onMessage; + meshserver.trace = (args.trace == 1); meshserver.Start(); // Setup page controls @@ -7077,7 +7085,6 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this for (var j = 1; j < 5; j++) { Q('devViewButton' + j).classList.remove('viewSelectorSel'); } Q('devViewButton' + Q('viewselect').value).classList.add('viewSelectorSel'); - // Setup upload drag & drop Q('p5filetable').addEventListener("drop", p5fileDragDrop, false); Q('p5filetable').addEventListener("dragover", p5fileDragOver, false); @@ -7350,7 +7357,6 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this } function onMessage(server, message) { - if (args.trace == 1) { console.log('MSG:', message); } switch (message.action) { case 'serverstats': { updateGeneralServerStats(message); @@ -8771,8 +8777,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this x += addHtmlValue('Link Expiration', ''); x += '
'; setDialogMode(2, "Invite", 3, performAgentInvite, x, meshid); - d2ChangedInviteType(); - validateAgentInvite(); + if (features & 64) { d2ChangedInviteType(); } else { validateAgentInvite(); } d2RequestInvitationLink(); } @@ -8783,7 +8788,7 @@ var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this function d2ChangedInviteType() { QV('urlInviteDiv', Q('d2InviteType').value == 0); QV('d2agentexpirediv', Q('agentInviteNameOs').value == 4); - if (features & 64) { QV('emailInviteDiv', Q('d2InviteType').value == 1); } + QV('emailInviteDiv', Q('d2InviteType').value == 1); validateAgentInvite(); } diff --git a/views/default-mobile-min.handlebars b/views/default-mobile-min.handlebars index 66eac647..8ac47c0a 100644 --- a/views/default-mobile-min.handlebars +++ b/views/default-mobile-min.handlebars @@ -1 +1 @@ -