2019-06-03 16:15:38 -04:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2020-06-12 17:16:24 -04:00
<html lang="en">
2019-06-03 16:15:38 -04:00
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
2020-10-28 17:46:40 -04:00
<meta name="robots" content="noindex,nofollow" />
2019-06-03 16:15:38 -04:00
<link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
2020-08-18 21:29:13 -04:00
<link rel="apple-touch-icon" href="/favicon-303x303.png" />
2020-05-02 02:11:43 -04:00
<script type="text/javascript" src="scripts/common-0.0.1 {{ min }} .js"></script>
2021-01-29 17:08:05 -05:00
<script type="text/javascript" src="scripts/qrcode.min.js"></script>
2020-02-04 19:22:00 -05:00
<title>Agent Installation</title>
2019-06-03 16:15:38 -04:00
<style>
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
}
.tab button:hover {
background-color: #ddd;
}
.tab button.active {
2019-06-07 18:55:24 -04:00
background-color: #8f8;
2019-06-03 16:15:38 -04:00
}
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
2019-06-07 18:55:24 -04:00
}
2019-06-03 16:15:38 -04:00
</style>
</head>
<body id="body" onload="if (typeof(startup) !== 'undefined') startup();" style="display:none;overflow:hidden">
<div id="container">
<!-- Begin Masthead -->
2022-02-03 07:21:19 -05:00
<div id="masthead" class="noselect AgentInviteMasthead">
2020-09-01 14:51:06 -04:00
<div style="float:left;text-shadow: 1px 1px 2px #000"> {{{ titlehtml }}} </div>
2019-12-16 20:20:39 -05:00
<div style="float:left; height: 66px; color:#c8c8c8; padding-left:14px; padding-top:7px">
2020-09-01 14:51:06 -04:00
<strong><font style="font-size:46px; font-family: Arial, Helvetica, sans-serif;text-shadow: 1px 1px 2px #000"> {{{ title1 }}} </font></strong>
2019-06-03 16:15:38 -04:00
</div>
<div style="float:left; height: 66px; color:#c8c8c8; padding-left:5px; padding-top:14px">
2020-09-01 14:51:06 -04:00
<strong><font style="font-size:14px; font-family: Arial, Helvetica, sans-serif;text-shadow: 1px 1px 2px #000"> {{{ title2 }}} </font></strong>
2019-06-03 16:15:38 -04:00
</div>
<p id="logoutControl" style="color:white;font-size:11px;margin: 10px 10px 0;"> {{{ log outControl }}} </p>
</div>
<div id="page_leftbar">
<div style="height:16px"></div>
</div>
<div id=topbar class="noselect style3" style="height:24px;position:relative">
<div id=uiMenuButton title="User interface selection" onclick="showUserInterfaceSelectMenu()">
♦
<div id=uiMenu style="display:none">
<div id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"><div class="uiSelector1"></div></div>
<div id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"><div class="uiSelector2"></div></div>
<div id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"><div class="uiSelector3"></div></div>
<div id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode"><div class="uiSelector4"></div></div>
</div>
</div>
</div>
2022-01-24 21:23:16 -05:00
<div id="column_l" style="overflow-y:auto">
2020-02-04 19:22:00 -05:00
<h1><span id="groupname">Remote Agent Installation</span></h1>
2019-06-03 16:15:38 -04:00
<p>
2020-05-15 15:06:03 -04:00
You have been invited to install an application that will allow a remote operator to securely access your computer including the desktop and files. Only follow the instructions below if this invitation was expected and you know who will be accessing your computer. Select your operating system and follow the instructions below for installation.
2019-06-03 16:15:38 -04:00
</p>
<div>
<div class="tab">
<button id="twintab64" class="tablinks" onclick="openTab(event, 'wintab64')">Windows 64bit</button>
<button id="twintab32" class="tablinks" onclick="openTab(event, 'wintab32')">Windows 32bit</button>
<button id="tlinuxtab" class="tablinks" onclick="openTab(event, 'linuxtab')">Linux</button>
2024-01-22 23:57:04 -05:00
<button id="tlinuxbinarytab" class="tablinks" onclick="openTab(event, 'linuxbinarytab')">Linux Binary</button>
2019-06-03 16:15:38 -04:00
<button id="tmacostab" class="tablinks" onclick="openTab(event, 'macostab')">MacOS</button>
2021-01-29 17:08:05 -05:00
<button id="tandrotab" class="tablinks" onclick="openTab(event, 'androtab')">Android</button>
2022-02-23 19:14:32 -05:00
<button id="tassistab" class="tablinks" onclick="openTab(event, 'assistab')">Assistant</button>
2019-06-03 16:15:38 -04:00
</div>
<div id="wintab64" class="tabcontent" style="background-color:white;color:black">
<h3>Microsoft™ Windows 64bit</h3>
<p><a id="win64url">Download the software here</a>, run it and press "Install" or "Connect".</p>
<div style="text-align:center">
2022-08-01 12:45:41 -04:00
<a id="win64url2"><img class="winagent-img" src="images/winagent.png" /></a>
2019-06-03 16:15:38 -04:00
</div>
</div>
<div id="wintab32" class="tabcontent" style="background-color:white;color:black">
<h3>Microsoft™ Windows 32bit</h3>
<p><a id="win32url">Download the software here</a>, run it and press "Install" or "Connect".</p>
<div style="text-align:center">
2022-08-01 12:45:41 -04:00
<a id="win32url2"><img class="winagent-img" src="images/winagent.png" /></a>
2019-06-03 16:15:38 -04:00
</div>
</div>
<div id="linuxtab" class="tabcontent" style="background-color:white;color:black">
<h3>Linux</h3>
<p>To install, cut and paste the following command in a root terminal.</p>
<div id="linuxinstall" style="font-family:courier,'courier new',monospace;margin-left:30px"></div>
<input type="button" value="Copy to clipboard" style="margin-left:30px;margin-top:4px" onclick="copyToClipLinuxInstall()" />
<p>To uninstall, cut and paste the following command as root.</p>
<div id="unlinuxinstall" style="font-family:courier,'courier new',monospace;margin-left:30px"></div>
<input type="button" value="Copy to clipboard" style="margin-left:30px;margin-top:4px" onclick="copyToClipLinuxUnInstall()" />
<br /><br />
</div>
2024-01-22 23:57:04 -05:00
<div id="linuxbinarytab" class="tabcontent" style="background-color:white;color:black"></div>
2019-06-03 16:15:38 -04:00
<div id="macostab" class="tabcontent" style="background-color:white;color:black">
<h3>Apple™ MacOS</h3>
2019-06-11 14:33:44 -04:00
<p><a id="macosurl">Download the installer here</a>, right click on it or press "control" and click on the file. Then select "Open" and follow the instructions.</p>
2019-06-03 16:15:38 -04:00
<div style="text-align:center">
2022-08-01 12:45:41 -04:00
<a id="macosurl2"><img src="images/macosagent.png" /></a>
2019-06-03 16:15:38 -04:00
</div>
</div>
2021-01-29 17:08:05 -05:00
<div id="androtab" class="tabcontent" style="background-color:white;color:black">
<h3>Android</h3>
<div id=agins_qrcode style=min-height:220px;min-width:220px;float:right>
<a id=android_qrimage2 href=" {{{ magenturl }}} " rel="noreferrer noopener" target=_blank>
<div id=android_qrimage style=float:right;margin-left:10px;width:220px;height:220px;cursor:pointer;margin-left:25px></div>
</a>
</div>
<div style="min-height:220px">
<p>Download the agent software using the Google Play store or APK file, install it and use the QR code on the right or the pairing link below to setup your device on this server.</p>
<p>
2023-10-20 20:29:48 -04:00
<a rel="noreferrer noopener" target=_blank href="https://play.google.com/store/apps/details?id=com.meshcentral.agent2"><img style=cursor:pointer src="images/google-play-140.png" width=140 srcset="images/google-play-280.png 2x" /></a>
2021-01-29 17:08:05 -05:00
</p>
<p>
2023-10-20 20:29:48 -04:00
<a rel="noreferrer noopener" target=_blank href="https://www.amazon.co.uk/gp/product/B097Z4Q7SK/"><img style=cursor:pointer src="images/amazon-appstore-140.png" width=140 srcset="images/amazon-appstore-280.png 2x" /></a>
</p>
<p>
<a id="androidurl">Android APK Download</a>
2021-01-29 17:08:05 -05:00
</p>
<p>
<a rel="noreferrer noopener" target=_blank href=" {{{ magenturl }}} ">Server Pairing Link</a>
</p>
</div>
</div>
2021-05-20 17:19:13 -04:00
<div id="assistab" class="tabcontent" style="background-color:white;color:black">
<h3>Assistant</h3>
<div style="min-height:220px">
2021-05-25 13:13:18 -04:00
<img src="images/assistant-200.png" srcset="images/assistant-400.png 2x" style="float:right;margin-left:8px" width="148" height="200" />
2021-05-20 17:19:13 -04:00
<p>Assistant is a Windows system tray tool that can be used when help is needed. This is not an agent that runs in the background of the managed computer, instead, it's a tool that connects to the server only when requested.</p>
<p>
<a id="assisturl" rel="noreferrer noopener" target=_blank>Download Assistant for Windows</a>
</p>
</div>
<br style="clear:both" />
</div>
2019-06-03 16:15:38 -04:00
</div>
</div>
<div id="footer">
<table cellpadding="0" cellspacing="10" style="width: 100%">
<tr>
<td style="text-align:left"></td>
<td style="text-align:right"></td>
</tr>
</table>
</div>
</div>
<script>
'use strict';
2022-06-08 13:47:23 -04:00
var random = ' {{{ randomlength }}} ' // Random length string for BREACH mitigation
2019-06-03 16:15:38 -04:00
var uiMode = parseInt(getstore('uiMode', 1));
var webPageStackMenu = false;
var webPageFullScreen = true;
var nightMode = (getstore('_nightMode', '0') == '1');
2019-12-01 18:21:33 -05:00
var domain = ' {{{ domain }}} ';
var domainUrl = ' {{{ domainurl }}} ';
var meshid = ' {{{ meshid }}} ';
2021-05-20 13:28:58 -04:00
var title = decodeURIComponent(' {{{ extitle }}} ');
2019-12-01 18:21:33 -05:00
var serverPort = ' {{{ serverport }}} ';
var serverHttps = ' {{{ serverhttps }}} ';
var serverNoProxy = ' {{{ servernoproxy }}} ';
var installFlags = ' {{{ in stallflags }}} ';
2022-02-23 19:14:32 -05:00
var showAgents = parseInt(' {{{ showagents }}} '); // 0 = Show all agents, 1 = Windows only, 2 = Linux only, 4 = MacOS only, 8 = Assistant only, 16 = Android
2021-01-29 17:08:05 -05:00
var magenturl = ' {{{ magenturl }}} ';
2019-12-01 18:21:33 -05:00
var groupName = decodeURIComponent(' {{{ meshname }}} ');
2021-04-05 00:56:36 -04:00
var urlargs = parseUriArgs();
2022-01-24 21:23:16 -05:00
function startup() {
// Setup page visuals
var hide = 0;
var globalHide = parseInt(' {{{ hide }}} ');
if (globalHide || urlargs.hide) {
if (urlargs.hide) { hide = parseInt(urlargs.hide); }
if (globalHide) { hide = (hide | globalHide); }
}
urlargs.hide = hide;
QV('masthead', !(hide & 1));
QV('topbar', !(hide & 2));
QV('footer', !(hide & 4));
if ((hide & 4) != 0) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
if (hide != 0) {
// Fix the main grid to zero-height elements we want to hide.
if (uiMode == 2) {
QS('container')['grid-template-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
QS('container')['-ms-grid-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
} else {
QS('container')['grid-template-rows'] = ((hide & 1) ? '0' : '66') + 'px ' + ((hide & 2) ? '0' : '24') + 'px auto ' + ((hide & 4) ? '0' : '45') + 'px';
QS('container')['-ms-grid-rows'] = ((hide & 1) ? '0' : '66') + 'px ' + ((hide & 2) ? '0' : '24') + 'px auto ' + ((hide & 4) ? '0' : '45') + 'px';
}
}
if (groupName != '') {
QH('groupname', format("Remote Agent Installation for { 0}", escapeHtml(groupName)));
document.title = format(" { 0} - Agent Installation", groupName);
} else {
document.title = "Agent Installation";
}
2022-02-23 19:14:32 -05:00
// Setup visible tabs
var tabcount = 0, tabselect = null;
2024-01-22 23:57:04 -05:00
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'; }
2022-02-23 19:14:32 -05:00
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));
2024-01-22 23:57:04 -05:00
QV('tlinuxbinarytab', tab4 && (tabcount > 1));
QV('tmacostab', tab5 && (tabcount > 1));
QV('tandrotab', tab6 && (tabcount > 1));
QV('tassistab', tab7 && (tabcount > 1));
2022-02-23 19:14:32 -05:00
2022-01-24 21:23:16 -05:00
userInterfaceSelectMenu();
setup();
2022-02-23 19:14:32 -05:00
openTab(null, tabselect);
2020-02-04 19:22:00 -05:00
}
2019-06-03 16:15:38 -04:00
2024-01-22 23:57:04 -05:00
function linuxBinarySetup() {
var x = '<h3>Linux Binary</h3>', moreoptions = '';
var opts = '<select id=aginsSelect onchange=addAgentToMeshClick() style=width:236px>';
opts += '<option value=5 selected>' + "Linux / BSD / macOS Binary Installer" + '</option>';
opts += '</select>';
x += '<table style=display:none><td style=width:120px><td><b>' + opts + '</b></table>';
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 += '<option value=' + binaryInstallAgentsOrder[i] + '>' + binaryInstallAgents[binaryInstallAgentsOrder[i]] + '</option>' }
x += '<div id=aginsSysTypeDiv>';
x += addHtmlValue("System Type", '<select id=aginsSysType onchange=addAgentToMeshClick() style=width:236px>' + moreoptions + '</select>');
x += '</div>';
x += '<div id=aginsTypeDiv>';
x += addHtmlValue("Installation Type", '<select id=aginsType onchange=addAgentToMeshClick() style=width:236px><option value=0>' + "Background & interactive" + '</option><option value=2>' + "Background only" + '</option><option value=1>' + "Interactive only" + '</option></select>');
x += '</div><hr>';
x += '<div id=agins_linux_inst style=display:none>' + "This is a executable on OS's with graphical user interfaces. You need to 'chmod +x meshagent' and run this file." + '<br /><br />';
x += addHtmlValue("Mesh Agent", '<a id=aginsbinlnk name="meshagents?id=' + meshid + '&installflags=0' + (urlargs.key?('&key=' + urlargs.key):'') + '">' + "meshagent" + '</a> <img src=images/link4.png height=10 width=10 title="' + "Copy agent URL to clipboard" + '" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=' + meshid + '&installflags=",1)>');
x += addHtmlValue("Command", '<input id=aginsbincmd type=text style="width:216px" readonly value=\'wget -O meshagent ' + ((serverNoProxy != 0) ?'--no-proxy':'') + ' --no-check-certificate \"https://' + servername + portStr + domainUrl + 'meshagents?id=' + meshid.split('$').join('%24').split('@').join('%40') + '\' /> <img src=images/link4.png height=10 width=10 title="' + "Copy agent URL to clipboard" + '" style=cursor:pointer onclick=copyAgentIdValue("aginsbincmd")>');
x += '</div>';
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));
}
2021-01-29 17:08:05 -05:00
// 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)
2019-06-03 16:15:38 -04:00
// Toggle user interface menu
function showUserInterfaceSelectMenu() {
Q('uiViewButton1').classList.remove('uiSelectorSel');
Q('uiViewButton2').classList.remove('uiSelectorSel');
Q('uiViewButton3').classList.remove('uiSelectorSel');
Q('uiViewButton4').classList.remove('uiSelectorSel');
try { Q('uiViewButton' + uiMode).classList.add('uiSelectorSel'); } catch (ex) { }
QV('uiMenu', (QS('uiMenu').display == 'none'));
if (nightMode) { Q('uiViewButton4').classList.add('uiSelectorSel'); }
}
function userInterfaceSelectMenu(s) {
if (s) { uiMode = s; putstore('uiMode', uiMode); }
webPageFullScreen = (uiMode < 3);
webPageStackMenu = true;//(uiMode > 1);
toggleFullScreen(0);
toggleStackMenu(0);
QC('column_l').add('room4submenu');
}
function toggleNightMode() {
nightMode = !nightMode;
if (nightMode) { QC('body').add('night'); } else { QC('body').remove('night'); }
putstore('_nightMode', nightMode ? '1' : '0');
}
// Toggle the web page to full screen
function toggleFullScreen(toggle) {
if (toggle === 1) { webPageFullScreen = !webPageFullScreen; putstore('webPageFullScreen', webPageFullScreen); }
var hide = 0;
//if (args.hide) { hide = parseInt(args.hide); }
if (webPageFullScreen == false) {
2019-12-01 18:21:33 -05:00
QC('body').remove('menu_stack');
QC('body').remove('fullscreen');
QC('body').remove('arg_hide');
2019-06-03 16:15:38 -04:00
//if (xxcurrentView >= 10) QC('column_l').add('room4submenu');
//QV('UserDummyMenuSpan', false);
//QV('page_leftbar', false);
} else {
2019-12-01 18:21:33 -05:00
QC('body').add('fullscreen');
if (hide & 16) QC('body').add('arg_hide'); // This is replacement for QV('page_leftbar', !(hide & 16));
2019-06-03 16:15:38 -04:00
//QV('UserDummyMenuSpan', (xxcurrentView < 10) && webPageFullScreen);
//QV('page_leftbar', true);
}
QV('body', true);
}
// If FullScreen, toggle menu to be horisontal or vertical
function toggleStackMenu(toggle) {
if (webPageFullScreen == true) {
if (toggle === 1) {
webPageStackMenu = !webPageStackMenu;
putstore('webPageStackMenu', webPageStackMenu);
}
if (webPageStackMenu == false) {
2019-12-01 18:21:33 -05:00
QC('body').remove('menu_stack');
2019-06-03 16:15:38 -04:00
} else {
2019-12-01 18:21:33 -05:00
QC('body').add('menu_stack');
2019-06-03 16:15:38 -04:00
//if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
}
}
}
function putstore(name, val) { try { if (typeof (localStorage) === 'undefined') return; localStorage.setItem(name, val); } catch (e) { } }
function getstore(name, val) { try { if (typeof (localStorage) === 'undefined') return val; var v = localStorage.getItem(name); if ((v == null) || (v == null)) return val; return v; } catch (e) { return val; } }
function openTab(evt, tabname) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
2019-12-01 18:21:33 -05:00
tabcontent = document.getElementsByClassName('tabcontent');
2019-06-03 16:15:38 -04:00
for (i = 0; i < tabcontent.length; i++) {
2019-12-01 18:21:33 -05:00
tabcontent[i].style.display = 'none';
2019-06-03 16:15:38 -04:00
}
// Get all elements with class="tablinks" and remove the class "active"
2019-12-01 18:21:33 -05:00
tablinks = document.getElementsByClassName('tablinks');
2019-06-03 16:15:38 -04:00
for (i = 0; i < tablinks.length; i++) {
2019-12-01 18:21:33 -05:00
tablinks[i].className = tablinks[i].className.replace(' active', '');
2019-06-03 16:15:38 -04:00
}
// Show the current tab, and add an "active" class to the button that opened the tab
2019-12-01 18:21:33 -05:00
document.getElementById(tabname).style.display = 'block';
if (evt != null) { evt.currentTarget.className += ' active'; } else { document.getElementById('t' + tabname).className += ' active'; }
2019-06-03 16:15:38 -04:00
}
var linuxInstall, linuxUnInstall;
function setup() {
var servername = window.location.hostname;
var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
2021-04-05 00:56:36 -04:00
// Loginkey
var loginkey = '';
if (urlargs.key != null) { loginkey = ('&key=' + urlargs.key); }
2019-06-03 16:15:38 -04:00
// Windows 64bit Setup
var url = 'meshagents?id=4&meshid=' + meshid;
if (installFlags != 0) { url += ('&installflags=' + installFlags); }
Q('win64url').href = url;
2022-08-01 12:45:41 -04:00
Q('win64url2').href = url;
2019-06-03 16:15:38 -04:00
// Windows 32bit Setup
url = 'meshagents?id=3&meshid=' + meshid;
if (installFlags != 0) { url += ('&installflags=' + installFlags); }
Q('win32url').href = url;
2022-08-01 12:45:41 -04:00
Q('win32url2').href = url;
2019-06-03 16:15:38 -04:00
// MacOS Setup
2019-08-08 14:15:44 -04:00
url = 'meshosxagent?id=16&meshid=' + meshid;
2019-06-03 16:15:38 -04:00
Q('macosurl').href = url;
2022-08-01 12:45:41 -04:00
Q('macosurl2').href = url;
2019-06-03 16:15:38 -04:00
// Linux Setup
if (serverHttps == 1) {
2020-04-11 21:13:15 -04:00
var portStr = (serverPort == 443) ? '' : (':' + serverPort);
2019-06-03 16:15:38 -04:00
if (serverNoProxy == 0) {
2023-09-22 08:07:45 -04:00
linuxInstall = '(wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-check-certificate -O ./meshinstall.sh || wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
linuxUnInstall = '(wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-check-certificate -O ./meshinstall.sh || wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh uninstall https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh uninstall https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
2019-06-03 16:15:38 -04:00
} else {
// Server asked that agent be installed to preferably not use a HTTP proxy.
2023-09-22 08:07:45 -04:00
linuxInstall = 'wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
linuxUnInstall = 'wget "https://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh uninstall https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh uninstall https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
2019-06-03 16:15:38 -04:00
}
} else {
2019-12-01 18:21:33 -05:00
var portStr = (serverPort == 80) ? '' : (':' + serverPort);
2019-06-03 16:15:38 -04:00
if (serverNoProxy == 0) {
2023-09-22 08:07:45 -04:00
linuxInstall = '(wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" -O ./meshinstall.sh || wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
linuxUnInstall = '(wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" -O ./meshinstall.sh || wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh uninstall http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh uninstall http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
2019-06-03 16:15:38 -04:00
} else {
// Server asked that agent be installed to preferably not use a HTTP proxy.
2023-09-22 08:07:45 -04:00
linuxInstall = 'wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
linuxUnInstall = 'wget "http://' + servername + portStr + domainUrl + 'meshagents?script=1' + loginkey + '" --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh uninstall http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\' || ./meshinstall.sh uninstall http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid + '\'\r\n';
2019-06-03 16:15:38 -04:00
}
}
QH('linuxinstall', linuxInstall);
QH('unlinuxinstall', linuxUnInstall);
2024-01-22 23:57:04 -05:00
// Linux Binary Setup
linuxBinarySetup();
2021-05-20 17:19:13 -04:00
// MeshCentral Assistant
2024-01-08 01:21:54 -05:00
url = 'meshagents?id=10006&meshid=' + meshid + '&ac= {{{ assistanttype }}} ';
2021-05-20 17:19:13 -04:00
Q('assisturl').href = url;
2023-10-20 20:29:48 -04:00
// Android Setup
var url = 'meshagents?id=14&meshid=' + meshid;
if (installFlags != 0) { url += ('&installflags=' + installFlags); }
Q('androidurl').href = url;
2019-06-03 16:15:38 -04:00
// Attempt to detect the most likely operating system for this browser
2019-06-04 16:01:32 -04:00
if (navigator.userAgent.indexOf('Win64') >= 0) { openTab(null, 'wintab64'); }
else if (navigator.userAgent.indexOf('Windows') >= 0) { openTab(null, 'wintab32'); }
else if (navigator.userAgent.indexOf('Linux') >= 0) { openTab(null, 'linuxtab'); }
else if (navigator.userAgent.indexOf('Macintosh') >= 0) { openTab(null, 'macostab'); }
2021-01-29 17:08:05 -05:00
else if (navigator.userAgent.indexOf('Android') >= 0) { openTab(null, 'mobiltab'); }
2019-06-03 16:15:38 -04:00
else { openTab(null, 'wintab64'); }
}
2019-06-06 16:34:18 -04:00
function copyToClipLinuxInstall() { copyTextToClip(linuxInstall); }
function copyToClipLinuxUnInstall() { copyTextToClip(linuxUnInstall); }
function copyTextToClip(txt) { function selectElementText(e) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(e); range.select(); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(e); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); } } var e = document.createElement('DIV'); e.textContent = txt; document.body.appendChild(e); selectElementText(e); document.execCommand('copy'); e.remove(); }
2020-02-05 18:41:11 -05:00
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; }); };
2020-06-26 21:04:28 -04:00
function escapeHtml(string) { return String(string).replace(/[&<>"'`=\/]/g, function (s) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=' }[s]; }); };
function escapeHtmlBreaks(string) { return String(string).replace(/[&<>"'`=\/]/g, function (s) { return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/', '`': '`', '=': '=', '\r': '<br />', '\n': '' }[s]; }); };
2024-01-22 23:57:04 -05:00
function addHtmlValue(t, v) { return '<table><td style=width:120px>' + t + '<td><b>' + v + '</b></table>'; }
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); }
2019-06-03 16:15:38 -04:00
</script>
</body>
</html>