diff --git a/views/agentinvite.handlebars b/views/agentinvite.handlebars index e873ed6b..7a0fb151 100644 --- a/views/agentinvite.handlebars +++ b/views/agentinvite.handlebars @@ -82,6 +82,7 @@ + @@ -114,6 +115,8 @@

+
+

Apple™ MacOS

Download the installer here, right click on it or press "control" and click on the file. Then select "Open" and follow the instructions.

@@ -222,30 +225,70 @@ // Setup visible tabs var tabcount = 0, tabselect = null; - var tab1 = (showAgents == 0) || (showAgents & 1); - var tab2 = (showAgents == 0) || (showAgents & 1); - var tab3 = (showAgents == 0) || (showAgents & 2); - var tab4 = (showAgents == 0) || (showAgents & 4); - var tab5 = (showAgents == 0) || (showAgents & 16); - var tab6 = (showAgents == 0) || (showAgents & 8); - if (tab6) { tabcount++; tabselect = 'assistab'; } - if (tab5) { tabcount++; tabselect = 'androtab'; } - if (tab4) { tabcount++; tabselect = 'macostab'; } + var tab1 = (showAgents == 0) || (showAgents & 1); //win64 + var tab2 = (showAgents == 0) || (showAgents & 1); //win32 + var tab3 = (showAgents == 0) || (showAgents & 2); //linux + var tab4 = (showAgents == 0) || (showAgents & 2); //linuxbinary + var tab5 = (showAgents == 0) || (showAgents & 4); //macos + var tab6 = (showAgents == 0) || (showAgents & 16); //android + var tab7 = (showAgents == 0) || (showAgents & 8); //assistant + if (tab7) { tabcount++; tabselect = 'assistab'; } + if (tab6) { tabcount++; tabselect = 'androtab'; } + if (tab5) { tabcount++; tabselect = 'macostab'; } + if (tab4) { tabcount++; tabselect = 'linuxbinarytab'; } if (tab3) { tabcount++; tabselect = 'linuxtab'; } if (tab2) { tabcount++; tabselect = 'wintab32'; } if (tab1) { tabcount++; tabselect = 'wintab64'; } QV('twintab64', tab1 && (tabcount > 1)); QV('twintab32', tab2 && (tabcount > 1)); QV('tlinuxtab', tab3 && (tabcount > 1)); - QV('tmacostab', tab4 && (tabcount > 1)); - QV('tandrotab', tab5 && (tabcount > 1)); - QV('tassistab', tab6 && (tabcount > 1)); + QV('tlinuxbinarytab', tab4 && (tabcount > 1)); + QV('tmacostab', tab5 && (tabcount > 1)); + QV('tandrotab', tab6 && (tabcount > 1)); + QV('tassistab', tab7 && (tabcount > 1)); userInterfaceSelectMenu(); setup(); openTab(null, tabselect); } + function linuxBinarySetup() { + var x = '

Linux Binary

', moreoptions = ''; + var opts = ''; + x += '
' + opts + '
'; + var servername = window.location.hostname; + if ((servername.indexOf('.') == -1)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name. + var portStr = (serverPort == 443) ? '' : (':' + serverPort); + var binaryInstallAgentsOrder = [ 6, 5, 10005, 25, 26, 28, 30, 32, 36, 37, 40, 41 ]; + var binaryInstallAgents = { 5 : 'Linux x86-32', 6 : 'Linux x86-64', 10005 : 'Apple OSX Universal', 25 : 'Linux ARM-HF, Rasberry Pi', 26 : 'Linux ARM64-HF', 28: 'Linux MIPS24KC (OpenWRT)', 30 : 'FreeBSD x86-64', 32: 'Linux ARM 64 bit (glibc/2.24 NOKVM)', 36: 'OpenWRT x86-64', 37: 'OpenBSD x86-64', 40: 'Linux MIPSEL24KC (OpenWRT)', 41: 'ARMADA/CORTEX-A53/MUSL (OpenWRT)' }; + for (var i in binaryInstallAgentsOrder) { moreoptions += '' } + x += '
'; + x += addHtmlValue("System Type", ''); + x += '
'; + x += '
'; + x += addHtmlValue("Installation Type", ''); + x += '

'; + x += ''; + QH('linuxbinarytab', x); + addAgentToMeshClick(); + } + + function addAgentToMeshClick() { + var v = Q('aginsSelect').value; + QV('agins_linux_un', v == 4); + QV('agins_linux_inst', v == 5); + QV('aginsSysTypeDiv', v == 5); + Q('aginsbinlnk').onclick = function() { downloadFile((Q('aginsbinlnk').name.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value + (urlargs.key?('&key=' + urlargs.key):'') + '&meshinstall=' + Q('aginsSysType').value); }; + Q('aginsbincmd').value = (Q('aginsbincmd').value.split('&installflags=')[0]) + '&installflags=' + Q('aginsType').value + (urlargs.key?('&key=' + urlargs.key):'') + '&meshinstall=' + Q('aginsSysType').value + '\"'; + QV('aginsTypeDiv', (v == 0) || (v == 5)); + QV('asinsTypeDiv', (v == 7)); + } + // Create the QR code new QRCode(Q('android_qrimage'), { text: magenturl, width: 220, height: 220, colorDark: '#000000', colorLight: '#FFF', correctLevel: QRCode.CorrectLevel.M }); Q('android_qrimage2').setAttribute('href', magenturl) @@ -388,6 +431,9 @@ QH('linuxinstall', linuxInstall); QH('unlinuxinstall', linuxUnInstall); + // Linux Binary Setup + linuxBinarySetup(); + // MeshCentral Assistant url = 'meshagents?id=10006&meshid=' + meshid + '&ac={{{assistanttype}}}'; Q('assisturl').href = url; @@ -412,6 +458,30 @@ function format(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); }; function escapeHtml(string) { return String(string).replace(/[&<>"'`=\/]/g, function (s) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=' }[s]; }); }; function escapeHtmlBreaks(string) { return String(string).replace(/[&<>"'`=\/]/g, function (s) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=', '\r': '
', '\n': '' }[s]; }); }; + function addHtmlValue(t, v) { return '
' + t + '' + v + '
'; } + function downloadFile(link, name, closeDialog) { + var element = document.createElement('a'); + element.setAttribute('href', link); + element.setAttribute('rel', 'noreferrer noopener'); + element.setAttribute('target', 'fileDownloadFrame'); + element.setAttribute('download', decodeURIComponent(name?name:'')); + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + if (closeDialog) { setDialogMode(0); } + } + function copyAgentUrl(url,addflag) { + var servername = window.location.hostname; + if ((servername.indexOf('.') == -1)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name. + var portStr = (serverPort == 443) ? '' : (':' + serverPort); + var c = 'https://' + servername + portStr + domainUrl + url; + if (addflag == 1) c += Q('aginsType').value; + c += (urlargs.key?('&key=' + urlargs.key):''); + if (Q('aginsSelect').value == 5) { c += '&meshinstall=' + Q('aginsSysType').value; } + if (Q('aginsSelect').value == 7) { c += '&ac=' + Q('asinsType').value; } + copyTextToClip(c); + } + function copyAgentIdValue(id) { copyTextToClip(Q(id).value); }