Added launching terminal as logged in user in Linux.
Ylian Saint-Hilaire committed
Nov 25, 2019 at 15:58 UTC
a25514a2e77c478cea837a505aed58e63afcb349
8 files changed
+159
-9802
.greenlockrc
deleted
-3
@@ -1,3 +0,0 @@
1
-{
2
- "manager": "C:\\Users\\Default.DESKTOP-M9I88C9\\Desktop\\AmtWebApp\\meshcentral\\letsencrypt.js"
3
-}
\ No newline at end of file
agents/meshcore.js
+8
-8
@@ -1046,11 +1046,11 @@ function createMeshCore(agent) {
1046
if ((data == 'c') || (data == 'cr')) { this.httprequest.state = 1; /*sendConsoleText("Tunnel #" + this.httprequest.index + " now active", this.httprequest.sessionid);*/ }
1047
} else {
1048
// Handle tunnel data
1049
- if (this.httprequest.protocol == 0) { // 1 = Terminal, 2 = Desktop, 5 = Files, 6 = PowerShell
1049
+ if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Terminal (user), 8 = PowerShell (user)
1050
// Take a look at the protocol
1051
this.httprequest.protocol = parseInt(data);
1052
if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; }
1053
- if ((this.httprequest.protocol == 1) || (this.httprequest.protocol == 6)) {
1053
+ if ((this.httprequest.protocol == 1) || (this.httprequest.protocol == 6) || (this.httprequest.protocol == 7) || (this.httprequest.protocol == 8)) {
1054
// Check user access rights for terminal
1055
if (((this.httprequest.rights & MESHRIGHT_REMOTECONTROL) == 0) || ((this.httprequest.rights != 0xFFFFFFFF) && ((this.httprequest.rights & MESHRIGHT_NOTERMINAL) != 0))) {
1056
// Disengage this tunnel, user does not have the rights to do this!!
@@ -1083,10 +1083,10 @@ function createMeshCore(agent) {
1083
// Remote terminal using native pipes
1084
if (process.platform == "win32") {
1085
try {
1086
- if ((this.httprequest.protocol == 6) && (require('win-terminal').PowerShellCapable() == true)) {
1087
- this.httprequest._term = require('win-terminal').StartPowerShell(80, 25);
1086
+ if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 8)) && (require('win-terminal').PowerShellCapable() == true)) {
1087
+ this.httprequest._term = require('win-terminal').StartPowerShell(80, 25); // TODO: Start as logged in used when protocol is 8
1088
} else {
1089
- this.httprequest._term = require('win-terminal').Start(80, 25);
1089
+ this.httprequest._term = require('win-terminal').Start(80, 25); // TODO: Start as logged in used when protocol is 7
1090
}
1091
}
1092
catch (e) {
@@ -1100,13 +1100,13 @@ function createMeshCore(agent) {
1100
this.prependListener('end', function () { this.httprequest._term.end(function () { console.log('Terminal was closed'); }); });
1101
} else {
1102
if (fs.existsSync("/usr/bin/python") && fs.existsSync("/bin/bash")) {
1103
- this.httprequest.process = childProcess.execFile("/usr/bin/python", [ "python", "-c", "import pty; pty.spawn([\"/bin/bash\"])" ]);
1103
+ this.httprequest.process = childProcess.execFile("/usr/bin/python", ["python", "-c", "import pty; pty.spawn([\"/bin/bash\"])"], { uid: (this.httprequest.protocol == 7) ? require('user-sessions').consoleUid() : null }); // Start as active user
1104
if (process.platform == 'linux') { this.httprequest.process.stdin.write("export TERM='xterm'\nalias ls='ls --color=auto'\nclear\n"); }
1105
} else if (fs.existsSync("/bin/bash")) {
1106
- this.httprequest.process = childProcess.execFile("/bin/bash", ["bash", "-i"], { type: childProcess.SpawnTypes.TERM });
1106
+ this.httprequest.process = childProcess.execFile("/bin/bash", ["bash", "-i"], { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 7) ? require('user-sessions').consoleUid() : null }); // Start as active user
1107
if (process.platform == 'linux') { this.httprequest.process.stdin.write("alias ls='ls --color=auto'\nclear\n"); }
1108
} else {
1109
- this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM }); // , uid: require('user-sessions').consoleUid()
1109
+ this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 7)?require('user-sessions').consoleUid():null }); // Start as active user
1110
if (process.platform == 'linux') { this.httprequest.process.stdin.write("stty erase ^H\nalias ls='ls --color=auto'\nPS1='\\u@\\h:\\w\\$ '\nclear\n"); }
1111
}
1112
this.httprequest.process.tunnel = this;
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.4.4-s",
3
+ "version": "0.4.4-u",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",
views/default-min.handlebars
+38
-11
@@ -1,4 +1,4 @@
1
-<!doctypehtml><html dir=ltr xmlns=http://www.w3.org/1999/xhtml><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,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><meta name=format-detection content="telephone=no"><link rel="shortcut icon"type=image/x-icon href={{{domainurl}}}favicon.ico><link keeplink=1 type=text/css href=styles/style.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol3-contextmenu.min.css media=screen rel=stylesheet title=CSS><script src=scripts/common-0.0.1.js></script><script src=scripts/meshcentral.js></script><script src=scripts/amt-0.2.0.js></script><script src=scripts/amt-wsman-0.2.0.js></script><script src=scripts/amt-desktop-0.0.2.js></script><script src=scripts/amt-terminal-0.0.2.js></script><script src=scripts/zlib.js></script><script src=scripts/zlib-inflate.js></script><script src=scripts/zlib-adler32.js></script><script src=scripts/zlib-crc32.js></script><script src=scripts/amt-redir-ws-0.1.0.js></script><script src=scripts/amt-wsman-ws-0.2.0.js></script><script src=scripts/agent-redir-ws-0.1.1.js></script><script src=scripts/agent-redir-rtc-0.1.0.js></script><script src=scripts/agent-desktop-0.0.2.js></script><script src=scripts/qrcode.min.js></script><script keeplink=1 src=scripts/u2f-api.js></script><script keeplink=1 src=scripts/charts.js></script><script keeplink=1 src=scripts/filesaver.js></script><script keeplink=1 src=scripts/ol.js></script><script keeplink=1 src=scripts/ol3-contextmenu.js></script><title>{{{title}}}</title><body id=body onload='"undefined"!=typeof startup&&startup()'oncontextmenu=handleContextMenu(event) style=display:none;min-width:495px><div id=contextMenu class="contextMenu noselect"style=display:none><div id=cxinfo class=cmtext onclick=cmaction(1,event)><b>Information</b></div><div id=cxdesktop class=cmtext onclick=cmaction(3,event)>Desktop</div><div id=cxterminal class=cmtext onclick=cmaction(2,event)>Terminal</div><div id=cxfiles class=cmtext onclick=cmaction(4,event)>Files</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>Events</div><div id=cxconsole class=cmtext onclick=cmaction(6,event)>Console</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(7,event) style=display:none>Multi-Desktop</div></div><div id=meshContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxselectall class=cmtext onclick=cmmeshaction(1,event)>Select All</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>Select None</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)>Normal Connect</div><div id=cxtermps class=cmtext onclick=cmtermaction(2,event)>PowerShell Connect</div></div><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=masthead class=noselect><div class=title>{{{title}}}</div><div class=title2>{{{title2}}}</div><div style=float:right><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=display:none title="Click to view current notifications">0</div></div><p id=logoutControl>{{{logoutControl}}}<span id=idleTimeoutNotify style=color:#ff0></span></div><div id=page_leftbar><div style=height:16px></div><div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel"title="My Devices"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="My Account"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="My Events"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'><div class=lb3></div></div><div id=LeftMenuMyFiles tabindex=0 class=lbbutton style=display:none title="My Files"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'><div class=lb4></div></div><div id=LeftMenuMyUsers tabindex=0 class=lbbutton style=display:none title="My Users"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'><div class=lb5></div></div><div id=LeftMenuMyServer tabindex=0 class=lbbutton style=display:none title="My Server"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'><div class=lb6></div></div></div><div id=topbar class=noselect><div><div style=position:relative><div tabindex=0 id=uiMenuButton title="User interface selection"onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div></div></div><table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'>My Devices<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>My Account<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>My Events<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>My Files<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>My Users<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>My Server<td class="topbar_td_end style3"> </table><div id=MainSubMenuSpan style=display:none><table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainDev class="topbar_td style3x"onclick=go(10,event) onkeypress='"Enter"==event.key&&go(10)'>General<td tabindex=0 id=MainDevDesktop class="topbar_td style3x"onclick=go(11,event) onkeypress='"Enter"==event.key&&go(11)'>Desktop<td tabindex=0 id=MainDevTerminal class="topbar_td style3x"onclick=go(12,event) onkeypress='"Enter"==event.key&&go(12)'>Terminal<td tabindex=0 id=MainDevFiles class="topbar_td style3x"onclick=go(13,event) onkeypress='"Enter"==event.key&&go(13)'>Files<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>Events<td tabindex=0 id=MainDevInfo class="topbar_td style3x"onclick=go(17,event) onkeypress='"Enter"==event.key&&go(17)'>Details<td tabindex=0 id=MainDevAmt class="topbar_td style3x"onclick=go(14,event) onkeypress='"Enter"==event.key&&go(14)'>Intel® AMT<td tabindex=0 id=MainDevConsole class="topbar_td style3x"onclick=go(15,event) onkeypress='"Enter"==event.key&&go(15)'>Console<td tabindex=0 id=MainDevPlugins class="topbar_td style3x"onclick=go(19,event) onkeypress='"Enter"==event.key&&go(19)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=MeshSubMenuSpan style=display:none><table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MeshGeneral class="topbar_td style3x"onclick=go(20,event) onkeypress='"Enter"==event.key&&go(20)'>General<td class="topbar_td_end style3"> </table></div><div id=UserSubMenuSpan style=display:none><table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=UserGeneral class="topbar_td style3x"onclick=go(30,event) onkeypress='"Enter"==event.key&&go(30)'>General<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>Events<td class="topbar_td_end style3"> </table></div><div id=ServerSubMenuSpan style=display:none><table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=ServerGeneral class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>General<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>Stats<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>Console<td tabindex=0 id=ServerTrace class="topbar_td style3x"onclick=go(41,event) onkeypress='"Enter"==event.key&&go(41)'>Trace<td tabindex=0 id=ServerPlugins class="topbar_td style3x"onclick=go(42,event) onkeypress='"Enter"==event.key&&go(42)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=UserDummyMenuSpan><table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1><tr><td class=style3> </table></div></div></div></div><div id=column_l><div id=p0 style=display:none><div id=p0message><span id=p0span>Server disconnected</span>,<href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div></div><div id=p1 style=display:none><div style=display:none id=devListToolbarViewIcons><div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress='"Enter"==event.key&&onDeviceViewChange(1)'title=Columns><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=List><div class=viewSelector1></div></div><div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress='"Enter"==event.key&&onDeviceViewChange(3)'title=Desktops><div class=viewSelector3></div></div><div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress='"Enter"==event.key&&onDeviceViewChange(4)'title=Map><div class=viewSelector4></div></div></div><div><h1>My Devices</h1></div><table id=devListToolbarSpan class=noselect><tr><td class=h1><td id=devListToolbar class=style14 style=display:none> <input type=button id=SelectAllButton onclick=selectallButtonFunction() value="Select All"> <input type=button id=GroupActionButton disabled value="Group Action"onclick=groupActionFunction()> <input id=SearchInput placeholder=Filter onchange=masterUpdate(5) onkeyup=masterUpdate(5) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)> <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()><span title="Show devices operating system name">OS Name</span></label><td id=kvmListToolbar class=style14 style=display:none> <input type=button onclick=connectAllKvmFunction() value="Connect All"> <input type=button onclick=disconnectAllKvmFunction() value="Disconnect All"> <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="Automatic connect">Auto </label> <input type=button onclick=showMultiDesktopSettings() value=Settings> <td id=devMapToolbar class=style14 style=display:none> <input id=mapSearchLocation placeholder="Search Location"onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=Search title="Search for location"onclick=getSearchLocation()> <input type=button id=refreshmap title="Reset map view"value=Reset onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>View <select id=viewselect onchange=onDeviceViewChange()><option value=1>Columns<option value=2>List<option value=3>Desktops<option id=viewselectmapoption value=4>Map</select></div><div style=display:none id=devListToolbarSort>Sort <select id=sortselect onchange=masterUpdate(6)><option>Group<option>Power<option>Device<option>Tags</select> </div><div style=display:none id=devListToolbarSize>Size <select id=sizeselect onchange=onDeviceViewChange()><option value=0>Small<option value=1>Medium<option value=2>Large</select> </div><td class=h2></table><div id=NoMeshesPanel style=display:none><table><tr><td valign=top style=width:50px><img src=images/info.png><td><div id=getStarted1>To get started, <a href=# onclick="return account_createMesh()"><strong>click here to create a device group</strong></a>.</div><div id=getStarted2>No device groups.</div></table></div><div id=xdevices class=noselect style=display:none></div><div id=xdevicesmap style=display:none><div id=xmapSearchResultsDlg style=display:none><div id=xmapSearchResultsBck><div id=xmapSearchClose onclick=mapCloseSearchWindow()><b>X</b></div><div style=padding:5px>Location Results</div><div style=width:100%;margin:6px></div></div><div id=xmapSearchResults style=margin:6px></div></div></div><div id=xmap-info-window></div></div><div id=p2 style=display:none><h1>My Account</h1><img id=p2AccountImage alt=""src=images/clipboard-128.png><div id=p2AccountSecurity style=display:none><p><strong>Account security</strong><div style=margin-left:25px><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Manage authenticator app</a><br></span></div><div id=manageHardwareOtp><div class=p2AccountActions><span id=authKeySetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageHardwareOtp(0)">Manage security keys</a><br></span></div><div id=manageOtp><div class=p2AccountActions><span id=authCodesSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageOtp(0)">Manage backup codes</a><br></span></div></div></div><div id=p2AccountActions><p><strong>Account actions</strong><p class=mL><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">Verify email</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">Enable web notifications</a><br></span><a href=# onclick="return account_showLocalizationSettings()">Localization Settings</a><br><a href=# onclick="return account_showAccountNotifySettings()">Notification Settings</a><br><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">Change email address</a><br></span><a href=# onclick="return account_showChangePassword()">Change password</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">Delete account</a><br></p><br style=clear:both></div><strong>Device Groups</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>New</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>No device groups.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>Get started here!</strong></a></span></div><br style=clear:both></div><div id=p3 style=display:none><h1>My Events</h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p3limitdropdown onchange=refreshEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><h1>My Users</h1><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value=Broadcast> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="Download user information"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="Batch create many user accounts"src=images/link6.png></a></div><div><input id=UserNewAccountButton type=button style=margin-left:6px onclick=showCreateNewAccountDialog() value="New Account..."> <input id=UserSearchInput style=width:120px;margin-left:6px placeholder=Filter onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0)></div><td class=h2></table><div id=p3users></div></div><div id=p5 style=display:none><h1>My Files</h1><table id=p5toolbar cellpadding=0 cellspacing=0><tr><td id=p5filehead valign=bottom><div id=p5rightOfButtons></div><div><input type=button id=p5FolderUp disabled onclick="return p5folderup()"value=Up> <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="Select All"> <input type=button id=p5RenameFileButton disabled value=Rename onclick=p5renamefile()> <input type=button id=p5DeleteFileButton disabled value=Delete onclick=p5deletefile()> <input type=button id=p5NewFolderButton disabled value="New Folder"onclick=p5createfolder()> <input type=button id=p5UploadButton disabled value=Upload onclick=p5uploadFile()> <input type=button id=p5CutButton disabled value=Cut onclick=p5copyFile(1)> <input type=button id=p5CopyButton disabled value=Copy onclick=p5copyFile(0)> <input type=button id=p5PasteButton disabled value=Paste onclick=p5pasteFile()> </div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>These files are shared publicly, click "link" to get public url.</div></div><div id=bigok style=display:none><b>✓</b></div><div id=bigfail style=display:none><b>✗</b></div><span id=p5files></span></div><table id=p5toolbarBottom style=width:100% cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p5bottomstatus></span></table></div><div id=p6 style=display:none><img id=MainMeshImage src=serverpic.ashx><h1>My Server</h1><div id=p2ServerActions><p><strong>Server actions</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>Download server backup</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">Restore server with backup</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">Check server version</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">Show server error log</a></div></div></div><br><strong>Server Statistics</strong><br><br><div id=serverStats><div id=serverCpuChartView style=display:none><div class=chartViewCanvas><canvas id=serverCpuChart></canvas></div><div class=chartViewText id=serverCpuChartText></div></div><div id=serverMemoryChartView style=display:none><div class=chartViewCanvas><canvas id=serverMemoryChart></canvas></div><div class=chartViewText id=serverMemoryChartText></div></div><br><br><div id=serverStatsTable></div></div></div><div id=p10 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p10title><div id=p10BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p10deviceName></span></h1></div><div id=p10html></div><td style=width:20px><td style=width:200px><a href=# onclick=p10showiconselector()><img id=MainComputerImage></a><div id=MainComputerState></div></table><br><div id=p10html2></div><div id=p10html3></div></div><div id=p11 class=noselect style=display:none><div id=p11title><div id=p11deviceNameHeader><div id=p11BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Desktop - <span id=p11deviceName></span></h1></div></div><div id=p11warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p11warninga>, click here to enable it.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=deskarea0 cellpadding=0 cellspacing=0><div id=deskarea1 class=areaHead><div class=toright2><span id=p11power></span> <div class=deskareaicon title="Toggle View Mode"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="Rotate Left"onclick=drotate(-1)>↺</div><div class=deskareaicon title="Rotate Right"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="Toggle focus mode, when active only the region around the mouse is updated"onkeypress=return!1 onkeydown=return!1 value="Focus All"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskSaveBtn type=button title="Save a screenshot of the remote desktop"onkeypress=return!1 onkeydown=return!1 value=Save... onclick=deskSaveImage() class=mR> <input id=deskActionsBtn type=button title="Perform power actions on the device"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=Settings... title="Edit remote desktop settings"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="Change the power state of the remote machine"onkeypress=return!1 onkeydown=return!1 value="Power Actions..."onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)> ✖</div><input type=button id=autoconnectbutton1 value=AutoConnect onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 value=Connect onclick=connectDesktop(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan> <input type=button id=connectbutton1h value="HW Connect"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span> <input type=button id=disconnectbutton1 value=Disconnect onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=deskstatus>Disconnected</span></div></div><div id=deskarea2><div class=areaProgress><div id=progressbar></div></div></div><div id=deskarea3x><div id=DeskFocus oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></div><div id=DeskParent><canvas id=Desk width=640 height=480 oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas></div><div id=DeskTools><div id=deskToolsAreaTop><a id=DeskToolsRefreshButton style=right:2px onclick=refreshDeskTools()>Refresh</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>Processes</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>Services</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="Sort by process id"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="Sort by name"onclick=sortProcess(1)>Name</a></div><div id=DeskToolsProcesses></div></div><div id=DeskToolsServiceTab style=display:none><div id=deskToolsServiceHeader><a class=colmn1 style=width:70px title="Sort by state"onclick=sortService(0)>State</a> <a class=colmn2 title="Sort by name"onclick=sortService(1)>Name</a></div><div id=DeskToolsServices></div></div></div></div><div id=p11DeskConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p11clearConsoleMsg()></div></div><div id=deskarea4 class=areaFoot><div class=toright2><span id=DeskTimer title="Session time"></span> <select id=termdisplays style=display:none onchange=deskSetDisplay(event) onkeypress=return!1 onkeydown=return!1></select> <input id=DeskToolsButton type=button value=Tools title="Toggle tools view"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()> <span id=DeskChatButton class=deskarea title="Open chat window to this computer"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="Display a notification on the remote computer"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="Open a web address on remote computer"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span></div><div><select id=deskkeys><option value=10>Ctrl+Alt+Del<option value=5>Win<option value=0>Win+Down<option value=1>Win+Up<option value=2>Win+L<option value=3>Win+M<option value=4>Shift+Win+M<option value=6>Win+R<option value=7>Alt-F4<option value=8>Ctrl-W<option value=9>Alt-Tab<option value=11>Win+Left<option value=12>Win+Right</select> <input id=DeskWD type=button value=Send onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=Clipboard onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=Type onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="Toggle mouse and keyboard input"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>Input</span></label> </div></div></div></div><div id=p12 style=display:none><div id=p12title><div id=p12BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Terminal - <span id=p12deviceName></span></h1></div><div id=p12warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p12warninga>, click here to enable it.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=termTable style=position:relative><table style=width:100% cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=termRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div><input id=termActionsBtn type=button title="Perform power actions on the device"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction()></div><div><input type=button id=autoconnectbutton2 value=AutoConnect onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 value=Connect onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan> <input type=button id=connectbutton2h value="HW Connect"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span> <input type=button id=disconnectbutton2 value=Disconnect onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=termstatus>Disconnected</span><span id=termtitle></span></div><tr><td><div class=areaProgress><div id=termprogressbar></div></div><tr><td id=termarea3x><pre id=Term></pre><tr><td class=areaFoot><div class=toright2><span id=TermTimer title="Session time"></span> <span id=terminalSettingsButtons style=display:none><input id=id_tcrbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value=CR+LF title="Toggle what the return key will send"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Intel (F10 = ESC+[OM)"title="Toggle F1 to F10 keys emulation type"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Extended Ascii"title="Toggle terminal emulation type"onclick=termToggleType()> </span><span id=terminalSizeDropDown><select id=termSizeList onkeypress=return!1><option value=1>80x25<option value=2>100x30<option value=3 selected>Auto</select> </span><select id=specialkeylist onkeypress=return!1></select> <input id=specialkeylistinput type=button onkeypress=return!1 class=bottombutton value=Send title="Send the selected special key"onclick=sendSpecialKey()></div><div> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Ctl-C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Ctl-X onclick='termSendKey(24,"ctrlxbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=escbutton value=ESC onclick='termSendKey(27,"escbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=bsbutton value=Backspace onclick='termSendKey(8,"bsbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=Paste title="Paste text into the terminal"onclick=showTermPasteDialog()></div></table><div id=p12TermConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:45px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p12clearConsoleMsg()></div></div></div><div id=p13 style=display:none><div id=p13title><div id=p13BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Files - <span id=p13deviceName></span></h1></div><table id=p13toolbar cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><input id=filesActionsBtn type=button title="Perform power actions on the device"value=Actions onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div></div><div><input id=p13AutoConnect value=AutoConnect onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=Connect onclick=connectFiles(event) type=button> <span id=p13Status>Disconnected</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value=Up> <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="Select All"> <input type=button id=p13RenameFileButton disabled value=Rename onclick=p13renamefile()> <input type=button id=p13DeleteFileButton disabled value=Delete onclick=p13deletefile()> <input type=button id=p13ViewFileButton disabled value=Edit onclick=p13viewfile()> <input type=button id=p13NewFolderButton disabled value="New Folder"onclick=p13createfolder()> <input type=button id=p13UploadButton disabled value=Upload onclick=p13uploadFile()> <input type=button id=p13CutButton disabled value=Cut onclick=p13copyFile(1)> <input type=button id=p13CopyButton disabled value=Copy onclick=p13copyFile(0)> <input type=button id=p13PasteButton disabled value=Paste onclick=p13pasteFile()> <input type=button id=p13RefreshButton disabled value=Refresh onclick=p13folderup(9999)> </div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p13currentpath></span></div></table><div id=p13FilesConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:165px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p13clearConsoleMsg()></div><div id=p13filetable><div id=p13bigok style=display:none><b>✓</b></div><div id=p13bigfail style=display:none><b>✗</b></div><span id=p13files></span></div><table id=p13toolbarBottom cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p13bottomstatus></span></table></div><div id=p14 style=display:none><div id=p14title><div id=p14BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Intel® AMT - <span id=p14deviceName></span></h1></div><iframe id=p14iframe src={{{domainurl}}}commander.htm></iframe></div><div id=p15 style=display:none><div id=p15title><div id=p15BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1><span id=p15deviceName></span></h1></div><table id=consoleTable cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=p15coreName title="Information about current core running on this agent"></div><input type=button id=p15uploadCore value="Agent Action"onclick=p15uploadCore(event) title="Change the agent Java Script code module"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="Download console text"src=images/link4.png></div><div id=p15statetext></div><tr><td><div class=areaProgress><div id=consoleprogressbar></div></div><tr><td id=p15agentConsole><pre id=p15agentConsoleText></pre><tr><td class=areaFoot><table style=width:100%><tr><td style=width:99%><input id=p15consoleText style=width:100% onkeyup=p15consoleSend(event) onfocus=onConsoleFocus(1) onblur=onConsoleFocus(0)><td> <td id=p15outputselecttd><select id=p15outputselect><option value=1>Agent<option value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=Clear onclick=p15consoleClear()></table></table></div><div id=p16 style=display:none><div id=p16title><div id=p16BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p16events></div></div><div id=p17 style=display:none><div id=p17title><div id=p17BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Details - <span id=p17deviceName></span></h1></div><div id=p17info></div></div><div id=p20 style=display:none><picture id=MainMeshImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/mesh-256.webp><img alt=""width=200 height=200 src=images/mesh-256.png></picture><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p20meshName></span></h1><p id=p20info></div><div id=p30 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p30title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p30userName></span></h1></div><div id=p30html></div><td style=width:20px><td style=width:200px><picture id=MainUserImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/user-256.webp><img alt=""width=200 height=200 src=images/user-256.png></picture><div style=width:100%;text-align:center><strong><span id=MainUserState></span></strong></div></table><br><div id=p30html2></div><div id=p30html3></div></div><div id=p31 style=display:none><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p31userName></span></h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><h1>My Server Stats</h1><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>Connections<option value=1>Memory</select> <select id=p40time onchange=updateServerTimelineHours()><option value=3>Last 3 hours<option value=8>Last 8 hours<option value=24>Last day<option value=168>Last week<option value=720>Last 30 days</select> <img src=images/link4.png height=10 width=10 title="Download data points (.csv)"style=cursor:pointer onclick=p40downloadEvents()> </div><div><input value=Refresh type=button onclick=refreshServerTimelineStats()> <label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>Log-X</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><h1>My Server Tracing</h1><div class=areaHead><div class=toright2>Show <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>Last 100<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <input value=Clear type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="Download trace (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()> </div><div><input value=Tracing type=button onclick=setServerTracing()> <span id=p41traceStatus>None</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>My Server Plugins</h1><div class=areaHead><div class=toright2></div><div><input value="Download Plugin"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="Refresh Agent Cores"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>Notice:</b> Plugins have been altered, this may require agent core update.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>Name<th class=chDescription>Description<th class=chSite style=text-align:center>Link<th class=chVersion style=text-align:center>Version<th class=chUpgradeAvail style=text-align:center>Latest<th class=chStatus style=text-align:center>Status<th class=chAction style=text-align:center>Action<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>No plugins on server.</i></div></div><div id=p19 style=display:none><h1>Plugins - <span id=p19deviceName></span></h1><style>#p19headers{padding-right:7px;padding-bottom:10px;font-weight:700;border-bottom:1px dotted #00f}#p19headers>span:nth-child(n+2){border-left:1px solid #000}#p19headers>span{padding-left:4px;padding-right:4px}</style><div id=p19headers></div><div id=p19pages></div></div><br id=column_l_bottomgap></div><div id=footer><div class=footer1>{{{footer}}}</div><div class=footer2><a id=verifyEmailId2 style=display:none href=# onclick=account_showVerifyEmail()>Verify Email</a> <a href=terms>Terms & Privacy</a></div></div><div id=dialog class=noselect style=display:none><div id=dialogHeader><div tabindex=0 id=id_dialogclose onclick=setDialogMode() onkeypress='"Enter"==event.key&&setDialogMode()'>✖</div><div id=id_dialogtitle></div></div><div id=dialogBody><div id=dialog1><div id=id_dialogMessage></div></div><div id=dialog2><div id=id_dialogOptions></div></div><div id=dialog3><div id=d3upload><div>File Selection</div><select id=d3uploadMode onchange=d3modechange()><option value=1>Local file upload<option value=2>Server file selection</select></div><div id=d3localmode style=display:none><div>Upload File</div><form id=d3localmodeform method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input id=d3auth name=auth style=display:none> <input id=d3attrib name=attrib style=display:none> <input type=file id=d3localFile name=files onchange=d3setActions()> <input type=submit id=d3submit style=display:none></form></div><div id=d3servermode><div id=d3serveraction valign=bottom><input type=button id=p3FolderUp disabled onclick=d3folderup() value=Up> </div><div id=d3serverfiles></div></div></div><div id=dialog7><div id=d7meshkvm><h4>Agent Remote Desktop</h4><div><div>Quality</div><select id=d7bitmapquality dir=rtl></select></div><div><div>Scaling</div><select id=d7bitmapscaling dir=rtl><option selected value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select></div><div><div>Frame rate</div><select id=d7framelimiter dir=rtl><option selected value=50>Fast<option value=100>Medium<option value=400>Slow<option value=1000>Very slow</select></div></div><div id=d7amtkvm><h4>Intel® AMT Hardware KVM</h4><div><div>Image Encoding</div><select id=d7desktopmode><option value=1>RLE8, Fastest<option value=2>RLE16, Recommended<option value=3>RAW8, Slow<option value=4>RAW16, Very Slow</select></div><div><div>Other Settings</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>Show Focus Tool</label> <label style=display:block><input type=checkbox id=d7showcursor>Show Local Mouse Cursor</label> <label style=display:block><input type=checkbox id=d7localKeyMap>Local Keyboard Map</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=Cancel onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=OK onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=Delete style=display:none onclick=dialogclose(2)></div></div></div><iframe name=fileUploadFrame style=display:none></iframe><form style=display:none method=post action=uploadfile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p5fileDragName name=name><input id=p5fileDragAuthCookie name=auth><input id=p5fileDragSize name=size><input id=p5fileDragType name=type><input id=p5fileDragData name=data><input id=p5fileDragLink name=link><input type=submit id=p5loginSubmit2 style=display:none></form><form style=display:none method=post action=uploadnodefile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p13fileDragName name=name><input id=p13fileDragSize name=size><input id=p13fileDragType name=type><input id=p13fileDragData name=data><input id=p13fileDragLink name=link><input type=submit id=p13loginSubmit2 style=display:none></form><audio id=chimes><source src=sounds/chimes.mp3 type=audio/mp3></audio></div><script>'use strict';
1
+<!doctypehtml><html dir=ltr xmlns=http://www.w3.org/1999/xhtml><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,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><meta name=format-detection content="telephone=no"><link rel="shortcut icon"type=image/x-icon href={{{domainurl}}}favicon.ico><link keeplink=1 type=text/css href=styles/style.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol3-contextmenu.min.css media=screen rel=stylesheet title=CSS><script src=scripts/common-0.0.1.js></script><script src=scripts/meshcentral.js></script><script src=scripts/amt-0.2.0.js></script><script src=scripts/amt-wsman-0.2.0.js></script><script src=scripts/amt-desktop-0.0.2.js></script><script src=scripts/amt-terminal-0.0.2.js></script><script src=scripts/zlib.js></script><script src=scripts/zlib-inflate.js></script><script src=scripts/zlib-adler32.js></script><script src=scripts/zlib-crc32.js></script><script src=scripts/amt-redir-ws-0.1.0.js></script><script src=scripts/amt-wsman-ws-0.2.0.js></script><script src=scripts/agent-redir-ws-0.1.1.js></script><script src=scripts/agent-redir-rtc-0.1.0.js></script><script src=scripts/agent-desktop-0.0.2.js></script><script src=scripts/qrcode.min.js></script><script keeplink=1 src=scripts/u2f-api.js></script><script keeplink=1 src=scripts/charts.js></script><script keeplink=1 src=scripts/filesaver.js></script><script keeplink=1 src=scripts/ol.js></script><script keeplink=1 src=scripts/ol3-contextmenu.js></script><title>{{{title}}}</title><body id=body onload='"undefined"!=typeof startup&&startup()'oncontextmenu=handleContextMenu(event) style=display:none;min-width:495px><div id=contextMenu class="contextMenu noselect"style=display:none><div id=cxinfo class=cmtext onclick=cmaction(1,event)><b>Information</b></div><div id=cxdesktop class=cmtext onclick=cmaction(3,event)>Desktop</div><div id=cxterminal class=cmtext onclick=cmaction(2,event)>Terminal</div><div id=cxfiles class=cmtext onclick=cmaction(4,event)>Files</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>Events</div><div id=cxconsole class=cmtext onclick=cmaction(6,event)>Console</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(7,event) style=display:none>Multi-Desktop</div></div><div id=meshContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxselectall class=cmtext onclick=cmmeshaction(1,event)>Select All</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>Select None</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)><b>Normal Connect</b></div><div id=cxtermps class=cmtext onclick=cmtermaction(6,event)>PowerShell Connect</div></div><div id=termShellContextMenuLinux class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)><b>Root Shell</b></div><div id=cxtermps class=cmtext onclick=cmtermaction(7,event)>User Shell</div></div><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=masthead class=noselect><div class=title>{{{title}}}</div><div class=title2>{{{title2}}}</div><div style=float:right><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=display:none title="Click to view current notifications">0</div></div><p id=logoutControl>{{{logoutControl}}}<span id=idleTimeoutNotify style=color:#ff0></span></div><div id=page_leftbar><div style=height:16px></div><div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel"title="My Devices"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="My Account"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="My Events"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'><div class=lb3></div></div><div id=LeftMenuMyFiles tabindex=0 class=lbbutton style=display:none title="My Files"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'><div class=lb4></div></div><div id=LeftMenuMyUsers tabindex=0 class=lbbutton style=display:none title="My Users"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'><div class=lb5></div></div><div id=LeftMenuMyServer tabindex=0 class=lbbutton style=display:none title="My Server"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'><div class=lb6></div></div></div><div id=topbar class=noselect><div><div style=position:relative><div tabindex=0 id=uiMenuButton title="User interface selection"onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div></div></div><table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'>My Devices<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>My Account<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>My Events<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>My Files<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>My Users<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>My Server<td class="topbar_td_end style3"> </table><div id=MainSubMenuSpan style=display:none><table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainDev class="topbar_td style3x"onclick=go(10,event) onkeypress='"Enter"==event.key&&go(10)'>General<td tabindex=0 id=MainDevDesktop class="topbar_td style3x"onclick=go(11,event) onkeypress='"Enter"==event.key&&go(11)'>Desktop<td tabindex=0 id=MainDevTerminal class="topbar_td style3x"onclick=go(12,event) onkeypress='"Enter"==event.key&&go(12)'>Terminal<td tabindex=0 id=MainDevFiles class="topbar_td style3x"onclick=go(13,event) onkeypress='"Enter"==event.key&&go(13)'>Files<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>Events<td tabindex=0 id=MainDevInfo class="topbar_td style3x"onclick=go(17,event) onkeypress='"Enter"==event.key&&go(17)'>Details<td tabindex=0 id=MainDevAmt class="topbar_td style3x"onclick=go(14,event) onkeypress='"Enter"==event.key&&go(14)'>Intel® AMT<td tabindex=0 id=MainDevConsole class="topbar_td style3x"onclick=go(15,event) onkeypress='"Enter"==event.key&&go(15)'>Console<td tabindex=0 id=MainDevPlugins class="topbar_td style3x"onclick=go(19,event) onkeypress='"Enter"==event.key&&go(19)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=MeshSubMenuSpan style=display:none><table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MeshGeneral class="topbar_td style3x"onclick=go(20,event) onkeypress='"Enter"==event.key&&go(20)'>General<td class="topbar_td_end style3"> </table></div><div id=UserSubMenuSpan style=display:none><table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=UserGeneral class="topbar_td style3x"onclick=go(30,event) onkeypress='"Enter"==event.key&&go(30)'>General<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>Events<td class="topbar_td_end style3"> </table></div><div id=ServerSubMenuSpan style=display:none><table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=ServerGeneral class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>General<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>Stats<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>Console<td tabindex=0 id=ServerTrace class="topbar_td style3x"onclick=go(41,event) onkeypress='"Enter"==event.key&&go(41)'>Trace<td tabindex=0 id=ServerPlugins class="topbar_td style3x"onclick=go(42,event) onkeypress='"Enter"==event.key&&go(42)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=UserDummyMenuSpan><table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1><tr><td class=style3> </table></div></div></div></div><div id=column_l><div id=p0 style=display:none><div id=p0message><span id=p0span>Server disconnected</span>,<href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div></div><div id=p1 style=display:none><div style=display:none id=devListToolbarViewIcons><div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress='"Enter"==event.key&&onDeviceViewChange(1)'title=Columns><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=List><div class=viewSelector1></div></div><div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress='"Enter"==event.key&&onDeviceViewChange(3)'title=Desktops><div class=viewSelector3></div></div><div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress='"Enter"==event.key&&onDeviceViewChange(4)'title=Map><div class=viewSelector4></div></div></div><div><h1>My Devices</h1></div><table id=devListToolbarSpan class=noselect><tr><td class=h1><td id=devListToolbar class=style14 style=display:none> <input type=button id=SelectAllButton onclick=selectallButtonFunction() value="Select All"> <input type=button id=GroupActionButton disabled value="Group Action"onclick=groupActionFunction()> <input id=SearchInput placeholder=Filter onchange=masterUpdate(5) onkeyup=masterUpdate(5) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)> <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()><span title="Show devices operating system name">OS Name</span></label><td id=kvmListToolbar class=style14 style=display:none> <input type=button onclick=connectAllKvmFunction() value="Connect All"> <input type=button onclick=disconnectAllKvmFunction() value="Disconnect All"> <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="Automatic connect">Auto </label> <input type=button onclick=showMultiDesktopSettings() value=Settings> <td id=devMapToolbar class=style14 style=display:none> <input id=mapSearchLocation placeholder="Search Location"onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=Search title="Search for location"onclick=getSearchLocation()> <input type=button id=refreshmap title="Reset map view"value=Reset onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>View <select id=viewselect onchange=onDeviceViewChange()><option value=1>Columns<option value=2>List<option value=3>Desktops<option id=viewselectmapoption value=4>Map</select></div><div style=display:none id=devListToolbarSort>Sort <select id=sortselect onchange=masterUpdate(6)><option>Group<option>Power<option>Device<option>Tags</select> </div><div style=display:none id=devListToolbarSize>Size <select id=sizeselect onchange=onDeviceViewChange()><option value=0>Small<option value=1>Medium<option value=2>Large</select> </div><td class=h2></table><div id=NoMeshesPanel style=display:none><table><tr><td valign=top style=width:50px><img src=images/info.png><td><div id=getStarted1>To get started, <a href=# onclick="return account_createMesh()"><strong>click here to create a device group</strong></a>.</div><div id=getStarted2>No device groups.</div></table></div><div id=xdevices class=noselect style=display:none></div><div id=xdevicesmap style=display:none><div id=xmapSearchResultsDlg style=display:none><div id=xmapSearchResultsBck><div id=xmapSearchClose onclick=mapCloseSearchWindow()><b>X</b></div><div style=padding:5px>Location Results</div><div style=width:100%;margin:6px></div></div><div id=xmapSearchResults style=margin:6px></div></div></div><div id=xmap-info-window></div></div><div id=p2 style=display:none><h1>My Account</h1><img id=p2AccountImage alt=""src=images/clipboard-128.png><div id=p2AccountSecurity style=display:none><p><strong>Account security</strong><div style=margin-left:25px><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Manage authenticator app</a><br></span></div><div id=manageHardwareOtp><div class=p2AccountActions><span id=authKeySetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageHardwareOtp(0)">Manage security keys</a><br></span></div><div id=manageOtp><div class=p2AccountActions><span id=authCodesSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageOtp(0)">Manage backup codes</a><br></span></div></div></div><div id=p2AccountActions><p><strong>Account actions</strong><p class=mL><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">Verify email</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">Enable web notifications</a><br></span><a href=# onclick="return account_showLocalizationSettings()">Localization Settings</a><br><a href=# onclick="return account_showAccountNotifySettings()">Notification Settings</a><br><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">Change email address</a><br></span><a href=# onclick="return account_showChangePassword()">Change password</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">Delete account</a><br></p><br style=clear:both></div><strong>Device Groups</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>New</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>No device groups.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>Get started here!</strong></a></span></div><br style=clear:both></div><div id=p3 style=display:none><h1>My Events</h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p3limitdropdown onchange=refreshEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><h1>My Users</h1><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value=Broadcast> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="Download user information"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="Batch create many user accounts"src=images/link6.png></a></div><div><input id=UserNewAccountButton type=button style=margin-left:6px onclick=showCreateNewAccountDialog() value="New Account..."> <input id=UserSearchInput style=width:120px;margin-left:6px placeholder=Filter onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0)></div><td class=h2></table><div id=p3users></div></div><div id=p5 style=display:none><h1>My Files</h1><table id=p5toolbar cellpadding=0 cellspacing=0><tr><td id=p5filehead valign=bottom><div id=p5rightOfButtons></div><div><input type=button id=p5FolderUp disabled onclick="return p5folderup()"value=Up> <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="Select All"> <input type=button id=p5RenameFileButton disabled value=Rename onclick=p5renamefile()> <input type=button id=p5DeleteFileButton disabled value=Delete onclick=p5deletefile()> <input type=button id=p5NewFolderButton disabled value="New Folder"onclick=p5createfolder()> <input type=button id=p5UploadButton disabled value=Upload onclick=p5uploadFile()> <input type=button id=p5CutButton disabled value=Cut onclick=p5copyFile(1)> <input type=button id=p5CopyButton disabled value=Copy onclick=p5copyFile(0)> <input type=button id=p5PasteButton disabled value=Paste onclick=p5pasteFile()> </div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>These files are shared publicly, click "link" to get public url.</div></div><div id=bigok style=display:none><b>✓</b></div><div id=bigfail style=display:none><b>✗</b></div><span id=p5files></span></div><table id=p5toolbarBottom style=width:100% cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p5bottomstatus></span></table></div><div id=p6 style=display:none><img id=MainMeshImage src=serverpic.ashx><h1>My Server</h1><div id=p2ServerActions><p><strong>Server actions</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>Download server backup</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">Restore server with backup</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">Check server version</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">Show server error log</a></div></div></div><br><strong>Server Statistics</strong><br><br><div id=serverStats><div id=serverCpuChartView style=display:none><div class=chartViewCanvas><canvas id=serverCpuChart></canvas></div><div class=chartViewText id=serverCpuChartText></div></div><div id=serverMemoryChartView style=display:none><div class=chartViewCanvas><canvas id=serverMemoryChart></canvas></div><div class=chartViewText id=serverMemoryChartText></div></div><br><br><div id=serverStatsTable></div></div></div><div id=p10 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p10title><div id=p10BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p10deviceName></span></h1></div><div id=p10html></div><td style=width:20px><td style=width:200px><a href=# onclick=p10showiconselector()><img id=MainComputerImage></a><div id=MainComputerState></div></table><br><div id=p10html2></div><div id=p10html3></div></div><div id=p11 class=noselect style=display:none><div id=p11title><div id=p11deviceNameHeader><div id=p11BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Desktop - <span id=p11deviceName></span></h1></div></div><div id=p11warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p11warninga>, click here to enable it.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=deskarea0 cellpadding=0 cellspacing=0><div id=deskarea1 class=areaHead><div class=toright2><span id=p11power></span> <div class=deskareaicon title="Toggle View Mode"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="Rotate Left"onclick=drotate(-1)>↺</div><div class=deskareaicon title="Rotate Right"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="Toggle focus mode, when active only the region around the mouse is updated"onkeypress=return!1 onkeydown=return!1 value="Focus All"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskSaveBtn type=button title="Save a screenshot of the remote desktop"onkeypress=return!1 onkeydown=return!1 value=Save... onclick=deskSaveImage() class=mR> <input id=deskActionsBtn type=button title="Perform power actions on the device"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=Settings... title="Edit remote desktop settings"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="Change the power state of the remote machine"onkeypress=return!1 onkeydown=return!1 value="Power Actions..."onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)> ✖</div><input type=button id=autoconnectbutton1 value=AutoConnect onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 value=Connect onclick=connectDesktop(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan> <input type=button id=connectbutton1h value="HW Connect"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span> <input type=button id=disconnectbutton1 value=Disconnect onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=deskstatus>Disconnected</span></div></div><div id=deskarea2><div class=areaProgress><div id=progressbar></div></div></div><div id=deskarea3x><div id=DeskFocus oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></div><div id=DeskParent><canvas id=Desk width=640 height=480 oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas></div><div id=DeskTools><div id=deskToolsAreaTop><a id=DeskToolsRefreshButton style=right:2px onclick=refreshDeskTools()>Refresh</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>Processes</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>Services</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="Sort by process id"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="Sort by name"onclick=sortProcess(1)>Name</a></div><div id=DeskToolsProcesses></div></div><div id=DeskToolsServiceTab style=display:none><div id=deskToolsServiceHeader><a class=colmn1 style=width:70px title="Sort by state"onclick=sortService(0)>State</a> <a class=colmn2 title="Sort by name"onclick=sortService(1)>Name</a></div><div id=DeskToolsServices></div></div></div></div><div id=p11DeskConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p11clearConsoleMsg()></div></div><div id=deskarea4 class=areaFoot><div class=toright2><span id=DeskTimer title="Session time"></span> <select id=termdisplays style=display:none onchange=deskSetDisplay(event) onkeypress=return!1 onkeydown=return!1></select> <input id=DeskToolsButton type=button value=Tools title="Toggle tools view"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()> <span id=DeskChatButton class=deskarea title="Open chat window to this computer"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="Display a notification on the remote computer"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="Open a web address on remote computer"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span></div><div><select id=deskkeys><option value=10>Ctrl+Alt+Del<option value=5>Win<option value=0>Win+Down<option value=1>Win+Up<option value=2>Win+L<option value=3>Win+M<option value=4>Shift+Win+M<option value=6>Win+R<option value=7>Alt-F4<option value=8>Ctrl-W<option value=9>Alt-Tab<option value=11>Win+Left<option value=12>Win+Right</select> <input id=DeskWD type=button value=Send onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=Clipboard onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=Type onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="Toggle mouse and keyboard input"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>Input</span></label> </div></div></div></div><div id=p12 style=display:none><div id=p12title><div id=p12BackButton><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Terminal - <span id=p12deviceName></span></h1></div><div id=p12warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p12warninga>, click here to enable it.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=termTable style=position:relative><table style=width:100% cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=termRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div><input id=termActionsBtn type=button title="Perform power actions on the device"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction()></div><div><input type=button id=autoconnectbutton2 value=AutoConnect onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 value=Connect onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan> <input type=button id=connectbutton2h value="HW Connect"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span> <input type=button id=disconnectbutton2 value=Disconnect onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=termstatus>Disconnected</span><span id=termtitle></span></div><tr><td><div class=areaProgress><div id=termprogressbar></div></div><tr><td id=termarea3x><pre id=Term></pre><tr><td class=areaFoot><div class=toright2><span id=TermTimer title="Session time"></span> <span id=terminalSettingsButtons style=display:none><input id=id_tcrbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value=CR+LF title="Toggle what the return key will send"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Intel (F10 = ESC+[OM)"title="Toggle F1 to F10 keys emulation type"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Extended Ascii"title="Toggle terminal emulation type"onclick=termToggleType()> </span><span id=terminalSizeDropDown><select id=termSizeList onkeypress=return!1><option value=1>80x25<option value=2>100x30<option value=3 selected>Auto</select> </span><select id=specialkeylist onkeypress=return!1></select> <input id=specialkeylistinput type=button onkeypress=return!1 class=bottombutton value=Send title="Send the selected special key"onclick=sendSpecialKey()></div><div> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Ctl-C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Ctl-X onclick='termSendKey(24,"ctrlxbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=escbutton value=ESC onclick='termSendKey(27,"escbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=bsbutton value=Backspace onclick='termSendKey(8,"bsbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=Paste title="Paste text into the terminal"onclick=showTermPasteDialog()></div></table><div id=p12TermConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:45px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p12clearConsoleMsg()></div></div></div><div id=p13 style=display:none><div id=p13title><div id=p13BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Files - <span id=p13deviceName></span></h1></div><table id=p13toolbar cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><input id=filesActionsBtn type=button title="Perform power actions on the device"value=Actions onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div></div><div><input id=p13AutoConnect value=AutoConnect onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=Connect onclick=connectFiles(event) type=button> <span id=p13Status>Disconnected</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value=Up> <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="Select All"> <input type=button id=p13RenameFileButton disabled value=Rename onclick=p13renamefile()> <input type=button id=p13DeleteFileButton disabled value=Delete onclick=p13deletefile()> <input type=button id=p13ViewFileButton disabled value=Edit onclick=p13viewfile()> <input type=button id=p13NewFolderButton disabled value="New Folder"onclick=p13createfolder()> <input type=button id=p13UploadButton disabled value=Upload onclick=p13uploadFile()> <input type=button id=p13CutButton disabled value=Cut onclick=p13copyFile(1)> <input type=button id=p13CopyButton disabled value=Copy onclick=p13copyFile(0)> <input type=button id=p13PasteButton disabled value=Paste onclick=p13pasteFile()> <input type=button id=p13RefreshButton disabled value=Refresh onclick=p13folderup(9999)> </div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p13currentpath></span></div></table><div id=p13FilesConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:165px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p13clearConsoleMsg()></div><div id=p13filetable><div id=p13bigok style=display:none><b>✓</b></div><div id=p13bigfail style=display:none><b>✗</b></div><span id=p13files></span></div><table id=p13toolbarBottom cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p13bottomstatus></span></table></div><div id=p14 style=display:none><div id=p14title><div id=p14BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Intel® AMT - <span id=p14deviceName></span></h1></div><iframe id=p14iframe src={{{domainurl}}}commander.htm></iframe></div><div id=p15 style=display:none><div id=p15title><div id=p15BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1><span id=p15deviceName></span></h1></div><table id=consoleTable cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=p15coreName title="Information about current core running on this agent"></div><input type=button id=p15uploadCore value="Agent Action"onclick=p15uploadCore(event) title="Change the agent Java Script code module"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="Download console text"src=images/link4.png></div><div id=p15statetext></div><tr><td><div class=areaProgress><div id=consoleprogressbar></div></div><tr><td id=p15agentConsole><pre id=p15agentConsoleText></pre><tr><td class=areaFoot><table style=width:100%><tr><td style=width:99%><input id=p15consoleText style=width:100% onkeyup=p15consoleSend(event) onfocus=onConsoleFocus(1) onblur=onConsoleFocus(0)><td> <td id=p15outputselecttd><select id=p15outputselect><option value=1>Agent<option value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=Clear onclick=p15consoleClear()></table></table></div><div id=p16 style=display:none><div id=p16title><div id=p16BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p16events></div></div><div id=p17 style=display:none><div id=p17title><div id=p17BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Details - <span id=p17deviceName></span></h1></div><div id=p17info></div></div><div id=p20 style=display:none><picture id=MainMeshImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/mesh-256.webp><img alt=""width=200 height=200 src=images/mesh-256.png></picture><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p20meshName></span></h1><p id=p20info></div><div id=p30 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p30title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p30userName></span></h1></div><div id=p30html></div><td style=width:20px><td style=width:200px><picture id=MainUserImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/user-256.webp><img alt=""width=200 height=200 src=images/user-256.png></picture><div style=width:100%;text-align:center><strong><span id=MainUserState></span></strong></div></table><br><div id=p30html2></div><div id=p30html3></div></div><div id=p31 style=display:none><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Back onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p31userName></span></h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>Last 60<option value=120>Last 120<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><h1>My Server Stats</h1><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>Connections<option value=1>Memory</select> <select id=p40time onchange=updateServerTimelineHours()><option value=3>Last 3 hours<option value=8>Last 8 hours<option value=24>Last day<option value=168>Last week<option value=720>Last 30 days</select> <img src=images/link4.png height=10 width=10 title="Download data points (.csv)"style=cursor:pointer onclick=p40downloadEvents()> </div><div><input value=Refresh type=button onclick=refreshServerTimelineStats()> <label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>Log-X</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><h1>My Server Tracing</h1><div class=areaHead><div class=toright2>Show <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>Last 100<option value=250>Last 250<option value=500>Last 500<option value=1000>Last 1000</select> <input value=Clear type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="Download trace (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()> </div><div><input value=Tracing type=button onclick=setServerTracing()> <span id=p41traceStatus>None</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>My Server Plugins</h1><div class=areaHead><div class=toright2></div><div><input value="Download Plugin"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="Refresh Agent Cores"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>Notice:</b> Plugins have been altered, this may require agent core update.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>Name<th class=chDescription>Description<th class=chSite style=text-align:center>Link<th class=chVersion style=text-align:center>Version<th class=chUpgradeAvail style=text-align:center>Latest<th class=chStatus style=text-align:center>Status<th class=chAction style=text-align:center>Action<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>No plugins on server.</i></div></div><div id=p19 style=display:none><h1>Plugins - <span id=p19deviceName></span></h1><style>#p19headers{padding-right:7px;padding-bottom:10px;font-weight:700;border-bottom:1px dotted #00f}#p19headers>span:nth-child(n+2){border-left:1px solid #000}#p19headers>span{padding-left:4px;padding-right:4px}</style><div id=p19headers></div><div id=p19pages></div></div><br id=column_l_bottomgap></div><div id=footer><div class=footer1>{{{footer}}}</div><div class=footer2><a id=verifyEmailId2 style=display:none href=# onclick=account_showVerifyEmail()>Verify Email</a> <a href=terms>Terms & Privacy</a></div></div><div id=dialog class=noselect style=display:none><div id=dialogHeader><div tabindex=0 id=id_dialogclose onclick=setDialogMode() onkeypress='"Enter"==event.key&&setDialogMode()'>✖</div><div id=id_dialogtitle></div></div><div id=dialogBody><div id=dialog1><div id=id_dialogMessage></div></div><div id=dialog2><div id=id_dialogOptions></div></div><div id=dialog3><div id=d3upload><div>File Selection</div><select id=d3uploadMode onchange=d3modechange()><option value=1>Local file upload<option value=2>Server file selection</select></div><div id=d3localmode style=display:none><div>Upload File</div><form id=d3localmodeform method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input id=d3auth name=auth style=display:none> <input id=d3attrib name=attrib style=display:none> <input type=file id=d3localFile name=files onchange=d3setActions()> <input type=submit id=d3submit style=display:none></form></div><div id=d3servermode><div id=d3serveraction valign=bottom><input type=button id=p3FolderUp disabled onclick=d3folderup() value=Up> </div><div id=d3serverfiles></div></div></div><div id=dialog7><div id=d7meshkvm><h4>Agent Remote Desktop</h4><div><div>Quality</div><select id=d7bitmapquality dir=rtl></select></div><div><div>Scaling</div><select id=d7bitmapscaling dir=rtl><option selected value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select></div><div><div>Frame rate</div><select id=d7framelimiter dir=rtl><option selected value=50>Fast<option value=100>Medium<option value=400>Slow<option value=1000>Very slow</select></div></div><div id=d7amtkvm><h4>Intel® AMT Hardware KVM</h4><div><div>Image Encoding</div><select id=d7desktopmode><option value=1>RLE8, Fastest<option value=2>RLE16, Recommended<option value=3>RAW8, Slow<option value=4>RAW16, Very Slow</select></div><div><div>Other Settings</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>Show Focus Tool</label> <label style=display:block><input type=checkbox id=d7showcursor>Show Local Mouse Cursor</label> <label style=display:block><input type=checkbox id=d7localKeyMap>Local Keyboard Map</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=Cancel onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=OK onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=Delete style=display:none onclick=dialogclose(2)></div></div></div><iframe name=fileUploadFrame style=display:none></iframe><form style=display:none method=post action=uploadfile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p5fileDragName name=name><input id=p5fileDragAuthCookie name=auth><input id=p5fileDragSize name=size><input id=p5fileDragType name=type><input id=p5fileDragData name=data><input id=p5fileDragLink name=link><input type=submit id=p5loginSubmit2 style=display:none></form><form style=display:none method=post action=uploadnodefile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p13fileDragName name=name><input id=p13fileDragSize name=size><input id=p13fileDragType name=type><input id=p13fileDragData name=data><input id=p13fileDragLink name=link><input type=submit id=p13loginSubmit2 style=display:none></form><audio id=chimes><source src=sounds/chimes.mp3 type=audio/mp3></audio></div><script>'use strict';
2
3
// Process server-side web state
4
var webState = '{{{webstate}}}';
@@ -2529,18 +2529,24 @@
2529
contextmenudiv.style.left = event.pageX + 'px';
2530
contextmenudiv.style.top = event.pageY + 'px';
2531
contextmenudiv.style.display = 'block';
2532
- } else if (elem && elem != null && elem.id == 'MxMESH') {
2532
+ } else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
2533
contextelement = elem;
2534
- var contextmenudiv = document.getElementById('meshContextMenu');
2534
+ var contextmenudiv = document.getElementById('termShellContextMenuLinux');
2535
contextmenudiv.style.left = event.pageX + 'px';
2536
contextmenudiv.style.top = event.pageY + 'px';
2537
contextmenudiv.style.display = 'block';
2538
- /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
2538
+ } else if (elem && elem != null && elem.id == 'MxMESH') {
2539
contextelement = elem;
2540
- var contextmenudiv = document.getElementById('pluginTabContextMenu');
2540
+ var contextmenudiv = document.getElementById('meshContextMenu');
2541
contextmenudiv.style.left = event.pageX + 'px';
2542
contextmenudiv.style.top = event.pageY + 'px';
2543
- contextmenudiv.style.display = 'block';*/
2543
+ contextmenudiv.style.display = 'block';
2544
+ /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
2545
+ contextelement = elem;
2546
+ var contextmenudiv = document.getElementById('pluginTabContextMenu');
2547
+ contextmenudiv.style.left = event.pageX + 'px';
2548
+ contextmenudiv.style.top = event.pageY + 'px';
2549
+ contextmenudiv.style.display = 'block';*/
2550
} else {
2551
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
2552
if (!elem || elem == null) return true;
@@ -2609,7 +2615,7 @@
2615
}
2616
2617
function cmtermaction(action) {
2612
- connectTerminal(null, 1, { powershell: (action == 2) });
2618
+ connectTerminal(null, 1, { protocol: action });
2619
}
2620
2621
/*
@@ -2628,6 +2634,7 @@
2634
QV('contextMenu', false);
2635
QV('meshContextMenu', false);
2636
QV('termShellContextMenu', false);
2637
+ QV('termShellContextMenuLinux', false);
2638
//QV('pluginTabContextMenu', false);
2639
contextelement = null;
2640
}
@@ -3028,7 +3035,7 @@
3035
// Called When Place a node option is clicked from context menu
3036
function placeNode(coords) {
3037
if (xxdialogMode) return;
3031
- var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
3038
+ var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Search" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
3039
for (var i in nodes) {
3040
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
3041
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
@@ -4892,7 +4899,7 @@
4899
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
4900
} else {
4901
// Setup a mesh agent terminal
4895
- var termoptions = {};
4902
+ var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
4903
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
4904
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
4905
if (Q('termSizeList').value == 3) {
@@ -4902,7 +4909,16 @@
4909
termoptions.xterm = true;
4910
}
4911
}
4905
- if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
4912
+
4913
+ // If shift is pressed
4914
+ if ((e && (e.shiftKey == true))) {
4915
+ if (currentNode.agent.id > 4) {
4916
+ if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
4917
+ } else {
4918
+ if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
4919
+ }
4920
+ }
4921
+
4922
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
4923
terminal.debugmode = debugmode;
4924
terminal.m.debugmode = debugmode;
@@ -8402,6 +8418,7 @@
8418
// My Server
8419
if ((x == 6) || (x == 115)) QC('MainMenuMyServer').add(mainMenuActiveClass);
8420
if ((x == 6) || (x == 115) || (x == 40) || (x == 41) || (x == 42)) QC('LeftMenuMyServer').add(leftMenuActiveClass);
8421
+ QV('ServerPlugins', pluginHandler != null);
8422
8423
// column_l max-height
8424
if (webPageStackMenu && (x >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
@@ -8450,8 +8467,12 @@
8467
}
8468
}
8469
8453
- // Plugin
8470
+ //
8471
+ // Plugin Management
8472
+ //
8473
+
8474
function updatePluginList(versInfo) {
8475
+ if (pluginHandler == null) return;
8476
if (Array.isArray(versInfo)) { versInfo.forEach(function(v) { updatePluginList(v); }); }
8477
QV('pluginNoneNotice', installedPluginList.length == 0);
8478
if (installedPluginList.length) {
@@ -8542,15 +8563,18 @@
8563
}
8564
8565
function refreshPluginLatest() {
8566
+ if (pluginHandler == null) return;
8567
meshserver.send({ action: 'pluginLatestCheck' });
8568
}
8569
8570
function distributeCore() {
8571
+ if (pluginHandler == null) return;
8572
meshserver.send({ action: 'distributeCore', nodes: nodes }); // All nodes the user has access to
8573
QV('pluginRestartNotice', false);
8574
}
8575
8576
function pluginActionEx() {
8577
+ if (pluginHandler == null) return;
8578
var act = Q('lastPluginAct').value, id = Q('lastPluginId').value, pVersUrl = Q('lastPluginVersion').value;
8579
8580
switch(act) {
@@ -8575,6 +8599,7 @@
8599
}
8600
8601
function pluginAction(elem, id) {
8602
+ if (pluginHandler == null) return;
8603
if (elem.value == 'downgrade') {
8604
meshserver.send({ 'action': 'getpluginversions', 'id': id });
8605
} else {
@@ -8586,6 +8611,7 @@
8611
}
8612
8613
function goPlugin(pname, title) {
8614
+ if (pluginHandler == null) return;
8615
/*
8616
let holder = Q('PluginSubMenu').querySelectorAll('tr')[0];
8617
let loadedPluginsTDs = holder.querySelectorAll('td');
@@ -8641,6 +8667,7 @@
8667
}
8668
8669
function noGoPlugin(el) {
8670
+ if (pluginHandler == null) return;
8671
/*
8672
QV('PluginSubMenuSpan', false);
8673
let loadedPluginsTDs = Q('PluginSubMenu').querySelectorAll('td');
views/default.handlebars
+31
-11
@@ -54,8 +54,12 @@
54
-->
55
</div>
56
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
57
- <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)">Normal Connect</div>
58
- <div id="cxtermps" class="cmtext" onclick="cmtermaction(2,event)">PowerShell Connect</div>
57
+ <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Normal Connect</b></div>
58
+ <div id="cxtermps" class="cmtext" onclick="cmtermaction(6,event)">PowerShell Connect</div>
59
+ </div>
60
+ <div id="termShellContextMenuLinux" class="contextMenu noselect" style="display:none;min-width:0px">
61
+ <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Root Shell</b></div>
62
+ <div id="cxtermps" class="cmtext" onclick="cmtermaction(7,event)">User Shell</div>
63
</div>
64
<!--
65
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
@@ -3539,18 +3543,24 @@
3543
contextmenudiv.style.left = event.pageX + 'px';
3544
contextmenudiv.style.top = event.pageY + 'px';
3545
contextmenudiv.style.display = 'block';
3542
- } else if (elem && elem != null && elem.id == 'MxMESH') {
3546
+ } else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
3547
contextelement = elem;
3544
- var contextmenudiv = document.getElementById('meshContextMenu');
3548
+ var contextmenudiv = document.getElementById('termShellContextMenuLinux');
3549
contextmenudiv.style.left = event.pageX + 'px';
3550
contextmenudiv.style.top = event.pageY + 'px';
3551
contextmenudiv.style.display = 'block';
3548
- /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
3552
+ } else if (elem && elem != null && elem.id == 'MxMESH') {
3553
contextelement = elem;
3550
- var contextmenudiv = document.getElementById('pluginTabContextMenu');
3554
+ var contextmenudiv = document.getElementById('meshContextMenu');
3555
contextmenudiv.style.left = event.pageX + 'px';
3556
contextmenudiv.style.top = event.pageY + 'px';
3553
- contextmenudiv.style.display = 'block';*/
3557
+ contextmenudiv.style.display = 'block';
3558
+ /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
3559
+ contextelement = elem;
3560
+ var contextmenudiv = document.getElementById('pluginTabContextMenu');
3561
+ contextmenudiv.style.left = event.pageX + 'px';
3562
+ contextmenudiv.style.top = event.pageY + 'px';
3563
+ contextmenudiv.style.display = 'block';*/
3564
} else {
3565
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
3566
if (!elem || elem == null) return true;
@@ -3619,7 +3629,7 @@
3629
}
3630
3631
function cmtermaction(action) {
3622
- connectTerminal(null, 1, { powershell: (action == 2) });
3632
+ connectTerminal(null, 1, { protocol: action });
3633
}
3634
3635
/*
@@ -3638,6 +3648,7 @@
3648
QV('contextMenu', false);
3649
QV('meshContextMenu', false);
3650
QV('termShellContextMenu', false);
3651
+ QV('termShellContextMenuLinux', false);
3652
//QV('pluginTabContextMenu', false);
3653
contextelement = null;
3654
}
@@ -4038,7 +4049,7 @@
4049
// Called When Place a node option is clicked from context menu
4050
function placeNode(coords) {
4051
if (xxdialogMode) return;
4041
- var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
4052
+ var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Search" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
4053
for (var i in nodes) {
4054
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
4055
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
@@ -5902,7 +5913,7 @@
5913
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
5914
} else {
5915
// Setup a mesh agent terminal
5905
- var termoptions = {};
5916
+ var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
5917
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
5918
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
5919
if (Q('termSizeList').value == 3) {
@@ -5912,7 +5923,16 @@
5923
termoptions.xterm = true;
5924
}
5925
}
5915
- if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
5926
+
5927
+ // If shift is pressed
5928
+ if ((e && (e.shiftKey == true))) {
5929
+ if (currentNode.agent.id > 4) {
5930
+ if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
5931
+ } else {
5932
+ if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
5933
+ }
5934
+ }
5935
+
5936
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
5937
terminal.debugmode = debugmode;
5938
terminal.m.debugmode = debugmode;
views/translations/default-min_fr.handlebars
+38
-11
@@ -1,4 +1,4 @@
1
-<!doctypehtml><html dir=ltr xmlns=http://www.w3.org/1999/xhtml><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,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><meta name=format-detection content="telephone=no"><link rel="shortcut icon"type=image/x-icon href={{{domainurl}}}favicon.ico><link keeplink=1 type=text/css href=styles/style.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol3-contextmenu.min.css media=screen rel=stylesheet title=CSS><script src=scripts/common-0.0.1.js></script><script src=scripts/meshcentral.js></script><script src=scripts/amt-0.2.0.js></script><script src=scripts/amt-wsman-0.2.0.js></script><script src=scripts/amt-desktop-0.0.2.js></script><script src=scripts/amt-terminal-0.0.2.js></script><script src=scripts/zlib.js></script><script src=scripts/zlib-inflate.js></script><script src=scripts/zlib-adler32.js></script><script src=scripts/zlib-crc32.js></script><script src=scripts/amt-redir-ws-0.1.0.js></script><script src=scripts/amt-wsman-ws-0.2.0.js></script><script src=scripts/agent-redir-ws-0.1.1.js></script><script src=scripts/agent-redir-rtc-0.1.0.js></script><script src=scripts/agent-desktop-0.0.2.js></script><script src=scripts/qrcode.min.js></script><script keeplink=1 src=scripts/u2f-api.js></script><script keeplink=1 src=scripts/charts.js></script><script keeplink=1 src=scripts/filesaver.js></script><script keeplink=1 src=scripts/ol.js></script><script keeplink=1 src=scripts/ol3-contextmenu.js></script><title>{{{title}}}</title><body id=body onload='"undefined"!=typeof startup&&startup()'oncontextmenu=handleContextMenu(event) style=display:none;min-width:495px><div id=contextMenu class="contextMenu noselect"style=display:none><div id=cxinfo class=cmtext onclick=cmaction(1,event)><b>Information</b></div><div id=cxdesktop class=cmtext onclick=cmaction(3,event)>Desktop</div><div id=cxterminal class=cmtext onclick=cmaction(2,event)>Terminal</div><div id=cxfiles class=cmtext onclick=cmaction(4,event)>Files</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>Events</div><div id=cxconsole class=cmtext onclick=cmaction(6,event)>Console</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(7,event) style=display:none>Multi-Desktop</div></div><div id=meshContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxselectall class=cmtext onclick=cmmeshaction(1,event)>Tout Sélectionner</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>Rien sélectionner</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)>Normal Connect</div><div id=cxtermps class=cmtext onclick=cmtermaction(2,event)>PowerShell Connect</div></div><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=masthead class=noselect><div class=title>{{{title}}}</div><div class=title2>{{{title2}}}</div><div style=float:right><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=display:none title="Click to view current notifications">0</div></div><p id=logoutControl>{{{logoutControl}}}<span id=idleTimeoutNotify style=color:#ff0></span></div><div id=page_leftbar><div style=height:16px></div><div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel"title="Mes Appareils"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="Mon Compte"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="Mes Événements"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'><div class=lb3></div></div><div id=LeftMenuMyFiles tabindex=0 class=lbbutton style=display:none title="Mes Dossiers"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'><div class=lb4></div></div><div id=LeftMenuMyUsers tabindex=0 class=lbbutton style=display:none title="Mes Utilisateurs"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'><div class=lb5></div></div><div id=LeftMenuMyServer tabindex=0 class=lbbutton style=display:none title="Mon Serveur"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'><div class=lb6></div></div></div><div id=topbar class=noselect><div><div style=position:relative><div tabindex=0 id=uiMenuButton title="User interface selection"onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Basculer mode nuit"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div></div></div><table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'>Mes Appareils<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>Mon Compte<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>Mes Événements<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>Mes Dossiers<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>Mes Utilisateurs<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>Mon Serveur<td class="topbar_td_end style3"> </table><div id=MainSubMenuSpan style=display:none><table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainDev class="topbar_td style3x"onclick=go(10,event) onkeypress='"Enter"==event.key&&go(10)'>General<td tabindex=0 id=MainDevDesktop class="topbar_td style3x"onclick=go(11,event) onkeypress='"Enter"==event.key&&go(11)'>Desktop<td tabindex=0 id=MainDevTerminal class="topbar_td style3x"onclick=go(12,event) onkeypress='"Enter"==event.key&&go(12)'>Terminal<td tabindex=0 id=MainDevFiles class="topbar_td style3x"onclick=go(13,event) onkeypress='"Enter"==event.key&&go(13)'>Files<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>Events<td tabindex=0 id=MainDevInfo class="topbar_td style3x"onclick=go(17,event) onkeypress='"Enter"==event.key&&go(17)'>Details<td tabindex=0 id=MainDevAmt class="topbar_td style3x"onclick=go(14,event) onkeypress='"Enter"==event.key&&go(14)'>Intel® AMT<td tabindex=0 id=MainDevConsole class="topbar_td style3x"onclick=go(15,event) onkeypress='"Enter"==event.key&&go(15)'>Console<td tabindex=0 id=MainDevPlugins class="topbar_td style3x"onclick=go(19,event) onkeypress='"Enter"==event.key&&go(19)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=MeshSubMenuSpan style=display:none><table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MeshGeneral class="topbar_td style3x"onclick=go(20,event) onkeypress='"Enter"==event.key&&go(20)'>General<td class="topbar_td_end style3"> </table></div><div id=UserSubMenuSpan style=display:none><table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=UserGeneral class="topbar_td style3x"onclick=go(30,event) onkeypress='"Enter"==event.key&&go(30)'>General<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>Events<td class="topbar_td_end style3"> </table></div><div id=ServerSubMenuSpan style=display:none><table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=ServerGeneral class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>General<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>Stats<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>Console<td tabindex=0 id=ServerTrace class="topbar_td style3x"onclick=go(41,event) onkeypress='"Enter"==event.key&&go(41)'>Trace<td tabindex=0 id=ServerPlugins class="topbar_td style3x"onclick=go(42,event) onkeypress='"Enter"==event.key&&go(42)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=UserDummyMenuSpan><table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1><tr><td class=style3> </table></div></div></div></div><div id=column_l><div id=p0 style=display:none><div id=p0message><span id=p0span>Server disconnected</span>,<href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div></div><div id=p1 style=display:none><div style=display:none id=devListToolbarViewIcons><div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress='"Enter"==event.key&&onDeviceViewChange(1)'title=Columns><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=List><div class=viewSelector1></div></div><div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress='"Enter"==event.key&&onDeviceViewChange(3)'title=Desktops><div class=viewSelector3></div></div><div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress='"Enter"==event.key&&onDeviceViewChange(4)'title=Carte><div class=viewSelector4></div></div></div><div><h1>Mes Appareils</h1></div><table id=devListToolbarSpan class=noselect><tr><td class=h1><td id=devListToolbar class=style14 style=display:none> <input type=button id=SelectAllButton onclick=selectallButtonFunction() value="Tout Sélectionner"> <input type=button id=GroupActionButton disabled value="Action de groupe"onclick=groupActionFunction()> <input id=SearchInput placeholder=Filter onchange=masterUpdate(5) onkeyup=masterUpdate(5) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)> <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()><span title="Show devices operating system name">Nom du système</span></label><td id=kvmListToolbar class=style14 style=display:none> <input type=button onclick=connectAllKvmFunction() value="Connect All"> <input type=button onclick=disconnectAllKvmFunction() value="Disconnect All"> <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="Connexion automatique">Automatique </label> <input type=button onclick=showMultiDesktopSettings() value=Settings> <td id=devMapToolbar class=style14 style=display:none> <input id=mapSearchLocation placeholder="Recherche de lieu"onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=Chercher title="Recherche de lieu"onclick=getSearchLocation()> <input type=button id=refreshmap title="Reset map view"value=Réinitialiser onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>View <select id=viewselect onchange=onDeviceViewChange()><option value=1>Columns<option value=2>List<option value=3>Desktops<option id=viewselectmapoption value=4>Carte</select></div><div style=display:none id=devListToolbarSort>Trier <select id=sortselect onchange=masterUpdate(6)><option>Groupe<option>Power<option>Device<option>Tags</select> </div><div style=display:none id=devListToolbarSize>Taille <select id=sizeselect onchange=onDeviceViewChange()><option value=0>Petit<option value=1>Medium<option value=2>Grand</select> </div><td class=h2></table><div id=NoMeshesPanel style=display:none><table><tr><td valign=top style=width:50px><img src=images/info.png><td><div id=getStarted1>To get started, <a href=# onclick="return account_createMesh()"><strong>click here to create a device group</strong></a>.</div><div id=getStarted2>Aucun groupe d'appareils.</div></table></div><div id=xdevices class=noselect style=display:none></div><div id=xdevicesmap style=display:none><div id=xmapSearchResultsDlg style=display:none><div id=xmapSearchResultsBck><div id=xmapSearchClose onclick=mapCloseSearchWindow()><b>X</b></div><div style=padding:5px>Location Results</div><div style=width:100%;margin:6px></div></div><div id=xmapSearchResults style=margin:6px></div></div></div><div id=xmap-info-window></div></div><div id=p2 style=display:none><h1>Mon Compte</h1><img id=p2AccountImage alt=""src=images/clipboard-128.png><div id=p2AccountSecurity style=display:none><p><strong>Account security</strong><div style=margin-left:25px><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Manage authenticator app</a><br></span></div><div id=manageHardwareOtp><div class=p2AccountActions><span id=authKeySetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageHardwareOtp(0)">Manage security keys</a><br></span></div><div id=manageOtp><div class=p2AccountActions><span id=authCodesSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageOtp(0)">Manage backup codes</a><br></span></div></div></div><div id=p2AccountActions><p><strong>Account actions</strong><p class=mL><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">Verify email</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">Enable web notifications</a><br></span><a href=# onclick="return account_showLocalizationSettings()">Localization Settings</a><br><a href=# onclick="return account_showAccountNotifySettings()">Notification Settings</a><br><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">Change email address</a><br></span><a href=# onclick="return account_showChangePassword()">Change password</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">Delete account</a><br></p><br style=clear:both></div><strong>Device Groups</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>Nouveau</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>Aucun groupe d'appareils.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>Get started here!</strong></a></span></div><br style=clear:both></div><div id=p3 style=display:none><h1>Mes Événements</h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p3limitdropdown onchange=refreshEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><h1>Mes Utilisateurs</h1><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value=Diffuser> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="Download user information"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="Batch create many user accounts"src=images/link6.png></a></div><div><input id=UserNewAccountButton type=button style=margin-left:6px onclick=showCreateNewAccountDialog() value="Nouveau Compte..."> <input id=UserSearchInput style=width:120px;margin-left:6px placeholder=Filter onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0)></div><td class=h2></table><div id=p3users></div></div><div id=p5 style=display:none><h1>Mes Dossiers</h1><table id=p5toolbar cellpadding=0 cellspacing=0><tr><td id=p5filehead valign=bottom><div id=p5rightOfButtons></div><div><input type=button id=p5FolderUp disabled onclick="return p5folderup()"value=Up> <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="Tout Sélectionner"> <input type=button id=p5RenameFileButton disabled value=Renommer onclick=p5renamefile()> <input type=button id=p5DeleteFileButton disabled value=Delete onclick=p5deletefile()> <input type=button id=p5NewFolderButton disabled value="Nouveau Dossier"onclick=p5createfolder()> <input type=button id=p5UploadButton disabled value=Télécharger onclick=p5uploadFile()> <input type=button id=p5CutButton disabled value=Cut onclick=p5copyFile(1)> <input type=button id=p5CopyButton disabled value=Copy onclick=p5copyFile(0)> <input type=button id=p5PasteButton disabled value=Paste onclick=p5pasteFile()> </div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>Trier par nom<option value=2>Trier par taille<option value=3>Trier par date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>Ces fichiers sont partagés publiquement, cliquez sur "lien" pour obtenir une URL publique.</div></div><div id=bigok style=display:none><b>✓</b></div><div id=bigfail style=display:none><b>✗</b></div><span id=p5files></span></div><table id=p5toolbarBottom style=width:100% cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p5bottomstatus></span></table></div><div id=p6 style=display:none><img id=MainMeshImage src=serverpic.ashx><h1>Mon Serveur</h1><div id=p2ServerActions><p><strong>Server actions</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>Download server backup</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">Restaurer le serveur avec sauvegarde</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">Check server version</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">Afficher le journal des erreurs du serveur</a></div></div></div><br><strong>Server Statistics</strong><br><br><div id=serverStats><div id=serverCpuChartView style=display:none><div class=chartViewCanvas><canvas id=serverCpuChart></canvas></div><div class=chartViewText id=serverCpuChartText></div></div><div id=serverMemoryChartView style=display:none><div class=chartViewCanvas><canvas id=serverMemoryChart></canvas></div><div class=chartViewText id=serverMemoryChartText></div></div><br><br><div id=serverStatsTable></div></div></div><div id=p10 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p10title><div id=p10BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p10deviceName></span></h1></div><div id=p10html></div><td style=width:20px><td style=width:200px><a href=# onclick=p10showiconselector()><img id=MainComputerImage></a><div id=MainComputerState></div></table><br><div id=p10html2></div><div id=p10html3></div></div><div id=p11 class=noselect style=display:none><div id=p11title><div id=p11deviceNameHeader><div id=p11BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Desktop - <span id=p11deviceName></span></h1></div></div><div id=p11warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p11warninga>, click here to enable it.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=deskarea0 cellpadding=0 cellspacing=0><div id=deskarea1 class=areaHead><div class=toright2><span id=p11power></span> <div class=deskareaicon title="Toggle View Mode"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="Tourne à gauche"onclick=drotate(-1)>↺</div><div class=deskareaicon title="Tourner à droite"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="Toggle focus mode, when active only the region around the mouse is updated"onkeypress=return!1 onkeydown=return!1 value="Focus All"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskSaveBtn type=button title="Enregistrer une capture d'écran du bureau distant"onkeypress=return!1 onkeydown=return!1 value=Sauver... onclick=deskSaveImage() class=mR> <input id=deskActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=Paramètres... title="Edit remote desktop settings"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="Change the power state of the remote machine"onkeypress=return!1 onkeydown=return!1 value="Power Actions..."onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)> ✖</div><input type=button id=autoconnectbutton1 value=AutoConnect onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 value=Connect onclick=connectDesktop(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan> <input type=button id=connectbutton1h value="HW Connect"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span> <input type=button id=disconnectbutton1 value=Disconnect onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=deskstatus>Disconnected</span></div></div><div id=deskarea2><div class=areaProgress><div id=progressbar></div></div></div><div id=deskarea3x><div id=DeskFocus oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></div><div id=DeskParent><canvas id=Desk width=640 height=480 oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas></div><div id=DeskTools><div id=deskToolsAreaTop><a id=DeskToolsRefreshButton style=right:2px onclick=refreshDeskTools()>Rafraîchir</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>Processes</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>Services</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="Trier par identifiant de processus"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="Trier par nom"onclick=sortProcess(1)>Nom</a></div><div id=DeskToolsProcesses></div></div><div id=DeskToolsServiceTab style=display:none><div id=deskToolsServiceHeader><a class=colmn1 style=width:70px title="Trier par état"onclick=sortService(0)>State</a> <a class=colmn2 title="Trier par nom"onclick=sortService(1)>Nom</a></div><div id=DeskToolsServices></div></div></div></div><div id=p11DeskConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p11clearConsoleMsg()></div></div><div id=deskarea4 class=areaFoot><div class=toright2><span id=DeskTimer title="Session time"></span> <select id=termdisplays style=display:none onchange=deskSetDisplay(event) onkeypress=return!1 onkeydown=return!1></select> <input id=DeskToolsButton type=button value=Outils title="Toggle tools view"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()> <span id=DeskChatButton class=deskarea title="Ouvrir la fenêtre de discussion sur cet ordinateur"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="Display a notification on the remote computer"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="Open a web address on remote computer"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span></div><div><select id=deskkeys><option value=10>Ctrl+Alt+Del<option value=5>Win<option value=0>Win+Down<option value=1>Win+Up<option value=2>Win+L<option value=3>Win+M<option value=4>Shift+Win+M<option value=6>Win+R<option value=7>Alt-F4<option value=8>Ctrl-W<option value=9>Alt-Tab<option value=11>Win+Left<option value=12>Win+Right</select> <input id=DeskWD type=button value=Envoyer onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=Clipboard onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=Type onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="Basculer la souris et le clavier"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>Input</span></label> </div></div></div></div><div id=p12 style=display:none><div id=p12title><div id=p12BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Terminal - <span id=p12deviceName></span></h1></div><div id=p12warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p12warninga>, click here to enable it.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=termTable style=position:relative><table style=width:100% cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=termRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div><input id=termActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction()></div><div><input type=button id=autoconnectbutton2 value=AutoConnect onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 value=Connect onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan> <input type=button id=connectbutton2h value="HW Connect"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span> <input type=button id=disconnectbutton2 value=Disconnect onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=termstatus>Disconnected</span><span id=termtitle></span></div><tr><td><div class=areaProgress><div id=termprogressbar></div></div><tr><td id=termarea3x><pre id=Term></pre><tr><td class=areaFoot><div class=toright2><span id=TermTimer title="Session time"></span> <span id=terminalSettingsButtons style=display:none><input id=id_tcrbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value=CR+LF title="Toggle what the return key will send"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Intel (F10 = ESC+[OM)"title="Toggle F1 to F10 keys emulation type"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Extended Ascii"title="Basculer le type d'émulation de terminal"onclick=termToggleType()> </span><span id=terminalSizeDropDown><select id=termSizeList onkeypress=return!1><option value=1>80x25<option value=2>100x30<option value=3 selected>Automatique</select> </span><select id=specialkeylist onkeypress=return!1></select> <input id=specialkeylistinput type=button onkeypress=return!1 class=bottombutton value=Envoyer title="Send the selected special key"onclick=sendSpecialKey()></div><div> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Ctl-C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Ctl-X onclick='termSendKey(24,"ctrlxbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=escbutton value=ESC onclick='termSendKey(27,"escbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=bsbutton value="Retour arrière"onclick='termSendKey(8,"bsbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=Paste title="Paste text into the terminal"onclick=showTermPasteDialog()></div></table><div id=p12TermConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:45px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p12clearConsoleMsg()></div></div></div><div id=p13 style=display:none><div id=p13title><div id=p13BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Files - <span id=p13deviceName></span></h1></div><table id=p13toolbar cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><input id=filesActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"value=Actions onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div></div><div><input id=p13AutoConnect value=AutoConnect onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=Connect onclick=connectFiles(event) type=button> <span id=p13Status>Disconnected</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value=Up> <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="Tout Sélectionner"> <input type=button id=p13RenameFileButton disabled value=Renommer onclick=p13renamefile()> <input type=button id=p13DeleteFileButton disabled value=Delete onclick=p13deletefile()> <input type=button id=p13ViewFileButton disabled value=Edit onclick=p13viewfile()> <input type=button id=p13NewFolderButton disabled value="Nouveau Dossier"onclick=p13createfolder()> <input type=button id=p13UploadButton disabled value=Télécharger onclick=p13uploadFile()> <input type=button id=p13CutButton disabled value=Cut onclick=p13copyFile(1)> <input type=button id=p13CopyButton disabled value=Copy onclick=p13copyFile(0)> <input type=button id=p13PasteButton disabled value=Paste onclick=p13pasteFile()> <input type=button id=p13RefreshButton disabled value=Rafraîchir onclick=p13folderup(9999)> </div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>Trier par nom<option value=2>Trier par taille<option value=3>Trier par date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p13currentpath></span></div></table><div id=p13FilesConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:165px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p13clearConsoleMsg()></div><div id=p13filetable><div id=p13bigok style=display:none><b>✓</b></div><div id=p13bigfail style=display:none><b>✗</b></div><span id=p13files></span></div><table id=p13toolbarBottom cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p13bottomstatus></span></table></div><div id=p14 style=display:none><div id=p14title><div id=p14BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Intel® AMT - <span id=p14deviceName></span></h1></div><iframe id=p14iframe src={{{domainurl}}}commander.htm></iframe></div><div id=p15 style=display:none><div id=p15title><div id=p15BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1><span id=p15deviceName></span></h1></div><table id=consoleTable cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=p15coreName title="Information about current core running on this agent"></div><input type=button id=p15uploadCore value="Agent Action"onclick=p15uploadCore(event) title="Change the agent Java Script code module"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="Download console text"src=images/link4.png></div><div id=p15statetext></div><tr><td><div class=areaProgress><div id=consoleprogressbar></div></div><tr><td id=p15agentConsole><pre id=p15agentConsoleText></pre><tr><td class=areaFoot><table style=width:100%><tr><td style=width:99%><input id=p15consoleText style=width:100% onkeyup=p15consoleSend(event) onfocus=onConsoleFocus(1) onblur=onConsoleFocus(0)><td> <td id=p15outputselecttd><select id=p15outputselect><option value=1>Agent<option value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=Clear onclick=p15consoleClear()></table></table></div><div id=p16 style=display:none><div id=p16title><div id=p16BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p16events></div></div><div id=p17 style=display:none><div id=p17title><div id=p17BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Details - <span id=p17deviceName></span></h1></div><div id=p17info></div></div><div id=p20 style=display:none><picture id=MainMeshImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/mesh-256.webp><img alt=""width=200 height=200 src=images/mesh-256.png></picture><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p20meshName></span></h1><p id=p20info></div><div id=p30 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p30title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p30userName></span></h1></div><div id=p30html></div><td style=width:20px><td style=width:200px><picture id=MainUserImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/user-256.webp><img alt=""width=200 height=200 src=images/user-256.png></picture><div style=width:100%;text-align:center><strong><span id=MainUserState></span></strong></div></table><br><div id=p30html2></div><div id=p30html3></div></div><div id=p31 style=display:none><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p31userName></span></h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><h1>My Server Stats</h1><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>Connections<option value=1>Mémoire</select> <select id=p40time onchange=updateServerTimelineHours()><option value=3>3 dernières heures<option value=8>8 dernières heures<option value=24>Dernier jour<option value=168>Dernière semaine<option value=720>30 derniers jours</select> <img src=images/link4.png height=10 width=10 title="Download data points (.csv)"style=cursor:pointer onclick=p40downloadEvents()> </div><div><input value=Rafraîchir type=button onclick=refreshServerTimelineStats()> <label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>Log-X</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><h1>My Server Tracing</h1><div class=areaHead><div class=toright2>Show <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>100 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <input value=Clear type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="Download trace (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()> </div><div><input value=Tracing type=button onclick=setServerTracing()> <span id=p41traceStatus>None</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>My Server Plugins</h1><div class=areaHead><div class=toright2></div><div><input value="Download Plugin"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="Refresh Agent Cores"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>Notice:</b> Plugins have been altered, this may require agent core update.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>Nom<th class=chDescription>Description<th class=chSite style=text-align:center>Link<th class=chVersion style=text-align:center>Version<th class=chUpgradeAvail style=text-align:center>Latest<th class=chStatus style=text-align:center>Statut<th class=chAction style=text-align:center>Action<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>No plugins on server.</i></div></div><div id=p19 style=display:none><h1>Plugins - <span id=p19deviceName></span></h1><style>#p19headers{padding-right:7px;padding-bottom:10px;font-weight:700;border-bottom:1px dotted #00f}#p19headers>span:nth-child(n+2){border-left:1px solid #000}#p19headers>span{padding-left:4px;padding-right:4px}</style><div id=p19headers></div><div id=p19pages></div></div><br id=column_l_bottomgap></div><div id=footer><div class=footer1>{{{footer}}}</div><div class=footer2><a id=verifyEmailId2 style=display:none href=# onclick=account_showVerifyEmail()>Verify Email</a> <a href=terms>Terms & Privacy</a></div></div><div id=dialog class=noselect style=display:none><div id=dialogHeader><div tabindex=0 id=id_dialogclose onclick=setDialogMode() onkeypress='"Enter"==event.key&&setDialogMode()'>✖</div><div id=id_dialogtitle></div></div><div id=dialogBody><div id=dialog1><div id=id_dialogMessage></div></div><div id=dialog2><div id=id_dialogOptions></div></div><div id=dialog3><div id=d3upload><div>File Selection</div><select id=d3uploadMode onchange=d3modechange()><option value=1>Local file upload<option value=2>Server file selection</select></div><div id=d3localmode style=display:none><div>Upload File</div><form id=d3localmodeform method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input id=d3auth name=auth style=display:none> <input id=d3attrib name=attrib style=display:none> <input type=file id=d3localFile name=files onchange=d3setActions()> <input type=submit id=d3submit style=display:none></form></div><div id=d3servermode><div id=d3serveraction valign=bottom><input type=button id=p3FolderUp disabled onclick=d3folderup() value=Up> </div><div id=d3serverfiles></div></div></div><div id=dialog7><div id=d7meshkvm><h4>Agent Remote Desktop</h4><div><div>Qualité</div><select id=d7bitmapquality dir=rtl></select></div><div><div>Mise à l'échelle</div><select id=d7bitmapscaling dir=rtl><option selected value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select></div><div><div>Frame rate</div><select id=d7framelimiter dir=rtl><option selected value=50>Fast<option value=100>Medium<option value=400>Lent<option value=1000>Very slow</select></div></div><div id=d7amtkvm><h4>Intel® AMT Hardware KVM</h4><div><div>Image Encoding</div><select id=d7desktopmode><option value=1>RLE8, le plus rapide<option value=2>RLE16, recommandé<option value=3>RAW8, Slow<option value=4>RAW16, Very Slow</select></div><div><div>Other Settings</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>Show Focus Tool</label> <label style=display:block><input type=checkbox id=d7showcursor>Show Local Mouse Cursor</label> <label style=display:block><input type=checkbox id=d7localKeyMap>Local Keyboard Map</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=Annuler onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=OK onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=Delete style=display:none onclick=dialogclose(2)></div></div></div><iframe name=fileUploadFrame style=display:none></iframe><form style=display:none method=post action=uploadfile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p5fileDragName name=name><input id=p5fileDragAuthCookie name=auth><input id=p5fileDragSize name=size><input id=p5fileDragType name=type><input id=p5fileDragData name=data><input id=p5fileDragLink name=link><input type=submit id=p5loginSubmit2 style=display:none></form><form style=display:none method=post action=uploadnodefile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p13fileDragName name=name><input id=p13fileDragSize name=size><input id=p13fileDragType name=type><input id=p13fileDragData name=data><input id=p13fileDragLink name=link><input type=submit id=p13loginSubmit2 style=display:none></form><audio id=chimes><source src=sounds/chimes.mp3 type=audio/mp3></audio></div><script>'use strict';
1
+<!doctypehtml><html dir=ltr xmlns=http://www.w3.org/1999/xhtml><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,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=apple-mobile-web-app-capable content=yes><meta name=format-detection content="telephone=no"><link rel="shortcut icon"type=image/x-icon href={{{domainurl}}}favicon.ico><link keeplink=1 type=text/css href=styles/style.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol.css media=screen rel=stylesheet title=CSS><link type=text/css href=styles/ol3-contextmenu.min.css media=screen rel=stylesheet title=CSS><script src=scripts/common-0.0.1.js></script><script src=scripts/meshcentral.js></script><script src=scripts/amt-0.2.0.js></script><script src=scripts/amt-wsman-0.2.0.js></script><script src=scripts/amt-desktop-0.0.2.js></script><script src=scripts/amt-terminal-0.0.2.js></script><script src=scripts/zlib.js></script><script src=scripts/zlib-inflate.js></script><script src=scripts/zlib-adler32.js></script><script src=scripts/zlib-crc32.js></script><script src=scripts/amt-redir-ws-0.1.0.js></script><script src=scripts/amt-wsman-ws-0.2.0.js></script><script src=scripts/agent-redir-ws-0.1.1.js></script><script src=scripts/agent-redir-rtc-0.1.0.js></script><script src=scripts/agent-desktop-0.0.2.js></script><script src=scripts/qrcode.min.js></script><script keeplink=1 src=scripts/u2f-api.js></script><script keeplink=1 src=scripts/charts.js></script><script keeplink=1 src=scripts/filesaver.js></script><script keeplink=1 src=scripts/ol.js></script><script keeplink=1 src=scripts/ol3-contextmenu.js></script><title>{{{title}}}</title><body id=body onload='"undefined"!=typeof startup&&startup()'oncontextmenu=handleContextMenu(event) style=display:none;min-width:495px><div id=contextMenu class="contextMenu noselect"style=display:none><div id=cxinfo class=cmtext onclick=cmaction(1,event)><b>Information</b></div><div id=cxdesktop class=cmtext onclick=cmaction(3,event)>Desktop</div><div id=cxterminal class=cmtext onclick=cmaction(2,event)>Terminal</div><div id=cxfiles class=cmtext onclick=cmaction(4,event)>Files</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>Events</div><div id=cxconsole class=cmtext onclick=cmaction(6,event)>Console</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(7,event) style=display:none>Multi-Desktop</div></div><div id=meshContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxselectall class=cmtext onclick=cmmeshaction(1,event)>Tout Sélectionner</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>Rien sélectionner</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)><b>Normal Connect</b></div><div id=cxtermps class=cmtext onclick=cmtermaction(6,event)>PowerShell Connect</div></div><div id=termShellContextMenuLinux class="contextMenu noselect"style=display:none;min-width:0><div id=cxtermnorm class=cmtext onclick=cmtermaction(1,event)><b>Root Shell</b></div><div id=cxtermps class=cmtext onclick=cmtermaction(7,event)>User Shell</div></div><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=masthead class=noselect><div class=title>{{{title}}}</div><div class=title2>{{{title2}}}</div><div style=float:right><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=display:none title="Click to view current notifications">0</div></div><p id=logoutControl>{{{logoutControl}}}<span id=idleTimeoutNotify style=color:#ff0></span></div><div id=page_leftbar><div style=height:16px></div><div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel"title="Mes Appareils"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="Mon Compte"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="Mes Événements"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'><div class=lb3></div></div><div id=LeftMenuMyFiles tabindex=0 class=lbbutton style=display:none title="Mes Dossiers"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'><div class=lb4></div></div><div id=LeftMenuMyUsers tabindex=0 class=lbbutton style=display:none title="Mes Utilisateurs"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'><div class=lb5></div></div><div id=LeftMenuMyServer tabindex=0 class=lbbutton style=display:none title="Mon Serveur"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'><div class=lb6></div></div></div><div id=topbar class=noselect><div><div style=position:relative><div tabindex=0 id=uiMenuButton title="User interface selection"onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Basculer mode nuit"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div></div></div><table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'>Mes Appareils<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>Mon Compte<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>Mes Événements<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>Mes Dossiers<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>Mes Utilisateurs<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>Mon Serveur<td class="topbar_td_end style3"> </table><div id=MainSubMenuSpan style=display:none><table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MainDev class="topbar_td style3x"onclick=go(10,event) onkeypress='"Enter"==event.key&&go(10)'>General<td tabindex=0 id=MainDevDesktop class="topbar_td style3x"onclick=go(11,event) onkeypress='"Enter"==event.key&&go(11)'>Desktop<td tabindex=0 id=MainDevTerminal class="topbar_td style3x"onclick=go(12,event) onkeypress='"Enter"==event.key&&go(12)'>Terminal<td tabindex=0 id=MainDevFiles class="topbar_td style3x"onclick=go(13,event) onkeypress='"Enter"==event.key&&go(13)'>Files<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>Events<td tabindex=0 id=MainDevInfo class="topbar_td style3x"onclick=go(17,event) onkeypress='"Enter"==event.key&&go(17)'>Details<td tabindex=0 id=MainDevAmt class="topbar_td style3x"onclick=go(14,event) onkeypress='"Enter"==event.key&&go(14)'>Intel® AMT<td tabindex=0 id=MainDevConsole class="topbar_td style3x"onclick=go(15,event) onkeypress='"Enter"==event.key&&go(15)'>Console<td tabindex=0 id=MainDevPlugins class="topbar_td style3x"onclick=go(19,event) onkeypress='"Enter"==event.key&&go(19)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=MeshSubMenuSpan style=display:none><table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=MeshGeneral class="topbar_td style3x"onclick=go(20,event) onkeypress='"Enter"==event.key&&go(20)'>General<td class="topbar_td_end style3"> </table></div><div id=UserSubMenuSpan style=display:none><table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=UserGeneral class="topbar_td style3x"onclick=go(30,event) onkeypress='"Enter"==event.key&&go(30)'>General<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>Events<td class="topbar_td_end style3"> </table></div><div id=ServerSubMenuSpan style=display:none><table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=ServerGeneral class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>General<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>Stats<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>Console<td tabindex=0 id=ServerTrace class="topbar_td style3x"onclick=go(41,event) onkeypress='"Enter"==event.key&&go(41)'>Trace<td tabindex=0 id=ServerPlugins class="topbar_td style3x"onclick=go(42,event) onkeypress='"Enter"==event.key&&go(42)'>Plugins<td class="topbar_td_end style3"> </table></div><div id=UserDummyMenuSpan><table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1><tr><td class=style3> </table></div></div></div></div><div id=column_l><div id=p0 style=display:none><div id=p0message><span id=p0span>Server disconnected</span>,<href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div></div><div id=p1 style=display:none><div style=display:none id=devListToolbarViewIcons><div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress='"Enter"==event.key&&onDeviceViewChange(1)'title=Columns><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=List><div class=viewSelector1></div></div><div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress='"Enter"==event.key&&onDeviceViewChange(3)'title=Desktops><div class=viewSelector3></div></div><div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress='"Enter"==event.key&&onDeviceViewChange(4)'title=Carte><div class=viewSelector4></div></div></div><div><h1>Mes Appareils</h1></div><table id=devListToolbarSpan class=noselect><tr><td class=h1><td id=devListToolbar class=style14 style=display:none> <input type=button id=SelectAllButton onclick=selectallButtonFunction() value="Tout Sélectionner"> <input type=button id=GroupActionButton disabled value="Action de groupe"onclick=groupActionFunction()> <input id=SearchInput placeholder=Filter onchange=masterUpdate(5) onkeyup=masterUpdate(5) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)> <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()><span title="Show devices operating system name">Nom du système</span></label><td id=kvmListToolbar class=style14 style=display:none> <input type=button onclick=connectAllKvmFunction() value="Connect All"> <input type=button onclick=disconnectAllKvmFunction() value="Disconnect All"> <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="Connexion automatique">Automatique </label> <input type=button onclick=showMultiDesktopSettings() value=Settings> <td id=devMapToolbar class=style14 style=display:none> <input id=mapSearchLocation placeholder="Recherche de lieu"onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=Chercher title="Recherche de lieu"onclick=getSearchLocation()> <input type=button id=refreshmap title="Reset map view"value=Réinitialiser onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>View <select id=viewselect onchange=onDeviceViewChange()><option value=1>Columns<option value=2>List<option value=3>Desktops<option id=viewselectmapoption value=4>Carte</select></div><div style=display:none id=devListToolbarSort>Trier <select id=sortselect onchange=masterUpdate(6)><option>Groupe<option>Power<option>Device<option>Tags</select> </div><div style=display:none id=devListToolbarSize>Taille <select id=sizeselect onchange=onDeviceViewChange()><option value=0>Petit<option value=1>Medium<option value=2>Grand</select> </div><td class=h2></table><div id=NoMeshesPanel style=display:none><table><tr><td valign=top style=width:50px><img src=images/info.png><td><div id=getStarted1>To get started, <a href=# onclick="return account_createMesh()"><strong>click here to create a device group</strong></a>.</div><div id=getStarted2>Aucun groupe d'appareils.</div></table></div><div id=xdevices class=noselect style=display:none></div><div id=xdevicesmap style=display:none><div id=xmapSearchResultsDlg style=display:none><div id=xmapSearchResultsBck><div id=xmapSearchClose onclick=mapCloseSearchWindow()><b>X</b></div><div style=padding:5px>Location Results</div><div style=width:100%;margin:6px></div></div><div id=xmapSearchResults style=margin:6px></div></div></div><div id=xmap-info-window></div></div><div id=p2 style=display:none><h1>Mon Compte</h1><img id=p2AccountImage alt=""src=images/clipboard-128.png><div id=p2AccountSecurity style=display:none><p><strong>Account security</strong><div style=margin-left:25px><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Manage authenticator app</a><br></span></div><div id=manageHardwareOtp><div class=p2AccountActions><span id=authKeySetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageHardwareOtp(0)">Manage security keys</a><br></span></div><div id=manageOtp><div class=p2AccountActions><span id=authCodesSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageOtp(0)">Manage backup codes</a><br></span></div></div></div><div id=p2AccountActions><p><strong>Account actions</strong><p class=mL><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">Verify email</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">Enable web notifications</a><br></span><a href=# onclick="return account_showLocalizationSettings()">Localization Settings</a><br><a href=# onclick="return account_showAccountNotifySettings()">Notification Settings</a><br><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">Change email address</a><br></span><a href=# onclick="return account_showChangePassword()">Change password</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">Delete account</a><br></p><br style=clear:both></div><strong>Device Groups</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>Nouveau</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>Aucun groupe d'appareils.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>Get started here!</strong></a></span></div><br style=clear:both></div><div id=p3 style=display:none><h1>Mes Événements</h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p3limitdropdown onchange=refreshEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><h1>Mes Utilisateurs</h1><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value=Diffuser> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="Download user information"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="Batch create many user accounts"src=images/link6.png></a></div><div><input id=UserNewAccountButton type=button style=margin-left:6px onclick=showCreateNewAccountDialog() value="Nouveau Compte..."> <input id=UserSearchInput style=width:120px;margin-left:6px placeholder=Filter onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0)></div><td class=h2></table><div id=p3users></div></div><div id=p5 style=display:none><h1>Mes Dossiers</h1><table id=p5toolbar cellpadding=0 cellspacing=0><tr><td id=p5filehead valign=bottom><div id=p5rightOfButtons></div><div><input type=button id=p5FolderUp disabled onclick="return p5folderup()"value=Up> <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="Tout Sélectionner"> <input type=button id=p5RenameFileButton disabled value=Renommer onclick=p5renamefile()> <input type=button id=p5DeleteFileButton disabled value=Delete onclick=p5deletefile()> <input type=button id=p5NewFolderButton disabled value="Nouveau Dossier"onclick=p5createfolder()> <input type=button id=p5UploadButton disabled value=Télécharger onclick=p5uploadFile()> <input type=button id=p5CutButton disabled value=Cut onclick=p5copyFile(1)> <input type=button id=p5CopyButton disabled value=Copy onclick=p5copyFile(0)> <input type=button id=p5PasteButton disabled value=Paste onclick=p5pasteFile()> </div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>Trier par nom<option value=2>Trier par taille<option value=3>Trier par date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>Ces fichiers sont partagés publiquement, cliquez sur "lien" pour obtenir une URL publique.</div></div><div id=bigok style=display:none><b>✓</b></div><div id=bigfail style=display:none><b>✗</b></div><span id=p5files></span></div><table id=p5toolbarBottom style=width:100% cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p5bottomstatus></span></table></div><div id=p6 style=display:none><img id=MainMeshImage src=serverpic.ashx><h1>Mon Serveur</h1><div id=p2ServerActions><p><strong>Server actions</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>Download server backup</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">Restaurer le serveur avec sauvegarde</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">Check server version</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">Afficher le journal des erreurs du serveur</a></div></div></div><br><strong>Server Statistics</strong><br><br><div id=serverStats><div id=serverCpuChartView style=display:none><div class=chartViewCanvas><canvas id=serverCpuChart></canvas></div><div class=chartViewText id=serverCpuChartText></div></div><div id=serverMemoryChartView style=display:none><div class=chartViewCanvas><canvas id=serverMemoryChart></canvas></div><div class=chartViewText id=serverMemoryChartText></div></div><br><br><div id=serverStatsTable></div></div></div><div id=p10 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p10title><div id=p10BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p10deviceName></span></h1></div><div id=p10html></div><td style=width:20px><td style=width:200px><a href=# onclick=p10showiconselector()><img id=MainComputerImage></a><div id=MainComputerState></div></table><br><div id=p10html2></div><div id=p10html3></div></div><div id=p11 class=noselect style=display:none><div id=p11title><div id=p11deviceNameHeader><div id=p11BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Desktop - <span id=p11deviceName></span></h1></div></div><div id=p11warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p11warninga>, click here to enable it.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=deskarea0 cellpadding=0 cellspacing=0><div id=deskarea1 class=areaHead><div class=toright2><span id=p11power></span> <div class=deskareaicon title="Toggle View Mode"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="Tourne à gauche"onclick=drotate(-1)>↺</div><div class=deskareaicon title="Tourner à droite"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="Toggle focus mode, when active only the region around the mouse is updated"onkeypress=return!1 onkeydown=return!1 value="Focus All"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskSaveBtn type=button title="Enregistrer une capture d'écran du bureau distant"onkeypress=return!1 onkeydown=return!1 value=Sauver... onclick=deskSaveImage() class=mR> <input id=deskActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=Paramètres... title="Edit remote desktop settings"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="Change the power state of the remote machine"onkeypress=return!1 onkeydown=return!1 value="Power Actions..."onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)> ✖</div><input type=button id=autoconnectbutton1 value=AutoConnect onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 value=Connect onclick=connectDesktop(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan> <input type=button id=connectbutton1h value="HW Connect"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span> <input type=button id=disconnectbutton1 value=Disconnect onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=deskstatus>Disconnected</span></div></div><div id=deskarea2><div class=areaProgress><div id=progressbar></div></div></div><div id=deskarea3x><div id=DeskFocus oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></div><div id=DeskParent><canvas id=Desk width=640 height=480 oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas></div><div id=DeskTools><div id=deskToolsAreaTop><a id=DeskToolsRefreshButton style=right:2px onclick=refreshDeskTools()>Rafraîchir</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>Processes</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>Services</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="Trier par identifiant de processus"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="Trier par nom"onclick=sortProcess(1)>Nom</a></div><div id=DeskToolsProcesses></div></div><div id=DeskToolsServiceTab style=display:none><div id=deskToolsServiceHeader><a class=colmn1 style=width:70px title="Trier par état"onclick=sortService(0)>State</a> <a class=colmn2 title="Trier par nom"onclick=sortService(1)>Nom</a></div><div id=DeskToolsServices></div></div></div></div><div id=p11DeskConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p11clearConsoleMsg()></div></div><div id=deskarea4 class=areaFoot><div class=toright2><span id=DeskTimer title="Session time"></span> <select id=termdisplays style=display:none onchange=deskSetDisplay(event) onkeypress=return!1 onkeydown=return!1></select> <input id=DeskToolsButton type=button value=Outils title="Toggle tools view"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()> <span id=DeskChatButton class=deskarea title="Ouvrir la fenêtre de discussion sur cet ordinateur"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="Display a notification on the remote computer"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="Open a web address on remote computer"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span></div><div><select id=deskkeys><option value=10>Ctrl+Alt+Del<option value=5>Win<option value=0>Win+Down<option value=1>Win+Up<option value=2>Win+L<option value=3>Win+M<option value=4>Shift+Win+M<option value=6>Win+R<option value=7>Alt-F4<option value=8>Ctrl-W<option value=9>Alt-Tab<option value=11>Win+Left<option value=12>Win+Right</select> <input id=DeskWD type=button value=Envoyer onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=Clipboard onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=Type onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="Basculer la souris et le clavier"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>Input</span></label> </div></div></div></div><div id=p12 style=display:none><div id=p12title><div id=p12BackButton><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Terminal - <span id=p12deviceName></span></h1></div><div id=p12warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT Redirection port or KVM feature is disabled<span id=p12warninga>, click here to enable it.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Remote computer is not powered on, click here to issue a power command.</div></div><div id=termTable style=position:relative><table style=width:100% cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=termRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div><input id=termActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"onkeypress=return!1 onkeydown=return!1 value=Actions onclick=deviceActionFunction()></div><div><input type=button id=autoconnectbutton2 value=AutoConnect onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 value=Connect onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan> <input type=button id=connectbutton2h value="HW Connect"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span> <input type=button id=disconnectbutton2 value=Disconnect onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span> <span id=termstatus>Disconnected</span><span id=termtitle></span></div><tr><td><div class=areaProgress><div id=termprogressbar></div></div><tr><td id=termarea3x><pre id=Term></pre><tr><td class=areaFoot><div class=toright2><span id=TermTimer title="Session time"></span> <span id=terminalSettingsButtons style=display:none><input id=id_tcrbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value=CR+LF title="Toggle what the return key will send"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Intel (F10 = ESC+[OM)"title="Toggle F1 to F10 keys emulation type"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Extended Ascii"title="Basculer le type d'émulation de terminal"onclick=termToggleType()> </span><span id=terminalSizeDropDown><select id=termSizeList onkeypress=return!1><option value=1>80x25<option value=2>100x30<option value=3 selected>Automatique</select> </span><select id=specialkeylist onkeypress=return!1></select> <input id=specialkeylistinput type=button onkeypress=return!1 class=bottombutton value=Envoyer title="Send the selected special key"onclick=sendSpecialKey()></div><div> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Ctl-C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Ctl-X onclick='termSendKey(24,"ctrlxbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=escbutton value=ESC onclick='termSendKey(27,"escbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=bsbutton value="Retour arrière"onclick='termSendKey(8,"bsbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=Paste title="Paste text into the terminal"onclick=showTermPasteDialog()></div></table><div id=p12TermConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:45px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p12clearConsoleMsg()></div></div></div><div id=p13 style=display:none><div id=p13title><div id=p13BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Files - <span id=p13deviceName></span></h1></div><table id=p13toolbar cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><input id=filesActionsBtn type=button title="Effectuer des actions d'alimentation sur le périphérique"value=Actions onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="Server is recording this session"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px></div></div><div><input id=p13AutoConnect value=AutoConnect onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=Connect onclick=connectFiles(event) type=button> <span id=p13Status>Disconnected</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value=Up> <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="Tout Sélectionner"> <input type=button id=p13RenameFileButton disabled value=Renommer onclick=p13renamefile()> <input type=button id=p13DeleteFileButton disabled value=Delete onclick=p13deletefile()> <input type=button id=p13ViewFileButton disabled value=Edit onclick=p13viewfile()> <input type=button id=p13NewFolderButton disabled value="Nouveau Dossier"onclick=p13createfolder()> <input type=button id=p13UploadButton disabled value=Télécharger onclick=p13uploadFile()> <input type=button id=p13CutButton disabled value=Cut onclick=p13copyFile(1)> <input type=button id=p13CopyButton disabled value=Copy onclick=p13copyFile(0)> <input type=button id=p13PasteButton disabled value=Paste onclick=p13pasteFile()> <input type=button id=p13RefreshButton disabled value=Rafraîchir onclick=p13folderup(9999)> </div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>Trier par nom<option value=2>Trier par taille<option value=3>Trier par date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p13currentpath></span></div></table><div id=p13FilesConsoleMsg style=display:none;cursor:pointer;position:absolute;left:30px;top:165px;color:#ff0;background-color:rgba(0,0,0,.6);padding:10px;border-radius:5px onclick=p13clearConsoleMsg()></div><div id=p13filetable><div id=p13bigok style=display:none><b>✓</b></div><div id=p13bigfail style=display:none><b>✗</b></div><span id=p13files></span></div><table id=p13toolbarBottom cellpadding=0 cellspacing=0><tr><td class=style6> <span id=p13bottomstatus></span></table></div><div id=p14 style=display:none><div id=p14title><div id=p14BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class=viewSelector5></div></div></div><h1>Intel® AMT - <span id=p14deviceName></span></h1></div><iframe id=p14iframe src={{{domainurl}}}commander.htm></iframe></div><div id=p15 style=display:none><div id=p15title><div id=p15BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1><span id=p15deviceName></span></h1></div><table id=consoleTable cellpadding=0 cellspacing=0><tr><td class=areaHead><div class=toright2><div id=p15coreName title="Information about current core running on this agent"></div><input type=button id=p15uploadCore value="Agent Action"onclick=p15uploadCore(event) title="Change the agent Java Script code module"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="Download console text"src=images/link4.png></div><div id=p15statetext></div><tr><td><div class=areaProgress><div id=consoleprogressbar></div></div><tr><td id=p15agentConsole><pre id=p15agentConsoleText></pre><tr><td class=areaFoot><table style=width:100%><tr><td style=width:99%><input id=p15consoleText style=width:100% onkeyup=p15consoleSend(event) onfocus=onConsoleFocus(1) onblur=onConsoleFocus(0)><td> <td id=p15outputselecttd><select id=p15outputselect><option value=1>Agent<option value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=Clear onclick=p15consoleClear()></table></table></div><div id=p16 style=display:none><div id=p16title><div id=p16BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p16events></div></div><div id=p17 style=display:none><div id=p17title><div id=p17BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Details - <span id=p17deviceName></span></h1></div><div id=p17info></div></div><div id=p20 style=display:none><picture id=MainMeshImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/mesh-256.webp><img alt=""width=200 height=200 src=images/mesh-256.png></picture><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p20meshName></span></h1><p id=p20info></div><div id=p30 style=display:none><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p30title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>General - <span id=p30userName></span></h1></div><div id=p30html></div><td style=width:20px><td style=width:200px><picture id=MainUserImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/user-256.webp><img alt=""width=200 height=200 src=images/user-256.png></picture><div style=width:100%;text-align:center><strong><span id=MainUserState></span></strong></div></table><br><div id=p30html2></div><div id=p30html3></div></div><div id=p31 style=display:none><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Retour onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Events - <span id=p31userName></span></h1><table class=pTable><tr><td class=h1><td class=auto-style1>Show <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>60 dernières<option value=120>120 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Download Events"style=cursor:pointer></a> <td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><h1>My Server Stats</h1><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>Connections<option value=1>Mémoire</select> <select id=p40time onchange=updateServerTimelineHours()><option value=3>3 dernières heures<option value=8>8 dernières heures<option value=24>Dernier jour<option value=168>Dernière semaine<option value=720>30 derniers jours</select> <img src=images/link4.png height=10 width=10 title="Download data points (.csv)"style=cursor:pointer onclick=p40downloadEvents()> </div><div><input value=Rafraîchir type=button onclick=refreshServerTimelineStats()> <label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>Log-X</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><h1>My Server Tracing</h1><div class=areaHead><div class=toright2>Show <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>100 dernières<option value=250>250 dernières<option value=500>500 dernières<option value=1000>1000 derniers</select> <input value=Clear type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="Download trace (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()> </div><div><input value=Tracing type=button onclick=setServerTracing()> <span id=p41traceStatus>None</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>My Server Plugins</h1><div class=areaHead><div class=toright2></div><div><input value="Download Plugin"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="Refresh Agent Cores"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>Notice:</b> Plugins have been altered, this may require agent core update.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>Nom<th class=chDescription>Description<th class=chSite style=text-align:center>Link<th class=chVersion style=text-align:center>Version<th class=chUpgradeAvail style=text-align:center>Latest<th class=chStatus style=text-align:center>Statut<th class=chAction style=text-align:center>Action<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>No plugins on server.</i></div></div><div id=p19 style=display:none><h1>Plugins - <span id=p19deviceName></span></h1><style>#p19headers{padding-right:7px;padding-bottom:10px;font-weight:700;border-bottom:1px dotted #00f}#p19headers>span:nth-child(n+2){border-left:1px solid #000}#p19headers>span{padding-left:4px;padding-right:4px}</style><div id=p19headers></div><div id=p19pages></div></div><br id=column_l_bottomgap></div><div id=footer><div class=footer1>{{{footer}}}</div><div class=footer2><a id=verifyEmailId2 style=display:none href=# onclick=account_showVerifyEmail()>Verify Email</a> <a href=terms>Terms & Privacy</a></div></div><div id=dialog class=noselect style=display:none><div id=dialogHeader><div tabindex=0 id=id_dialogclose onclick=setDialogMode() onkeypress='"Enter"==event.key&&setDialogMode()'>✖</div><div id=id_dialogtitle></div></div><div id=dialogBody><div id=dialog1><div id=id_dialogMessage></div></div><div id=dialog2><div id=id_dialogOptions></div></div><div id=dialog3><div id=d3upload><div>File Selection</div><select id=d3uploadMode onchange=d3modechange()><option value=1>Local file upload<option value=2>Server file selection</select></div><div id=d3localmode style=display:none><div>Upload File</div><form id=d3localmodeform method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input id=d3auth name=auth style=display:none> <input id=d3attrib name=attrib style=display:none> <input type=file id=d3localFile name=files onchange=d3setActions()> <input type=submit id=d3submit style=display:none></form></div><div id=d3servermode><div id=d3serveraction valign=bottom><input type=button id=p3FolderUp disabled onclick=d3folderup() value=Up> </div><div id=d3serverfiles></div></div></div><div id=dialog7><div id=d7meshkvm><h4>Agent Remote Desktop</h4><div><div>Qualité</div><select id=d7bitmapquality dir=rtl></select></div><div><div>Mise à l'échelle</div><select id=d7bitmapscaling dir=rtl><option selected value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select></div><div><div>Frame rate</div><select id=d7framelimiter dir=rtl><option selected value=50>Fast<option value=100>Medium<option value=400>Lent<option value=1000>Very slow</select></div></div><div id=d7amtkvm><h4>Intel® AMT Hardware KVM</h4><div><div>Image Encoding</div><select id=d7desktopmode><option value=1>RLE8, le plus rapide<option value=2>RLE16, recommandé<option value=3>RAW8, Slow<option value=4>RAW16, Very Slow</select></div><div><div>Other Settings</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>Show Focus Tool</label> <label style=display:block><input type=checkbox id=d7showcursor>Show Local Mouse Cursor</label> <label style=display:block><input type=checkbox id=d7localKeyMap>Local Keyboard Map</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=Annuler onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=OK onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=Delete style=display:none onclick=dialogclose(2)></div></div></div><iframe name=fileUploadFrame style=display:none></iframe><form style=display:none method=post action=uploadfile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p5fileDragName name=name><input id=p5fileDragAuthCookie name=auth><input id=p5fileDragSize name=size><input id=p5fileDragType name=type><input id=p5fileDragData name=data><input id=p5fileDragLink name=link><input type=submit id=p5loginSubmit2 style=display:none></form><form style=display:none method=post action=uploadnodefile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p13fileDragName name=name><input id=p13fileDragSize name=size><input id=p13fileDragType name=type><input id=p13fileDragData name=data><input id=p13fileDragLink name=link><input type=submit id=p13loginSubmit2 style=display:none></form><audio id=chimes><source src=sounds/chimes.mp3 type=audio/mp3></audio></div><script>'use strict';
2
3
// Process server-side web state
4
var webState = '{{{webstate}}}';
@@ -2529,18 +2529,24 @@
2529
contextmenudiv.style.left = event.pageX + 'px';
2530
contextmenudiv.style.top = event.pageY + 'px';
2531
contextmenudiv.style.display = 'block';
2532
- } else if (elem && elem != null && elem.id == 'MxMESH') {
2532
+ } else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
2533
contextelement = elem;
2534
- var contextmenudiv = document.getElementById('meshContextMenu');
2534
+ var contextmenudiv = document.getElementById('termShellContextMenuLinux');
2535
contextmenudiv.style.left = event.pageX + 'px';
2536
contextmenudiv.style.top = event.pageY + 'px';
2537
contextmenudiv.style.display = 'block';
2538
- /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
2538
+ } else if (elem && elem != null && elem.id == 'MxMESH') {
2539
contextelement = elem;
2540
- var contextmenudiv = document.getElementById('pluginTabContextMenu');
2540
+ var contextmenudiv = document.getElementById('meshContextMenu');
2541
contextmenudiv.style.left = event.pageX + 'px';
2542
contextmenudiv.style.top = event.pageY + 'px';
2543
- contextmenudiv.style.display = 'block';*/
2543
+ contextmenudiv.style.display = 'block';
2544
+ /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
2545
+ contextelement = elem;
2546
+ var contextmenudiv = document.getElementById('pluginTabContextMenu');
2547
+ contextmenudiv.style.left = event.pageX + 'px';
2548
+ contextmenudiv.style.top = event.pageY + 'px';
2549
+ contextmenudiv.style.display = 'block';*/
2550
} else {
2551
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
2552
if (!elem || elem == null) return true;
@@ -2609,7 +2615,7 @@
2615
}
2616
2617
function cmtermaction(action) {
2612
- connectTerminal(null, 1, { powershell: (action == 2) });
2618
+ connectTerminal(null, 1, { protocol: action });
2619
}
2620
2621
/*
@@ -2628,6 +2634,7 @@
2634
QV('contextMenu', false);
2635
QV('meshContextMenu', false);
2636
QV('termShellContextMenu', false);
2637
+ QV('termShellContextMenuLinux', false);
2638
//QV('pluginTabContextMenu', false);
2639
contextelement = null;
2640
}
@@ -3028,7 +3035,7 @@
3035
// Called When Place a node option is clicked from context menu
3036
function placeNode(coords) {
3037
if (xxdialogMode) return;
3031
- var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
3038
+ var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Chercher" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
3039
for (var i in nodes) {
3040
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
3041
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
@@ -4892,7 +4899,7 @@
4899
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
4900
} else {
4901
// Setup a mesh agent terminal
4895
- var termoptions = {};
4902
+ var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
4903
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
4904
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
4905
if (Q('termSizeList').value == 3) {
@@ -4902,7 +4909,16 @@
4909
termoptions.xterm = true;
4910
}
4911
}
4905
- if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
4912
+
4913
+ // If shift is pressed
4914
+ if ((e && (e.shiftKey == true))) {
4915
+ if (currentNode.agent.id > 4) {
4916
+ if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
4917
+ } else {
4918
+ if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
4919
+ }
4920
+ }
4921
+
4922
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
4923
terminal.debugmode = debugmode;
4924
terminal.m.debugmode = debugmode;
@@ -8402,6 +8418,7 @@
8418
// My Server
8419
if ((x == 6) || (x == 115)) QC('MainMenuMyServer').add(mainMenuActiveClass);
8420
if ((x == 6) || (x == 115) || (x == 40) || (x == 41) || (x == 42)) QC('LeftMenuMyServer').add(leftMenuActiveClass);
8421
+ QV('ServerPlugins', pluginHandler != null);
8422
8423
// column_l max-height
8424
if (webPageStackMenu && (x >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
@@ -8450,8 +8467,12 @@
8467
}
8468
}
8469
8453
- // Plugin
8470
+ //
8471
+ // Plugin Management
8472
+ //
8473
+
8474
function updatePluginList(versInfo) {
8475
+ if (pluginHandler == null) return;
8476
if (Array.isArray(versInfo)) { versInfo.forEach(function(v) { updatePluginList(v); }); }
8477
QV('pluginNoneNotice', installedPluginList.length == 0);
8478
if (installedPluginList.length) {
@@ -8542,15 +8563,18 @@
8563
}
8564
8565
function refreshPluginLatest() {
8566
+ if (pluginHandler == null) return;
8567
meshserver.send({ action: 'pluginLatestCheck' });
8568
}
8569
8570
function distributeCore() {
8571
+ if (pluginHandler == null) return;
8572
meshserver.send({ action: 'distributeCore', nodes: nodes }); // All nodes the user has access to
8573
QV('pluginRestartNotice', false);
8574
}
8575
8576
function pluginActionEx() {
8577
+ if (pluginHandler == null) return;
8578
var act = Q('lastPluginAct').value, id = Q('lastPluginId').value, pVersUrl = Q('lastPluginVersion').value;
8579
8580
switch(act) {
@@ -8575,6 +8599,7 @@
8599
}
8600
8601
function pluginAction(elem, id) {
8602
+ if (pluginHandler == null) return;
8603
if (elem.value == 'downgrade') {
8604
meshserver.send({ 'action': 'getpluginversions', 'id': id });
8605
} else {
@@ -8586,6 +8611,7 @@
8611
}
8612
8613
function goPlugin(pname, title) {
8614
+ if (pluginHandler == null) return;
8615
/*
8616
let holder = Q('PluginSubMenu').querySelectorAll('tr')[0];
8617
let loadedPluginsTDs = holder.querySelectorAll('td');
@@ -8641,6 +8667,7 @@
8667
}
8668
8669
function noGoPlugin(el) {
8670
+ if (pluginHandler == null) return;
8671
/*
8672
QV('PluginSubMenuSpan', false);
8673
let loadedPluginsTDs = Q('PluginSubMenu').querySelectorAll('td');
views/translations/default_fr.handlebars
+43
-22
@@ -52,8 +52,12 @@
52
-->
53
</div>
54
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
55
- <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)">Normal Connect</div>
56
- <div id="cxtermps" class="cmtext" onclick="cmtermaction(2,event)">PowerShell Connect</div>
55
+ <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Normal Connect</b></div>
56
+ <div id="cxtermps" class="cmtext" onclick="cmtermaction(6,event)">PowerShell Connect</div>
57
+ </div>
58
+ <div id="termShellContextMenuLinux" class="contextMenu noselect" style="display:none;min-width:0px">
59
+ <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Root Shell</b></div>
60
+ <div id="cxtermps" class="cmtext" onclick="cmtermaction(7,event)">User Shell</div>
61
</div>
62
<!--
63
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
@@ -112,7 +116,6 @@
116
<td tabindex="0" id="MainMenuMyFiles" class="topbar_td style3x" onclick="go(5,event)" onkeypress="if (event.key == 'Enter') go(5)">Mes Dossiers</td>
117
<td tabindex="0" id="MainMenuMyUsers" class="topbar_td style3x" onclick="go(4,event)" onkeypress="if (event.key == 'Enter') go(4)">Mes Utilisateurs</td>
118
<td tabindex="0" id="MainMenuMyServer" class="topbar_td style3x" onclick="go(6,event)" onkeypress="if (event.key == 'Enter') go(6)">Mon Serveur</td>
115
- <!-- <td tabindex=0 id=MainMenuMyPlugins class="topbar_td style3x" onclick=go(7,event) onkeypress="if (event.key == 'Enter') go(7)">My Plugins</td> -->
119
<td class="topbar_td_end style3"> </td>
120
</tr>
121
</tbody></table>
@@ -161,15 +164,6 @@
164
</tr>
165
</tbody></table>
166
</div>
164
- <!--
165
- <div id=PluginSubMenuSpan>
166
- <table id=PluginSubMenu cellpadding=0 cellspacing=0 class=style1>
167
- <tr>
168
- <td onclick="goPlugin(-1)" onkeypress="if (event.key == 'Enter') goPlugin(-1)" class="topbar_td style3x">Home</td>
169
- </tr>
170
- </table>
171
- </div>
172
- -->
167
<div id="UserDummyMenuSpan">
168
<table id="UserDummyMenu" cellpadding="0" cellspacing="0" class="style1">
169
<tbody><tr><td class="style3" style=""> </td></tr>
@@ -3547,18 +3541,24 @@
3541
contextmenudiv.style.left = event.pageX + 'px';
3542
contextmenudiv.style.top = event.pageY + 'px';
3543
contextmenudiv.style.display = 'block';
3550
- } else if (elem && elem != null && elem.id == 'MxMESH') {
3544
+ } else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
3545
contextelement = elem;
3552
- var contextmenudiv = document.getElementById('meshContextMenu');
3546
+ var contextmenudiv = document.getElementById('termShellContextMenuLinux');
3547
contextmenudiv.style.left = event.pageX + 'px';
3548
contextmenudiv.style.top = event.pageY + 'px';
3549
contextmenudiv.style.display = 'block';
3556
- /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
3550
+ } else if (elem && elem != null && elem.id == 'MxMESH') {
3551
contextelement = elem;
3558
- var contextmenudiv = document.getElementById('pluginTabContextMenu');
3552
+ var contextmenudiv = document.getElementById('meshContextMenu');
3553
contextmenudiv.style.left = event.pageX + 'px';
3554
contextmenudiv.style.top = event.pageY + 'px';
3561
- contextmenudiv.style.display = 'block';*/
3555
+ contextmenudiv.style.display = 'block';
3556
+ /*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
3557
+ contextelement = elem;
3558
+ var contextmenudiv = document.getElementById('pluginTabContextMenu');
3559
+ contextmenudiv.style.left = event.pageX + 'px';
3560
+ contextmenudiv.style.top = event.pageY + 'px';
3561
+ contextmenudiv.style.display = 'block';*/
3562
} else {
3563
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
3564
if (!elem || elem == null) return true;
@@ -3627,7 +3627,7 @@
3627
}
3628
3629
function cmtermaction(action) {
3630
- connectTerminal(null, 1, { powershell: (action == 2) });
3630
+ connectTerminal(null, 1, { protocol: action });
3631
}
3632
3633
/*
@@ -3646,6 +3646,7 @@
3646
QV('contextMenu', false);
3647
QV('meshContextMenu', false);
3648
QV('termShellContextMenu', false);
3649
+ QV('termShellContextMenuLinux', false);
3650
//QV('pluginTabContextMenu', false);
3651
contextelement = null;
3652
}
@@ -4046,7 +4047,7 @@
4047
// Called When Place a node option is clicked from context menu
4048
function placeNode(coords) {
4049
if (xxdialogMode) return;
4049
- var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
4050
+ var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Chercher" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
4051
for (var i in nodes) {
4052
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
4053
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
@@ -5910,7 +5911,7 @@
5911
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
5912
} else {
5913
// Setup a mesh agent terminal
5913
- var termoptions = {};
5914
+ var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
5915
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
5916
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
5917
if (Q('termSizeList').value == 3) {
@@ -5920,7 +5921,16 @@
5921
termoptions.xterm = true;
5922
}
5923
}
5923
- if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
5924
+
5925
+ // If shift is pressed
5926
+ if ((e && (e.shiftKey == true))) {
5927
+ if (currentNode.agent.id > 4) {
5928
+ if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
5929
+ } else {
5930
+ if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
5931
+ }
5932
+ }
5933
+
5934
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
5935
terminal.debugmode = debugmode;
5936
terminal.m.debugmode = debugmode;
@@ -9420,6 +9430,7 @@
9430
// My Server
9431
if ((x == 6) || (x == 115)) QC('MainMenuMyServer').add(mainMenuActiveClass);
9432
if ((x == 6) || (x == 115) || (x == 40) || (x == 41) || (x == 42)) QC('LeftMenuMyServer').add(leftMenuActiveClass);
9433
+ QV('ServerPlugins', pluginHandler != null);
9434
9435
// column_l max-height
9436
if (webPageStackMenu && (x >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
@@ -9468,8 +9479,12 @@
9479
}
9480
}
9481
9471
- // Plugin
9482
+ //
9483
+ // Plugin Management
9484
+ //
9485
+
9486
function updatePluginList(versInfo) {
9487
+ if (pluginHandler == null) return;
9488
if (Array.isArray(versInfo)) { versInfo.forEach(function(v) { updatePluginList(v); }); }
9489
QV('pluginNoneNotice', installedPluginList.length == 0);
9490
if (installedPluginList.length) {
@@ -9560,15 +9575,18 @@
9575
}
9576
9577
function refreshPluginLatest() {
9578
+ if (pluginHandler == null) return;
9579
meshserver.send({ action: 'pluginLatestCheck' });
9580
}
9581
9582
function distributeCore() {
9583
+ if (pluginHandler == null) return;
9584
meshserver.send({ action: 'distributeCore', nodes: nodes }); // All nodes the user has access to
9585
QV('pluginRestartNotice', false);
9586
}
9587
9588
function pluginActionEx() {
9589
+ if (pluginHandler == null) return;
9590
var act = Q('lastPluginAct').value, id = Q('lastPluginId').value, pVersUrl = Q('lastPluginVersion').value;
9591
9592
switch(act) {
@@ -9593,6 +9611,7 @@
9611
}
9612
9613
function pluginAction(elem, id) {
9614
+ if (pluginHandler == null) return;
9615
if (elem.value == 'downgrade') {
9616
meshserver.send({ 'action': 'getpluginversions', 'id': id });
9617
} else {
@@ -9604,6 +9623,7 @@
9623
}
9624
9625
function goPlugin(pname, title) {
9626
+ if (pluginHandler == null) return;
9627
/*
9628
let holder = Q('PluginSubMenu').querySelectorAll('tr')[0];
9629
let loadedPluginsTDs = holder.querySelectorAll('td');
@@ -9659,6 +9679,7 @@
9679
}
9680
9681
function noGoPlugin(el) {
9682
+ if (pluginHandler == null) return;
9683
/*
9684
QV('PluginSubMenuSpan', false);
9685
let loadedPluginsTDs = Q('PluginSubMenu').querySelectorAll('td');
x.txt
deleted
-9735
@@ -1,9735 +0,0 @@
1
-<!DOCTYPE html>
2
-<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
3
-<head>
4
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
5
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
6
- <meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
7
- <meta name="apple-mobile-web-app-capable" content="yes" />
8
- <meta name="format-detection" content="telephone=no" />
9
- <link rel="shortcut icon" type="image/x-icon" href="{{{domainurl}}}favicon.ico" />
10
- <link keeplink=1 type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
11
- <link type="text/css" href="styles/ol.css" media="screen" rel="stylesheet" title="CSS" />
12
- <link type="text/css" href="styles/ol3-contextmenu.min.css" media="screen" rel="stylesheet" title="CSS" />
13
- <script type="text/javascript" src="scripts/common-0.0.1.js"></script>
14
- <script type="text/javascript" src="scripts/meshcentral.js"></script>
15
- <script type="text/javascript" src="scripts/amt-0.2.0.js"></script>
16
- <script type="text/javascript" src="scripts/amt-wsman-0.2.0.js"></script>
17
- <script type="text/javascript" src="scripts/amt-desktop-0.0.2.js"></script>
18
- <script type="text/javascript" src="scripts/amt-terminal-0.0.2.js"></script>
19
- <script type="text/javascript" src="scripts/zlib.js"></script>
20
- <script type="text/javascript" src="scripts/zlib-inflate.js"></script>
21
- <script type="text/javascript" src="scripts/zlib-adler32.js"></script>
22
- <script type="text/javascript" src="scripts/zlib-crc32.js"></script>
23
- <script type="text/javascript" src="scripts/amt-redir-ws-0.1.0.js"></script>
24
- <script type="text/javascript" src="scripts/amt-wsman-ws-0.2.0.js"></script>
25
- <script type="text/javascript" src="scripts/agent-redir-ws-0.1.1.js"></script>
26
- <script type="text/javascript" src="scripts/agent-redir-rtc-0.1.0.js"></script>
27
- <script type="text/javascript" src="scripts/agent-desktop-0.0.2.js"></script>
28
- <script type="text/javascript" src="scripts/qrcode.min.js"></script>
29
- <script keeplink=1 type="text/javascript" src="scripts/u2f-api.js"></script>
30
- <script keeplink=1 type="text/javascript" src="scripts/charts.js"></script>
31
- <script keeplink=1 type="text/javascript" src="scripts/filesaver.js"></script>
32
- <script keeplink=1 type="text/javascript" src="scripts/ol.js"></script>
33
- <script keeplink=1 type="text/javascript" src="scripts/ol3-contextmenu.js"></script>
34
- <title>{{{title}}}</title>
35
-</head>
36
-<body id="body" onload="if (typeof(startup) !== 'undefined') startup();" oncontextmenu="handleContextMenu(event)" style="display:none;min-width:495px">
37
- <!-- right click menu -->
38
- <div id="contextMenu" class="contextMenu noselect" style="display:none">
39
- <div id="cxinfo" class="cmtext" onclick="cmaction(1,event)"><b>Information</b></div>
40
- <div id="cxdesktop" class="cmtext" onclick="cmaction(3,event)">Desktop</div>
41
- <div id="cxterminal" class="cmtext" onclick="cmaction(2,event)">Terminal</div>
42
- <div id="cxfiles" class="cmtext" onclick="cmaction(4,event)">Files</div>
43
- <div id="cxevents" class="cmtext" onclick="cmaction(5,event)">Events</div>
44
- <div id="cxconsole" class="cmtext" onclick="cmaction(6,event)">Console</div>
45
- <hr id="cxmgroupsplit" />
46
- <div id="cxmdesktop" class="cmtext" onclick="cmaction(7,event)" style="display:none">Multi-Desktop</div>
47
- </div>
48
- <div id="meshContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
49
- <div id="cxselectall" class="cmtext" onclick="cmmeshaction(1,event)">Select All</div>
50
- <div id="cxselectnone" class="cmtext" onclick="cmmeshaction(2,event)">Select None</div>
51
- <!--
52
- <hr id="cxmgroupsplit2" style="display:none" />
53
- <div id="cxmmdesktop" class="cmtext" style="display:none" onclick="cmmeshaction(3,event)">Multi-Desktop</div>
54
- -->
55
- </div>
56
- <div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
57
- <div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)">Normal Connect</div>
58
- <div id="cxtermps" class="cmtext" onclick="cmtermaction(2,event)">PowerShell Connect</div>
59
- </div>
60
- <div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
61
- <div id="cxclose" class="cmtext" onclick="pluginTabClose(event)">Close Tab</div>
62
- </div>
63
- <!-- main page -->
64
- <div id=container>
65
- <div id="notifiyBox" class="notifiyBox" style="display:none"></div>
66
- <div id=masthead class=noselect>
67
- <div class="title">{{{title}}}</div>
68
- <div class="title2">{{{title2}}}</div>
69
- <div style="float:right">
70
- <div id=notificationCount onclick="clickNotificationIcon()" class="unselectable" style="display: none;" title="Click to view current notifications">0</div>
71
- </div>
72
- <p id="logoutControl">{{{logoutControl}}}<span id=idleTimeoutNotify style="color:yellow"></span></p>
73
- </div>
74
- <div id="page_leftbar">
75
- <div style="height:16px"></div>
76
- <div id=LeftMenuMyDevices tabindex=0 class="lbbutton lbbuttonsel" title="My Devices" onclick=go(1,event) onkeypress="if (event.key=='Enter') { go(1); }">
77
- <div class="lb2"></div>
78
- </div>
79
- <div id=LeftMenuMyAccount tabindex=0 class="lbbutton" title="My Account" onclick=go(2,event) onkeypress="if (event.key=='Enter') { go(2); }">
80
- <div class="lb1"></div>
81
- </div>
82
- <div id=LeftMenuMyEvents tabindex=0 class="lbbutton" title="My Events" onclick=go(3,event) onkeypress="if (event.key=='Enter') { go(3); }">
83
- <div class="lb3"></div>
84
- </div>
85
- <div id=LeftMenuMyFiles tabindex=0 class="lbbutton" style="display:none" title="My Files" onclick=go(5,event) onkeypress="if (event.key=='Enter') { go(5); }">
86
- <div class="lb4"></div>
87
- </div>
88
- <div id=LeftMenuMyUsers tabindex=0 class="lbbutton" style="display:none" title="My Users" onclick=go(4,event) onkeypress="if (event.key=='Enter') { go(4); }">
89
- <div class="lb5"></div>
90
- </div>
91
- <div id=LeftMenuMyServer tabindex=0 class="lbbutton" style="display:none" title="My Server" onclick=go(6,event) onkeypress="if (event.key=='Enter') { go(6); }">
92
- <div class="lb6"></div>
93
- </div>
94
- <!-- ***************************
95
- <div id=LeftMenuMyPlugins tabindex=0 class="lbbutton" style="display:none" title="My Plugins" onclick=go(7,event) onkeypress="if (event.key=='Enter') { go(7); }">
96
- <div class="lb7"></div>
97
- </div>
98
- -->
99
- </div>
100
- <div id=topbar class=noselect>
101
- <div>
102
- <div style="position:relative">
103
- <div tabindex=0 id=uiMenuButton title="User interface selection" onclick="showUserInterfaceSelectMenu()" onkeypress="if (event.key == 'Enter') showUserInterfaceSelectMenu()">
104
- ♦
105
- <div id=uiMenu style="display:none">
106
- <div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface" onkeypress="if (event.key == 'Enter') userInterfaceSelectMenu(1)"><div class="uiSelector1"></div></div>
107
- <div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface" onkeypress="if (event.key == 'Enter') userInterfaceSelectMenu(2)"><div class="uiSelector2"></div></div>
108
- <div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface" onkeypress="if (event.key == 'Enter') userInterfaceSelectMenu(3)"><div class="uiSelector3"></div></div>
109
- <div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode" onkeypress="if (event.key == 'Enter') toggleNightMode()"><div class="uiSelector4"></div></div>
110
- </div>
111
- </div>
112
- <table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1>
113
- <tr>
114
- <td tabindex=0 id=MainMenuMyDevices class="topbar_td style3x" onclick=go(1,event) onkeypress="if (event.key == 'Enter') go(1)">My Devices</td>
115
- <td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x" onclick=go(2,event) onkeypress="if (event.key == 'Enter') go(2)">My Account</td>
116
- <td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x" onclick=go(3,event) onkeypress="if (event.key == 'Enter') go(3)">My Events</td>
117
- <td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x" onclick=go(5,event) onkeypress="if (event.key == 'Enter') go(5)">My Files</td>
118
- <td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x" onclick=go(4,event) onkeypress="if (event.key == 'Enter') go(4)">My Users</td>
119
- <td tabindex=0 id=MainMenuMyServer class="topbar_td style3x" onclick=go(6,event) onkeypress="if (event.key == 'Enter') go(6)">My Server</td>
120
- <td tabindex=0 id=MainMenuMyPlugins class="topbar_td style3x" onclick=go(7,event) onkeypress="if (event.key == 'Enter') go(7)">My Plugins</td>
121
- <td class="topbar_td_end style3"> </td>
122
- </tr>
123
- </table>
124
- <div id=MainSubMenuSpan style="display:none">
125
- <table id=MainSubMenu cellpadding=0 cellspacing=0 class=style1>
126
- <tr>
127
- <td tabindex=0 id=MainDev class="topbar_td style3x" onclick=go(10,event) onkeypress="if (event.key == 'Enter') go(10)">General</td>
128
- <td tabindex=0 id=MainDevDesktop class="topbar_td style3x" onclick=go(11,event) onkeypress="if (event.key == 'Enter') go(11)">Desktop</td>
129
- <td tabindex=0 id=MainDevTerminal class="topbar_td style3x" onclick=go(12,event) onkeypress="if (event.key == 'Enter') go(12)">Terminal</td>
130
- <td tabindex=0 id=MainDevFiles class="topbar_td style3x" onclick=go(13,event) onkeypress="if (event.key == 'Enter') go(13)">Files</td>
131
- <td tabindex=0 id=MainDevEvents class="topbar_td style3x" onclick=go(16,event) onkeypress="if (event.key == 'Enter') go(16)">Events</td>
132
- <td tabindex=0 id=MainDevInfo class="topbar_td style3x" onclick=go(17,event) onkeypress="if (event.key == 'Enter') go(17)">Details</td>
133
- <td tabindex=0 id=MainDevAmt class="topbar_td style3x" onclick=go(14,event) onkeypress="if (event.key == 'Enter') go(14)">Intel® AMT</td>
134
- <td tabindex=0 id=MainDevConsole class="topbar_td style3x" onclick=go(15,event) onkeypress="if (event.key == 'Enter') go(15)">Console</td>
135
- <td tabindex=0 id=MainDevPlugins class="topbar_td style3x" onclick=go(19,event) onkeypress="if (event.key == 'Enter') go(19)">Plugins</td>
136
- <td class="topbar_td_end style3"> </td>
137
- </tr>
138
- </table>
139
- </div>
140
- <div id=MeshSubMenuSpan style="display:none">
141
- <table id=MeshSubMenu cellpadding=0 cellspacing=0 class=style1>
142
- <tr>
143
- <td tabindex=0 id=MeshGeneral class="topbar_td style3x" onclick=go(20,event) onkeypress="if (event.key == 'Enter') go(20)">General</td>
144
- <td class="topbar_td_end style3"> </td>
145
- </tr>
146
- </table>
147
- </div>
148
- <div id=UserSubMenuSpan style="display:none">
149
- <table id=UserSubMenu cellpadding=0 cellspacing=0 class=style1>
150
- <tr>
151
- <td tabindex=0 id=UserGeneral class="topbar_td style3x" onclick=go(30,event) onkeypress="if (event.key == 'Enter') go(30)">General</td>
152
- <td tabindex=0 id=UserEvents class="topbar_td style3x" onclick=go(31,event) onkeypress="if (event.key == 'Enter') go(31)">Events</td>
153
- <td class="topbar_td_end style3"> </td>
154
- </tr>
155
- </table>
156
- </div>
157
- <div id=ServerSubMenuSpan style="display:none">
158
- <table id=ServerSubMenu cellpadding=0 cellspacing=0 class=style1>
159
- <tr>
160
- <td tabindex=0 id=ServerGeneral class="topbar_td style3x" onclick=go(6,event) onkeypress="if (event.key == 'Enter') go(6)">General</td>
161
- <td tabindex=0 id=ServerStats class="topbar_td style3x" onclick=go(40,event) onkeypress="if (event.key == 'Enter') go(40)">Stats</td>
162
- <td tabindex=0 id=ServerConsole class="topbar_td style3x" onclick=go(115,event) onkeypress="if (event.key == 'Enter') go(115)">Console</td>
163
- <td tabindex=0 id=ServerTrace class="topbar_td style3x" onclick=go(41,event) onkeypress="if (event.key == 'Enter') go(41)">Trace</td>
164
- <td tabindex=0 id=ServerPlugins class="topbar_td style3x" onclick=go(42,event) onkeypress="if (event.key == 'Enter') go(42)">Plugins</td>
165
- <td class="topbar_td_end style3"> </td>
166
- </tr>
167
- </table>
168
- </div>
169
- <!--
170
- <div id=PluginSubMenuSpan>
171
- <table id=PluginSubMenu cellpadding=0 cellspacing=0 class=style1>
172
- <tr>
173
- <td onclick="goPlugin(-1)" onkeypress="if (event.key == 'Enter') goPlugin(-1)" class="topbar_td style3x">Home</td>
174
- </tr>
175
- </table>
176
- </div>
177
- -->
178
- <div id=UserDummyMenuSpan>
179
- <table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1>
180
- <tr><td class=style3 style=""> </td></tr>
181
- </table>
182
- </div>
183
- </div>
184
- </div>
185
- </div>
186
- <div id="column_l">
187
- <div id=p0 style="display:none">
188
- <div id=p0message><span id=p0span>Server disconnected</span>, <href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div>
189
- </div>
190
- <div id=p1 style="display:none">
191
- <div style="display:none" id="devListToolbarViewIcons">
192
- <div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress="if (event.key == 'Enter') { onDeviceViewChange(1); }" title="Columns"><div class="viewSelector2"></div></div>
193
- <div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress="if (event.key == 'Enter') { onDeviceViewChange(2); }" title="List"><div class="viewSelector1"></div></div>
194
- <div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress="if (event.key == 'Enter') { onDeviceViewChange(3); }" title="Desktops"><div class="viewSelector3"></div></div>
195
- <div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress="if (event.key == 'Enter') { onDeviceViewChange(4); }" title="Map"><div class="viewSelector4"></div></div>
196
- </div><div><h1>My Devices</h1></div>
197
- <table id="devListToolbarSpan" class="noselect">
198
- <tr>
199
- <td class=h1></td>
200
- <td id=devListToolbar class=style14 style="display:none">
201
- <input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />
202
- <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />
203
- <input id=SearchInput type=text placeholder=Filter onchange=masterUpdate(5) onkeyup=masterUpdate(5) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />
204
- <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox() /><span title="Show devices operating system name">OS Name</span></label>
205
- </td>
206
- <td id=kvmListToolbar class=style14 style="display:none">
207
- <input type="button" onclick="connectAllKvmFunction()" value="Connect All" />
208
- <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" />
209
- <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto </label>
210
- <input type="button" onclick="showMultiDesktopSettings()" value="Settings" />
211
- </td>
212
- <td id=devMapToolbar class=style14 style="display:none">
213
- <input type=text id=mapSearchLocation placeholder="Search Location" onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0) />
214
- <input type=button value=Search title="Search for location" onclick=getSearchLocation() />
215
- <input type=button id=refreshmap title="Reset map view" value=Reset onclick=refreshMap(false,true) />
216
- </td>
217
- <td class="auto-style1" style=height:100%>
218
- <div style="display:none" id=devListToolbarView>
219
- View
220
- <select id=viewselect onchange=onDeviceViewChange()>
221
- <option value=1>Columns</option>
222
- <option value=2>List</option>
223
- <option value=3>Desktops</option>
224
- <option id=viewselectmapoption value=4>Map</option>
225
- </select>
226
- </div>
227
- <div style="display:none" id=devListToolbarSort>
228
- Sort
229
- <select id=sortselect onchange=masterUpdate(6)>
230
- <option>Group</option>
231
- <option>Power</option>
232
- <option>Device</option>
233
- <option>Tags</option>
234
- </select>
235
-
236
- </div>
237
- <div style="display:none" id=devListToolbarSize>
238
- Size
239
- <select id=sizeselect onchange=onDeviceViewChange()>
240
- <option value=0>Small</option>
241
- <option value=1>Medium</option>
242
- <option value=2>Large</option>
243
- </select>
244
-
245
- </div>
246
- </td>
247
- <td class=h2></td>
248
- </tr>
249
- </table>
250
- <div id=NoMeshesPanel style="display:none">
251
- <table>
252
- <tr>
253
- <td valign="top" style="width: 50px">
254
- <img src="images/info.png" />
255
- </td>
256
- <td>
257
- <div id="getStarted1">To get started, <a href=# onclick="return account_createMesh()"><strong>click here to create a device group</strong></a>.</div>
258
- <div id="getStarted2">No device groups.</div>
259
- </td>
260
- </tr>
261
- </table>
262
- </div>
263
- <div id="xdevices" class="noselect" style="display:none"></div>
264
- <div id="xdevicesmap" style="display:none">
265
- <div id=xmapSearchResultsDlg style="display:none">
266
- <div id=xmapSearchResultsBck>
267
- <div id=xmapSearchClose onclick=mapCloseSearchWindow()><b>X</b></div>
268
- <div style=padding:5px>Location Results</div>
269
- <div style=width:100%;margin:6px></div>
270
- </div>
271
- <div id=xmapSearchResults style=margin:6px></div>
272
- </div>
273
- </div>
274
- <div id="xmap-info-window"></div>
275
- </div>
276
- <div id=p2 style="display:none">
277
- <h1>My Account</h1>
278
- <img id="p2AccountImage" alt="" src="images/clipboard-128.png" />
279
- <div id="p2AccountSecurity" style="display:none">
280
- <p><strong>Account security</strong></p>
281
- <div style="margin-left:25px">
282
- <div id="manageAuthApp"><div class="p2AccountActions"><span id="authAppSetupCheck"><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Manage authenticator app</a><br /></span></div>
283
- <div id="manageHardwareOtp"><div class="p2AccountActions"><span id="authKeySetupCheck"><strong>✓</strong></span></div><span><a href=# onclick="return account_manageHardwareOtp(0)">Manage security keys</a><br /></span></div>
284
- <div id="manageOtp"><div class="p2AccountActions"><span id="authCodesSetupCheck"><strong>✓</strong></span></div><span><a href=# onclick="return account_manageOtp(0)">Manage backup codes</a><br /></span></div>
285
- </div>
286
- </div>
287
- <div id="p2AccountActions">
288
- <p><strong>Account actions</strong></p>
289
- <p class="mL">
290
- <span id="verifyEmailId" style="display:none"><a href=# onclick="return account_showVerifyEmail()">Verify email</a><br /></span>
291
- <span id="accountEnableNotificationsSpan" style="display:none"><a href=# onclick="return account_enableNotifications()">Enable web notifications</a><br /></span>
292
- <a href=# onclick="return account_showLocalizationSettings()">Localization Settings</a><br />
293
- <a href=# onclick="return account_showAccountNotifySettings()">Notification Settings</a><br />
294
- <span id="accountChangeEmailAddressSpan" style="display:none"><a href=# onclick="return account_showChangeEmail()">Change email address</a><br /></span>
295
- <a href=# onclick="return account_showChangePassword()">Change password</a><span id="p2nextPasswordUpdateTime"></span><br />
296
- <a href=# onclick="return account_showDeleteAccount()">Delete account</a><br />
297
- </p>
298
- <br style=clear:both />
299
- </div>
300
- <strong>Device Groups</strong>
301
- <span id="p2createMeshLink1">( <a href=# onclick="return account_createMesh()" class="newMeshBtn"> New</a> )</span>
302
- <br /><br />
303
- <div id=p2meshes></div>
304
- <div id=p2noMeshFound style="display:none">No device groups.<span id="p2createMeshLink2"> <a href=# onclick="return account_createMesh()"><strong>Get started here!</strong></a></span></div>
305
- <br style=clear:both />
306
- </div>
307
- <div id=p3 style="display:none">
308
- <h1>My Events</h1>
309
- <table class="pTable">
310
- <tr>
311
- <td class="h1"></td>
312
- <td class="auto-style1">
313
- Show
314
- <select id=p3limitdropdown onchange=refreshEvents()>
315
- <option value=60>Last 60</option>
316
- <option value=120>Last 120</option>
317
- <option value=250>Last 250</option>
318
- <option value=500>Last 500</option>
319
- <option value=1000>Last 1000</option>
320
- </select>
321
- <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Download Events" style=cursor:pointer></a>
322
- </td>
323
- <td class="h2"></td>
324
- </tr>
325
- </table>
326
- <div id=p3events style=""></div>
327
- </div>
328
- <div id=p4 style="display:none">
329
- <h1>My Users</h1>
330
- <table class="pTable">
331
- <tr>
332
- <td class="h1"></td>
333
- <td class="style14">
334
- <div style="float:right">
335
- <input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value="Broadcast" />
336
- <a href=# onclick=p4downloadUserInfo()><img style="cursor:pointer" title="Download user information" src="images/link4.png" /></a>
337
- <a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style="cursor:pointer;display:none" title="Batch create many user accounts" src="images/link6.png" /></a>
338
- </div>
339
- <div>
340
- <input id=UserNewAccountButton type=button style=margin-left:6px onclick=showCreateNewAccountDialog() value="New Account..." />
341
- <input id=UserSearchInput type=text style=width:120px;margin-left:6px placeholder=Filter onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0) />
342
- </div>
343
- </td>
344
- <td class="h2"></td>
345
- </tr>
346
- </table>
347
- <div id="p3users"></div>
348
- </div>
349
- <div id=p5 style="display:none">
350
- <h1>My Files</h1>
351
- <table id="p5toolbar" cellpadding="0" cellspacing="0">
352
- <tr>
353
- <td id="p5filehead" valign=bottom>
354
- <div id="p5rightOfButtons"></div>
355
- <div>
356
- <input type=button id=p5FolderUp disabled="disabled" onclick="return p5folderup();" value="Up" />
357
- <input type=button id=p5SelectAllButton disabled="disabled" onclick="p5selectallfile();" value="Select All" />
358
- <input type=button id=p5RenameFileButton disabled="disabled" value="Rename" onclick="p5renamefile();" />
359
- <input type=button id=p5DeleteFileButton disabled="disabled" value="Delete" onclick="p5deletefile();" />
360
- <!--<input type=button id=p5ViewFileButton disabled="disabled" value="View" onclick="p5viewfile()" /> -->
361
- <input type=button id=p5NewFolderButton disabled="disabled" value="New Folder" onclick="p5createfolder();" />
362
- <input type=button id=p5UploadButton disabled="disabled" value="Upload" onclick="p5uploadFile()" />
363
- <input type=button id=p5CutButton disabled="disabled" value="Cut" onclick="p5copyFile(1)" />
364
- <input type=button id=p5CopyButton disabled="disabled" value="Copy" onclick="p5copyFile(0)" />
365
- <input type=button id=p5PasteButton disabled="disabled" value="Paste" onclick="p5pasteFile()" />
366
- </div>
367
- </td>
368
- </tr>
369
- <tr>
370
- <td id="p5filesubhead">
371
- <div style=float:right>
372
- <select id=p5sortdropdown onchange=updateFiles()>
373
- <option value="1" selected="selected">Sort by name</option>
374
- <option value="2">Sort by size</option>
375
- <option value="3">Sort by date</option>
376
- <option value="4">Descend by name</option>
377
- <option value="5">Descend by size</option>
378
- <option value="6">Descend by date</option>
379
- </select>
380
- </div>
381
- <div> <span id="p5currentpath"></span></div>
382
- </td>
383
- </tr>
384
- </table>
385
- <div id="p5filetable">
386
- <!--
387
- <form id=p5fileCatchAll method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame>
388
- <input type=file id=p5fileCatchAllInput name=files style="position:absolute;left:0;width:100%;top:0;bottom:0;opacity:0;display:none" onchange="p5fileCatchAllInputChanged(event)" />
389
- <input id=p5fileDragLink2 name="link" style="display:none" />
390
- <input type=submit id=p5fileCatchAllSubmit style="display:none" />
391
- </form>
392
- -->
393
- <div id="p5PublicShare" style=""><div>These files are shared publicly, click "link" to get public url.</div></div>
394
- <div id="bigok" style="display:none"><b>✓</b></div>
395
- <div id="bigfail" style="display:none"><b>✗</b></div>
396
- <span id="p5files"></span>
397
- </div>
398
- <table id="p5toolbarBottom" style=width:100% cellpadding=0 cellspacing=0>
399
- <tr><td class=style6> <span id="p5bottomstatus"></span></td></tr>
400
- </table>
401
- </div>
402
- <div id=p6 style="display:none">
403
- <img id=MainMeshImage src="serverpic.ashx">
404
- <h1>My Server</h1>
405
- <div id="p2ServerActions">
406
- <p><strong>Server actions</strong></p>
407
- <div class="mL">
408
- <div id="p2ServerActionsBackup"><a href="{{{domainurl}}}backup.zip" rel="noreferrer noopener" target="_blank">Download server backup</a></div>
409
- <div id="p2ServerActionsRestore"><a href=# onclick="return server_showRestoreDlg()">Restore server with backup</a></div>
410
- <div id="p2ServerActionsVersion"><a href=# onclick="return server_showVersionDlg()">Check server version</a></div>
411
- <div id="p2ServerActionsErrors"><a href=# onclick="return server_showErrorsDlg()">Show server error log</a></div>
412
- </div>
413
- </div>
414
- <br /><strong>Server Statistics</strong><br /><br />
415
- <div id="serverStats">
416
- <div id="serverCpuChartView" style="display:none">
417
- <div class="chartViewCanvas"><canvas id="serverCpuChart"></canvas></div>
418
- <div class="chartViewText" id="serverCpuChartText"></div>
419
- </div>
420
- <div id="serverMemoryChartView" style="display:none">
421
- <div class="chartViewCanvas"><canvas id="serverMemoryChart"></canvas></div>
422
- <div class="chartViewText" id="serverMemoryChartText"></div>
423
- </div><br /><br />
424
- <div id="serverStatsTable"></div>
425
- </div>
426
- </div>
427
- <div id=p7 style="display:none">
428
- <h1>My Plugins</h1>
429
- <div id="addPlugin" title="Add New Plugin" onclick="return pluginHandler.addPluginDlg();"></div>
430
- <table id="p7tbl">
431
- <tr><th class="chName">Name</th><th class="chDescription">Description</th><th class="chSite">Link</th><th class="chVersion">Version</th><th class="chUpgradeAvail">Latest Available</th><th class="chStatus">Status</th><th class="chAction">Action</th></tr>
432
- </table>
433
- <div id="pluginRestartNotice" style="display:none;"><div>Notice:</div> MeshCentral plugins have been altered. Agent cores require may require an update before full features are available.<br />
434
- Click <a href="#" onclick="distributeCore(); return false;">here</a> to update all Mesh Agent cores.
435
- </div>
436
- </div>
437
- <div id=p10 style="display:none">
438
- <table style="width:100%" cellpadding="0" cellspacing="0">
439
- <tr>
440
- <td style=width:auto valign=top>
441
- <div id=p10title>
442
- <div id="p10BackButton"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
443
- <h1>General - <span id=p10deviceName></span></h1>
444
- </div>
445
- <div id=p10html></div>
446
- </td>
447
- <td style=width:20px></td>
448
- <td style=width:200px>
449
- <a href=# onclick=p10showiconselector()><img id=MainComputerImage></a>
450
- <div id=MainComputerState></div>
451
- </td>
452
- </tr>
453
- </table><br />
454
- <div id=p10html2></div>
455
- <div id=p10html3></div>
456
- </div>
457
- <div id=p11 class="noselect" style="display:none">
458
- <div id="p11title">
459
- <div id=p11deviceNameHeader>
460
- <div id="p11BackButton"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
461
- <div id="devListToolbarViewIcons"><div class="viewSelector" onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class="viewSelector5"></div></div></div>
462
- <h1>Desktop - <span id=p11deviceName></span></h1>
463
- </div>
464
- </div>
465
- <div id="p11warning" onclick="showFeaturesDlg()">
466
- <div class="icon2"></div>
467
- <div class="warningbox">Intel® AMT Redirection port or KVM feature is disabled<span id="p11warninga">, click here to enable it.</span></div>
468
- </div>
469
- <div id="p11warning2" onclick="showPowerActionDlg()">
470
- <div class="icon2"></div>
471
- <div class="warningbox">Remote computer is not powered on, click here to issue a power command.</div>
472
- </div>
473
- <div id=deskarea0 cellpadding=0 cellspacing=0>
474
- <div id=deskarea1 class="areaHead">
475
- <div class="toright2">
476
- <span id="p11power"></span>
477
- <div class='deskareaicon' title="Toggle View Mode" onclick="toggleAspectRatio(1)">⇲</div>
478
- <div class='deskareaicon' title="Rotate Left" onclick="drotate(-1)">↺</div>
479
- <div class='deskareaicon' title="Rotate Right" onclick="drotate(1)">↻</div>
480
- <div id="deskRecordIcon" class='deskareaicon' title="Server is recording this session" style="display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px"></div>
481
- <input id="deskFocusBtn" type="button" title="Toggle focus mode, when active only the region around the mouse is updated" onkeypress="return false" onkeydown="return false" value="Focus All" onclick="deskToggleFocus()" style="margin-right:3px;display:none" />
482
- <input id="deskSaveBtn" type="button" title="Save a screenshot of the remote desktop" onkeypress="return false" onkeydown="return false" value="Save..." onclick=deskSaveImage() class="mR" />
483
- <input id="deskActionsBtn" type=button title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value=Actions onclick=deviceActionFunction() class="mR" />
484
- <input id="deskActionsSettings" type="button" value="Settings..." title="Edit remote desktop settings" onkeypress="return false" onkeydown="return false" onclick="showDesktopSettings()" class="mR" />
485
- <input type="button" title="Change the power state of the remote machine" onkeypress="return false" onkeydown="return false" value="Power Actions..." onclick="showPowerActionDlg()" style="display:none" />
486
- </div>
487
- <div>
488
- <div id="idx_deskFullBtn2" onclick=deskToggleFull(event)> ✖</div>
489
- <input type="button" id="autoconnectbutton1" value="AutoConnect" onclick=autoConnectDesktop(event) onkeypress="return false" onkeydown="return false" style="display:none" />
490
- <span id=connectbutton1span><input type=button id=connectbutton1 value="Connect" onclick=connectDesktop(event,1) onkeypress="return false" onkeydown="return false" disabled="disabled" /></span>
491
- <span id=connectbutton1hspan> <input type=button id=connectbutton1h value="HW Connect" onclick=connectDesktop(event,2) onkeypress="return false" onkeydown="return false" disabled="disabled" /></span>
492
- <span id=disconnectbutton1span> <input type=button id=disconnectbutton1 value="Disconnect" onclick=connectDesktop(event,0) onkeypress="return false" onkeydown="return false" /></span>
493
- <span id="deskstatus">Disconnected</span>
494
- </div>
495
- </div>
496
- <div id=deskarea2 style="">
497
- <div class="areaProgress"><div id="progressbar" style=""></div></div>
498
- </div>
499
- <div id=deskarea3x>
500
- <div id=DeskFocus oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></div>
501
- <div id=DeskParent>
502
- <canvas id=Desk width=640 height=480 oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas>
503
- </div>
504
- <div id=DeskTools>
505
- <div id=deskToolsAreaTop>
506
- <a id=DeskToolsRefreshButton style="right:2px" onclick="refreshDeskTools()">Refresh</a>
507
- <div id=deskToolsTopTabProcess class="deskToolsTopTab" onclick="changeDeskToolTab(0)" style="left:0px;bottom:0px">Processes</div>
508
- <div id=deskToolsTopTabService class="deskToolsTopTab" onclick="changeDeskToolTab(1)" style="display:none;left:90px;color:gray">Services</div>
509
- </div>
510
- <div id=deskToolsArea>
511
- <div id="DeskToolsProcessTab">
512
- <div id=deskToolsHeader>
513
- <a class="colmn1" title="Sort by process id" onclick=sortProcess(0)>PID</a>
514
- <a class="colmn2" title="Sort by name" onclick=sortProcess(1)>Name</a>
515
- </div>
516
- <div id="DeskToolsProcesses" style=""></div>
517
- </div>
518
- <div id="DeskToolsServiceTab" style="display:none">
519
- <div id=deskToolsServiceHeader>
520
- <a class="colmn1" style="width:70px" title="Sort by state" onclick=sortService(0)>State</a>
521
- <a class="colmn2" title="Sort by name" onclick=sortService(1)>Name</a>
522
- </div>
523
- <div id="DeskToolsServices" style=""></div>
524
- </div>
525
- </div>
526
- </div>
527
- <div id=p11DeskConsoleMsg style="display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:yellow;background-color:rgba(0,0,0,0.6);padding:10px;border-radius:5px" onclick=p11clearConsoleMsg()></div>
528
- </div>
529
- <div id=deskarea4 class="areaFoot">
530
- <div class="toright2">
531
- <span id="DeskTimer" title="Session time"></span>
532
- <select id=termdisplays style="display:none" onchange=deskSetDisplay(event) onkeypress="return false" onkeydown="return false"></select>
533
- <input id=DeskToolsButton type=button value=Tools title="Toggle tools view" onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()" />
534
- <span id=DeskChatButton class="deskarea" title="Open chat window to this computer"><img src='images/icon-chat.png' onclick=deviceChat(event) height=16 width=16 style=padding-top:2px /></span>
535
- <span id=DeskNotifyButton title="Display a notification on the remote computer"><img src='images/icon-notify.png' onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px /></span>
536
- <span id=DeskOpenWebButton title="Open a web address on remote computer"><img src='images/icon-url2.png' onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px /></span>
537
- </div>
538
- <div>
539
- <select id="deskkeys">
540
- <option value=10>Ctrl+Alt+Del</option>
541
- <option value=5>Win</option>
542
- <option value=0>Win+Down</option>
543
- <option value=1>Win+Up</option>
544
- <option value=2>Win+L</option>
545
- <option value=3>Win+M</option>
546
- <option value=4>Shift+Win+M</option>
547
- <option value=6>Win+R</option>
548
- <option value=7>Alt-F4</option>
549
- <option value=8>Ctrl-W</option>
550
- <option value=9>Alt-Tab</option>
551
- <option value=11>Win+Left</option>
552
- <option value=12>Win+Right</option>
553
- </select>
554
- <input id="DeskWD" type=button value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()" />
555
- <input id="DeskClip" style="" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()" />
556
- <input id="DeskType" style="" type="button" value="Type" onkeypress="return false" onkeydown="return false" onclick="showDeskType()" />
557
- <label><span id="DeskControlSpan" title="Toggle mouse and keyboard input"><input id="DeskControl" type="checkbox" onkeypress="return false" onkeydown="return false" onclick="toggleKvmControl()" />Input</span></label>
558
- </div>
559
- </div>
560
- </div>
561
- </div>
562
- <div id=p12 style="display:none">
563
- <div id="p12title">
564
- <div id="p12BackButton"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
565
- <h1>Terminal - <span id=p12deviceName></span></h1>
566
- </div>
567
- <div id="p12warning" onclick=showFeaturesDlg()>
568
- <div class="icon2"></div>
569
- <div class="warningbox">Intel® AMT Redirection port or KVM feature is disabled<span id="p12warninga">, click here to enable it.</span></div>
570
- </div>
571
- <div id="p12warning2" onclick=showPowerActionDlg()>
572
- <div class="icon2"></div>
573
- <div class="warningbox">Remote computer is not powered on, click here to issue a power command.</div>
574
- </div>
575
- <div id=termTable style="position:relative">
576
- <table style="width:100%" cellpadding=0 cellspacing=0>
577
- <tr>
578
- <td class="areaHead">
579
- <div class="toright2">
580
- <div id="termRecordIcon" class='deskareaicon' title="Server is recording this session" style="display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px"></div>
581
- <input id="termActionsBtn" type=button title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value=Actions onclick=deviceActionFunction() />
582
- </div>
583
- <div>
584
- <input type="button" id="autoconnectbutton2" value="AutoConnect" onclick=autoConnectTerminal(event) onkeypress="return false" onkeydown="return false" style="display:none" />
585
- <span id="connectbutton2span"><input type="button" id="connectbutton2" value="Connect" onclick=connectTerminal(event,1) onkeypress="return false" onkeydown="return false" disabled="disabled" /></span>
586
- <span id="connectbutton2hspan"> <input type="button" id="connectbutton2h" value="HW Connect" onclick=connectTerminal(event,2) onkeypress="return false" onkeydown="return false" disabled="disabled" /></span>
587
- <span id="disconnectbutton2span"> <input type="button" id="disconnectbutton2" value="Disconnect" onclick=connectTerminal(event,0) onkeypress="return false" onkeydown="return false" /></span>
588
- <span id="termstatus">Disconnected</span><span id="termtitle"></span>
589
- </div>
590
- </td>
591
- </tr>
592
- <tr>
593
- <td>
594
- <div class="areaProgress"><div id="termprogressbar" style=""></div></div>
595
- </td>
596
- </tr>
597
- <tr>
598
- <td id="termarea3x">
599
- <pre id="Term"></pre>
600
- </td>
601
- </tr>
602
- <tr>
603
- <td class="areaFoot">
604
- <div class="toright2">
605
- <span id="TermTimer" title="Session time"></span>
606
- <span id="terminalSettingsButtons" style="display:none">
607
- <input id="id_tcrbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="CR+LF" title="Toggle what the return key will send" onclick="termToggleCr()" />
608
- <input id="id_tfxkeysbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Intel (F10 = ESC+[OM)" title="Toggle F1 to F10 keys emulation type" onclick="termToggleFx()" />
609
- <input id="id_ttypebutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Extended Ascii" title="Toggle terminal emulation type" onclick="termToggleType()" />
610
- </span>
611
- <span id="terminalSizeDropDown">
612
- <select id="termSizeList" onkeypress="return false"><option value="1">80x25</option><option value="2">100x30</option><option value="3" selected>Auto</option></select>
613
- </span>
614
- <select id="specialkeylist" onkeypress="return false"></select>
615
- <input id="specialkeylistinput" type="button" onkeypress="return false" class="bottombutton" value="Send" title="Send the selected special key" onclick="sendSpecialKey()" />
616
- </div>
617
- <div>
618
-
619
- <input type=button onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlcbutton" value="Ctl-C" onclick="termSendKey(3,'ctrlcbutton')" />
620
- <input type=button onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlxbutton" value="Ctl-X" onclick="termSendKey(24,'ctrlxbutton')" />
621
- <input type=button onkeypress="return false" onkeydown="return false" class="bottombutton" id="escbutton" value="ESC" onclick="termSendKey(27,'escbutton')" />
622
- <input type=button onkeypress="return false" onkeydown="return false" class="bottombutton" id="bsbutton" value="Backspace" onclick="termSendKey(8,'bsbutton')" />
623
- <input type=button onkeypress="return false" onkeydown="return false" class="bottombutton" id="pastebutton" value="Paste" title="Paste text into the terminal" onclick="showTermPasteDialog()" />
624
- </div>
625
- </td>
626
- </tr>
627
- </table>
628
- <div id=p12TermConsoleMsg style="display:none;cursor:pointer;position:absolute;left:30px;top:45px;color:yellow;background-color:rgba(0,0,0,0.6);padding:10px;border-radius:5px" onclick=p12clearConsoleMsg()></div>
629
- </div>
630
- </div>
631
- <div id=p13 style="display:none">
632
- <div id="p13title">
633
- <div id="p13BackButton" style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
634
- <h1>Files - <span id=p13deviceName></span></h1>
635
- </div>
636
- <table id="p13toolbar" cellpadding="0" cellspacing="0">
637
- <tr>
638
- <td class="areaHead">
639
- <div class="toright2">
640
- <input id="filesActionsBtn" type=button title="Perform power actions on the device" value=Actions onclick=deviceActionFunction() />
641
- <div id="filesRecordIcon" class='deskareaicon' title="Server is recording this session" style="display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px;margin-left:5px"></div>
642
- </div>
643
- <div>
644
- <input id=p13AutoConnect value="AutoConnect" onclick=autoConnectFiles(event) type="button" style="display:none" />
645
- <input id=p13Connect value="Connect" onclick=connectFiles(event) type="button" />
646
- <span id=p13Status>Disconnected</span>
647
- </div>
648
- </td>
649
- </tr>
650
- <tr>
651
- <td class="areaHead2" valign=bottom>
652
- <div id="p13rightOfButtons" class="toright2"></div>
653
- <div>
654
- <input type=button id=p13FolderUp disabled="disabled" onclick="p13folderup()" value="Up" />
655
- <input type=button id=p13SelectAllButton disabled="disabled" onclick="p13selectallfile()" value="Select All" />
656
- <input type=button id=p13RenameFileButton disabled="disabled" value="Rename" onclick="p13renamefile()" />
657
- <input type=button id=p13DeleteFileButton disabled="disabled" value="Delete" onclick="p13deletefile()" />
658
- <input type=button id=p13ViewFileButton disabled="disabled" value="Edit" onclick="p13viewfile()" />
659
- <input type=button id=p13NewFolderButton disabled="disabled" value="New Folder" onclick="p13createfolder()" />
660
- <input type=button id=p13UploadButton disabled="disabled" value="Upload" onclick="p13uploadFile()" />
661
- <input type=button id=p13CutButton disabled="disabled" value="Cut" onclick="p13copyFile(1)" />
662
- <input type=button id=p13CopyButton disabled="disabled" value="Copy" onclick="p13copyFile(0)" />
663
- <input type=button id=p13PasteButton disabled="disabled" value="Paste" onclick="p13pasteFile()" />
664
- <input type=button id=p13RefreshButton disabled="disabled" value="Refresh" onclick="p13folderup(9999)" />
665
- </div>
666
- </td>
667
- </tr>
668
- <tr>
669
- <td class="areaHead3">
670
- <div class="toright2">
671
- <select id=p13sortdropdown onchange=p13updateFiles()>
672
- <option value=1 selected="selected">Sort by name</option>
673
- <option value=2>Sort by size</option>
674
- <option value=3>Sort by date</option>
675
- <option value=4>Descend by name</option>
676
- <option value=5>Descend by size</option>
677
- <option value=6>Descend by date</option>
678
- </select>
679
- </div>
680
- <div> <span id="p13currentpath"></span></div>
681
- </td>
682
- </tr>
683
- </table>
684
- <div id=p13FilesConsoleMsg style="display:none;cursor:pointer;position:absolute;left:30px;top:165px;color:yellow;background-color:rgba(0,0,0,0.6);padding:10px;border-radius:5px" onclick=p13clearConsoleMsg()></div>
685
- <div id="p13filetable" style="">
686
- <div id="p13bigok" style="display:none"><b>✓</b></div>
687
- <div id="p13bigfail" style="display:none"><b>✗</b></div>
688
- <span id="p13files"></span>
689
- </div>
690
- <table id="p13toolbarBottom" cellpadding=0 cellspacing=0>
691
- <tr><td class=style6> <span id="p13bottomstatus"></span></td></tr>
692
- </table>
693
- </div>
694
- <div id=p14 style="display:none">
695
- <div id="p14title">
696
- <div id="p14BackButton" style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
697
- <div id="devListToolbarViewIcons"><div class="viewSelector" onclick=deskToggleFull(event) title="Full Screen. Hold shift to browser full screen."><div class="viewSelector5"></div></div></div>
698
- <h1>Intel® AMT - <span id=p14deviceName></span></h1>
699
- </div>
700
- <iframe id=p14iframe src="{{{domainurl}}}commander.htm"></iframe>
701
- </div>
702
- <div id=p15 style="display:none">
703
- <div id="p15title">
704
- <div id="p15BackButton" style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
705
- <h1><span id=p15deviceName></span></h1>
706
- </div>
707
- <table id="consoleTable" cellpadding=0 cellspacing=0>
708
- <tr>
709
- <td class="areaHead">
710
- <div class="toright2">
711
- <div id=p15coreName title="Information about current core running on this agent"></div>
712
- <input type=button id=p15uploadCore value="Agent Action" onclick=p15uploadCore(event) title="Change the agent Java Script code module" />
713
- <img onclick=p15downloadConsoleText() style="cursor:pointer;margin-top:6px" title="Download console text" src="images/link4.png" />
714
- </div>
715
- <div id="p15statetext"></div>
716
- </td>
717
- </tr>
718
- <tr>
719
- <td>
720
- <div class="areaProgress"><div id="consoleprogressbar" style=""></div></div>
721
- </td>
722
- </tr>
723
- <tr>
724
- <td id=p15agentConsole>
725
- <pre id=p15agentConsoleText></pre>
726
- </td>
727
- </tr>
728
- <tr>
729
- <td class="areaFoot">
730
- <table style="width:100%">
731
- <tr>
732
- <td style="width:99%">
733
- <input id=p15consoleText style=width:100% onkeyup=p15consoleSend(event) onfocus=onConsoleFocus(1) onblur=onConsoleFocus(0) />
734
- </td>
735
- <td> </td>
736
- <td id="p15outputselecttd">
737
- <select id=p15outputselect>
738
- <option value=1>Agent</option>
739
- <option value=2>MQTT</option>
740
- </select>
741
- </td>
742
- <td style="width:1%"><input id="id_p15consoleClear" type="button" class="bottombutton" value="Clear" onclick="p15consoleClear()" /></td>
743
- </tr>
744
- </table>
745
- </td>
746
- </tr>
747
- </table>
748
- </div>
749
- <div id=p16 style="display:none">
750
- <div id="p16title">
751
- <div id="p16BackButton" style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
752
- <h1>Events - <span id=p16deviceName></span></h1>
753
- </div>
754
- <table class="pTable">
755
- <tr>
756
- <td class="h1"></td>
757
- <!--<td> <input type=button onclick=refreshDeviceEvents() value="Refresh" /></td>-->
758
- <td class="auto-style1">
759
- Show
760
- <select id=p16limitdropdown onchange=refreshDeviceEvents()>
761
- <option value=60>Last 60</option>
762
- <option value=120>Last 120</option>
763
- <option value=250>Last 250</option>
764
- <option value=500>Last 500</option>
765
- <option value=1000>Last 1000</option>
766
- </select>
767
- <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Download Events" style=cursor:pointer></a>
768
- </td>
769
- <td class="h2"></td>
770
- </tr>
771
- </table>
772
- <div id=p16events></div>
773
- </div>
774
- <div id=p17 style="display:none">
775
- <div id="p17title">
776
- <div id="p17BackButton" style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
777
- <h1>Details - <span id=p17deviceName></span></h1>
778
- </div>
779
- <div id=p17info></div>
780
- </div>
781
- <div id=p20 style="display:none">
782
- <picture id=MainMeshImage style=border-width:0px;height:200px;width:200px;float:right>
783
- <source type="image/webp" width=200 height=200 srcset="images/webp/mesh-256.webp" />
784
- <img alt="" width=200 height=200 src=images/mesh-256.png />
785
- </picture>
786
- <div style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
787
- <h1>General - <span id=p20meshName></span></h1>
788
- <p id=p20info></p>
789
- </div>
790
- <div id=p30 style="display:none">
791
- <table style="width:100%" cellpadding="0" cellspacing="0">
792
- <tr>
793
- <td style=width:auto valign=top>
794
- <div id="p30title">
795
- <div style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
796
- <h1>General - <span id=p30userName></span></h1>
797
- </div>
798
- <div id=p30html></div>
799
- </td>
800
- <td style=width:20px></td>
801
- <td style=width:200px>
802
- <picture id=MainUserImage style=border-width:0px;height:200px;width:200px;float:right>
803
- <source type="image/webp" width=200 height=200 srcset="images/webp/user-256.webp" />
804
- <img alt="" width=200 height=200 src=images/user-256.png />
805
- </picture>
806
- <div style="width:100%;text-align:center"><strong><span id=MainUserState></span></strong></div>
807
- </td>
808
- </tr>
809
- </table><br />
810
- <div id=p30html2></div>
811
- <div id=p30html3></div>
812
- </div>
813
- <div id=p31 style="display:none">
814
- <div style="float:left"><div class="backButton" tabindex=0 onclick=goBack() title="Back" onkeypress="if (event.key == 'Enter') goBack()"><div class="backButtonEx"></div></div></div>
815
- <h1>Events - <span id=p31userName></span></h1>
816
- <table class="pTable">
817
- <tr>
818
- <td class="h1"></td>
819
- <!--<td> <input type=button onclick=refreshUsersEvents() value="Refresh" /></td>-->
820
- <td class="auto-style1">
821
- Show
822
- <select id=p31limitdropdown onchange=refreshUsersEvents()>
823
- <option value=60>Last 60</option>
824
- <option value=120>Last 120</option>
825
- <option value=250>Last 250</option>
826
- <option value=500>Last 500</option>
827
- <option value=1000>Last 1000</option>
828
- </select>
829
- <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Download Events" style=cursor:pointer></a>
830
- </td>
831
- <td class="h2"></td>
832
- </tr>
833
- </table>
834
- <div id=p31events style=""></div>
835
- </div>
836
- <div id=p40 style="display:none">
837
- <h1>My Server Stats</h1>
838
- <div class="areaHead">
839
- <div class="toright2">
840
- <select id=p40type onchange=updateServerTimelineStats()>
841
- <option value=0>Connections</option>
842
- <option value=1>Memory</option>
843
- </select>
844
- <select id=p40time onchange=updateServerTimelineHours()>
845
- <option value=3>Last 3 hours</option>
846
- <option value=8>Last 8 hours</option>
847
- <option value=24>Last day</option>
848
- <option value=168>Last week</option>
849
- <option value=720>Last 30 days</option>
850
- </select>
851
- <img src=images/link4.png height=10 width=10 title="Download data points (.csv)" style=cursor:pointer onclick=p40downloadEvents()>
852
- </div>
853
- <div>
854
- <input value="Refresh" type="button" onclick="refreshServerTimelineStats()" />
855
- <label><input id=p40log type="checkbox" onclick="updateServerTimelineHours()" />Log-X</label>
856
- </div>
857
- </div>
858
- <canvas id=serverMainStats style=""></canvas>
859
- </div>
860
- <div id=p41 style="display:none">
861
- <h1>My Server Tracing</h1>
862
- <div class="areaHead">
863
- <div class="toright2">
864
- Show
865
- <select id=p41limitdropdown onchange=displayServerTrace()>
866
- <option value=100>Last 100</option>
867
- <option value=250>Last 250</option>
868
- <option value=500>Last 500</option>
869
- <option value=1000>Last 1000</option>
870
- </select>
871
- <input value="Clear" type="button" onclick="clearServerTracing()" />
872
- <img src=images/link4.png height=10 width=10 title="Download trace (.csv)" style=cursor:pointer onclick=p41downloadServerTrace()>
873
- </div>
874
- <div>
875
- <input value="Tracing" type="button" onclick="setServerTracing()" />
876
- <span id="p41traceStatus">None</span>
877
- </div>
878
- </div>
879
- <div id=p41events style=""></div>
880
- </div>
881
- <div id=p19 style="display:none">
882
- <h1>Plugins - <span id=p19deviceName></span></h1>
883
- <style>
884
- #p19headers {
885
- padding-right: 7px;
886
- padding-bottom: 10px;
887
- font-weight: bold;
888
- border-bottom: 1px dotted blue;
889
- }
890
-
891
- #p19headers > span:nth-child(n+2) {
892
- border-left: 1px solid black;
893
- }
894
-
895
- #p19headers > span {
896
- padding-left: 4px;
897
- padding-right: 4px;
898
- }
899
- </style>
900
- <div id="p19headers"></div>
901
- <div id=p19pages></div>
902
- </div>
903
- <br id="column_l_bottomgap" />
904
- </div>
905
- <div id="footer">
906
- <div class="footer1">{{{footer}}}</div>
907
- <div class="footer2">
908
- <a id="verifyEmailId2" style="display:none" href=# onclick="account_showVerifyEmail()">Verify Email</a>
909
- <a href=terms>Terms & Privacy</a>
910
- </div>
911
- </div>
912
- <div id=dialog class="noselect" style="display:none">
913
- <div id=dialogHeader>
914
- <div tabindex=0 id=id_dialogclose onclick=setDialogMode() onkeypress="if (event.key == 'Enter') setDialogMode()">✖</div>
915
- <div id=id_dialogtitle></div>
916
- </div>
917
- <div id=dialogBody>
918
- <div id=dialog1>
919
- <div id=id_dialogMessage style=""></div>
920
- </div>
921
- <div id=dialog2 style="">
922
- <div id=id_dialogOptions></div>
923
- </div>
924
- <div id=dialog3 style="">
925
- <div id=d3upload>
926
- <div>File Selection</div>
927
- <select id=d3uploadMode onchange=d3modechange()>
928
- <option value=1>Local file upload</option>
929
- <option value=2>Server file selection</option>
930
- </select>
931
- </div>
932
- <div id=d3localmode style="display:none">
933
- <div>Upload File</div>
934
- <form id=d3localmodeform method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame>
935
- <input type=text id=d3auth name=auth style="display:none" />
936
- <input type=text id=d3attrib name=attrib style="display:none" />
937
- <input type=file id=d3localFile name=files onchange=d3setActions() />
938
- <input type=submit id=d3submit style="display:none" />
939
- </form>
940
- </div>
941
- <div id=d3servermode>
942
- <div id=d3serveraction valign=bottom>
943
- <input type=button id=p3FolderUp disabled="disabled" onclick=d3folderup() value="Up" />
944
- </div>
945
- <div id=d3serverfiles></div>
946
- </div>
947
- </div>
948
- <div id=dialog7 style="">
949
- <div id="d7meshkvm">
950
- <h4>Agent Remote Desktop</h4>
951
- <div>
952
- <div>Quality</div>
953
- <select id="d7bitmapquality" dir="rtl"></select>
954
- </div>
955
- <div>
956
- <div>Scaling</div>
957
- <select id="d7bitmapscaling" style="" dir="rtl">
958
- <option selected=selected value=1024>100%</option>
959
- <option value=896>87.5%</option>
960
- <option value=768>75%</option>
961
- <option value=640>62.5%</option>
962
- <option value=512>50%</option>
963
- <option value=384>37.5%</option>
964
- <option value=256>25%</option>
965
- <option value=128>12.5%</option>
966
- </select>
967
- </div>
968
- <div>
969
- <div>Frame rate</div>
970
- <select id="d7framelimiter" dir="rtl">
971
- <option selected=selected value=50>Fast</option>
972
- <option value=100>Medium</option>
973
- <option value=400>Slow</option>
974
- <option value=1000>Very slow</option>
975
- </select>
976
- </div>
977
- </div>
978
- <div id="d7amtkvm">
979
- <h4>Intel® AMT Hardware KVM</h4>
980
- <div>
981
- <div>Image Encoding</div>
982
- <select id="d7desktopmode">
983
- <option value="1">RLE8, Fastest</option>
984
- <option value="2">RLE16, Recommended</option>
985
- <option value="3">RAW8, Slow</option>
986
- <option value="4">RAW16, Very Slow</option>
987
- </select>
988
- </div>
989
- <div>
990
- <div>Other Settings</div>
991
- <div id="d7otherset" style="display:block">
992
- <label style="display:block"><input type="checkbox" id="d7showfocus" />Show Focus Tool</label>
993
- <label style="display:block"><input type="checkbox" id="d7showcursor" />Show Local Mouse Cursor</label>
994
- <label style="display:block"><input type="checkbox" id="d7localKeyMap" />Local Keyboard Map</label>
995
- </div>
996
- </div>
997
- </div>
998
- </div>
999
- </div>
1000
- <div id="idx_dlgButtonBar">
1001
- <input id="idx_dlgCancelButton" type="button" value="Cancel" style="" onclick="dialogclose(0)" />
1002
- <input id="idx_dlgOkButton" type="button" value="OK" style="" onclick="dialogclose(1)" />
1003
- <div><input id="idx_dlgDeleteButton" type="button" value="Delete" style="display:none" onclick="dialogclose(2)" /></div>
1004
- </div>
1005
- </div>
1006
- <iframe name="fileUploadFrame" style="display:none"></iframe>
1007
- <form style="display:none" method=post action=uploadfile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p5fileDragName name="name" /><input id=p5fileDragAuthCookie name="auth" /><input id=p5fileDragSize name="size" /><input id=p5fileDragType name="type" /><input id=p5fileDragData name="data" /><input id=p5fileDragLink name="link" /><input type=submit id=p5loginSubmit2 style="display:none" /></form>
1008
- <form style="display:none" method=post action=uploadnodefile.ashx enctype=multipart/form-data target=fileUploadFrame><input id=p13fileDragName name="name" /><input id=p13fileDragSize name="size" /><input id=p13fileDragType name="type" /><input id=p13fileDragData name="data" /><input id=p13fileDragLink name="link" /><input type=submit id=p13loginSubmit2 style="display:none" /></form>
1009
- <audio id="chimes"><source src="sounds/chimes.mp3" type="audio/mp3" /></audio>
1010
- </div>
1011
- <script type="text/javascript">
1012
- 'use strict';
1013
-
1014
- // Process server-side web state
1015
- var webState = '{{{webstate}}}';
1016
- if (webState != '') { webState = JSON.parse(decodeURIComponent(webState)); }
1017
- for (var i in webState) { localStorage.setItem(i, webState[i]); }
1018
- if (!webState.loctag) { delete localStorage.removeItem('loctag'); }
1019
-
1020
- var args;
1021
- var autoReconnect = true;
1022
- var powerStatetable = ['', "Powered", "Sleep", "Sleep", "Sleep", "Hibernating", "Power off", "Present"];
1023
- var StatusStrs = ["Disconnected", "Connecting...", "Setup...", "Connected", "Intel® AMT Connected"];
1024
- var sort = 0;
1025
- var searchFocus = 0;
1026
- var mapSearchFocus = 0;
1027
- var userSearchFocus = 0;
1028
- var consoleFocus = 0;
1029
- var showRealNames = false;
1030
- var meshserver = null;
1031
- var meshes = {};
1032
- var meshcount = 0;
1033
- var nodes = null;
1034
- var filetree = {};
1035
- var userinfo = null;
1036
- var serverinfo = null;
1037
- var events = [];
1038
- var users = null;
1039
- var wssessions = null;
1040
- var nodeShortIdent = 0;
1041
- var desktop;
1042
- var desktopsettings = { encoding: 2, showfocus: false, showmouse: true, showcad: true, quality: 40, scaling: 1024, framerate: 50, localkeymap: false };
1043
- var multidesktopsettings = { quality: 20, scaling: 128, framerate: 1000 };
1044
- var terminal;
1045
- var files;
1046
- var debugLevel = parseInt('{{{debuglevel}}}');
1047
- var features = parseInt('{{{features}}}');
1048
- var sessionTime = parseInt('{{{sessiontime}}}');
1049
- var domain = '{{{domain}}}';
1050
- var domainUrl = '{{{domainurl}}}';
1051
- var authCookie = '{{{authCookie}}}';
1052
- var authRelayCookie = '{{{authRelayCookie}}}';
1053
- var authCookieRenewTimer = null;
1054
- var multiDesktop = {};
1055
- var multiDesktopFilter = null;
1056
- var serverPublicNamePort = '{{{serverDnsName}}}:{{{serverPublicPort}}}';
1057
- var amtScanResults = null;
1058
- var debugmode = 0;
1059
- var clickOnce = (((features & 256) != 0) && detectClickOnce());
1060
- var attemptWebRTC = ((features & 128) != 0);
1061
- var passRequirements = '{{{passRequirements}}}';
1062
- if (passRequirements != '') { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); }
1063
- var deskAspectRatio = 0;
1064
- try { deskAspectRatio = parseInt(getstore('deskAspectRatio', '0')); } catch (ex) { }
1065
- var uiMode = parseInt(getstore('uiMode', 1));
1066
- var webPageStackMenu = false;
1067
- var webPageFullScreen = true;
1068
- var nightMode = (getstore('_nightMode', '0') == '1');
1069
- var sessionActivity = Date.now();
1070
- var updateSessionTimer = null;
1071
- var pluginHandlerBuilder = {{{pluginHandler}}};
1072
- var pluginHandler = null;
1073
- if (pluginHandlerBuilder != null) { pluginHandler = new pluginHandlerBuilder(); }
1074
- var installedPluginList = null;
1075
-
1076
- // Console Message Display Timers
1077
- var p11DeskConsoleMsgTimer = null;
1078
- var p12TermConsoleMsgTimer = null;
1079
- var p13FilesConsoleMsgTimer = null;
1080
-
1081
- function startup() {
1082
- if ((features & 32) == 0) {
1083
- // Guard against other site's top frames (web bugs).
1084
- var loc = null;
1085
- try { loc = top.location.toString().toLowerCase(); } catch (e) { }
1086
- if (top != self && (loc == null || top.active == false)) { top.location = self.location; return; }
1087
- }
1088
-
1089
- // Check if we are in debug mode
1090
- args = parseUriArgs();
1091
- if (!args.locale) { var x = getstore('loctag', 0); if ((x != null) && (x != '*')) { args.locale = x; } }
1092
- debugmode = args.debug;
1093
- if (args.webrtc != null) { attemptWebRTC = (args.webrtc == 1); }
1094
- QV('p13AutoConnect', debugmode); // Files
1095
- QV('autoconnectbutton2', debugmode); // Terminal
1096
- QV('autoconnectbutton1', debugmode); // Desktop
1097
- //QV('DeskClip', debugmode); // Clipboard feature, not completed so show in in debug mode only.
1098
-
1099
- if (nightMode) { QC('body').add('night'); }
1100
- toggleFullScreen();
1101
-
1102
- // Setup page visuals
1103
- if (args.hide) {
1104
- var hide = parseInt(args.hide);
1105
- QV('masthead', !(hide & 1));
1106
- QV('topbar', !(hide & 2));
1107
- QV('footer', !(hide & 4));
1108
- QV('p10title', !(hide & 8));
1109
- QV('p11title', !(hide & 8));
1110
- QV('p12title', !(hide & 8));
1111
- QV('p13title', !(hide & 8));
1112
- QV('p14title', !(hide & 8));
1113
- QV('p15title', !(hide & 8));
1114
- QV('p16title', !(hide & 8));
1115
- //if (hide & 16) {
1116
- // QV('page_leftbar', false);
1117
- // QS('page_content').left = '0px';
1118
- //}
1119
-
1120
- // Fix the main grid to zero-height elements we want to hide.
1121
- QS('container')['grid-template-rows'] = ((hide & 1) ? '0' : '66') + 'px ' + ((hide & 2) ? '0' : '24') + 'px auto ' + ((hide & 4) ? '0' : '45') + 'px';
1122
- QS('container')['-ms-grid-rows'] = ((hide & 1) ? '0' : '66') + 'px ' + ((hide & 2) ? '0' : '24') + 'px auto ' + ((hide & 4) ? '0' : '45') + 'px';
1123
-
1124
- // Adjust height of remote desktop, files and Intel AMT
1125
- var xh = (((hide & 1) ? 0 : 66) + ((hide & 2) ? 0 : 24) + ((hide & 4) ? 0 : 45) + ((hide & 8) ? 0 : 60)); // 0 to 195
1126
- QS('p3users')['max-height'] = 'calc(100vh - ' + (124 + xh) + 'px)';
1127
- QS('p3events')['height'] = 'calc(100vh - ' + (124 + xh) + 'px)';
1128
- QS('deskarea3x')['height'] = 'calc(100vh - ' + (75 + xh) + 'px)';
1129
- QS('deskarea3x')['max-height'] = 'calc(100vh - ' + (75 + xh) + 'px)';
1130
- QS('p5filetable')['height'] = 'calc(100vh - ' + (160 + xh) + 'px)';
1131
- QS('p13filetable')['height'] = 'calc(100vh - ' + (124 + xh) + 'px)';
1132
- QS('serverMainStats')['height'] = 'calc(100vh - ' + (110 + xh) + 'px)';
1133
- QS('serverMainStats')['max-height'] = 'calc(100vh - ' + (110 + xh) + 'px)';
1134
- QS('xdevices')['max-height'] = 'calc(100vh - ' + (124 + xh) + 'px)';
1135
- QS('xdevicesmap')['max-height'] = 'calc(100vh - ' + (124 + xh) + 'px)';
1136
- QS('p15agentConsole')['height'] = 'calc(100vh - ' + (84 + xh) + 'px)';
1137
- QS('p15agentConsole')['max-height'] = 'calc(100vh - ' + (84 + xh) + 'px)';
1138
- QS('p15agentConsoleText')['height'] = 'calc(100vh - ' + (81 + xh) + 'px)';
1139
- QS('p15agentConsoleText')['max-height'] = 'calc(100vh - ' + (81 + xh) + 'px)';
1140
- }
1141
-
1142
- // We are looking at a single device, remove all the back buttons
1143
- if ('{{currentNode}}' != '') {
1144
- QV('p10BackButton', false);
1145
- QV('p11BackButton', false);
1146
- QV('p12BackButton', false);
1147
- QV('p13BackButton', false);
1148
- QV('p14BackButton', false);
1149
- QV('p15BackButton', false);
1150
- QV('p16BackButton', false);
1151
- }
1152
- p1updateInfo();
1153
-
1154
- // Setup the context menu
1155
- document.onclick = function (e) { hideContextMenu(); }
1156
- document.onkeypress = ondockeypress;
1157
- document.onkeydown = ondockeydown;
1158
- document.onkeyup = ondockeyup;
1159
- //window.addEventListener('focus', ondocfocus, false);
1160
- window.addEventListener('blur', ondocblur, false);
1161
- window.onresize = function () { masterUpdate(512); }
1162
- setTimeout(function() { masterUpdate(512); }, 200);
1163
-
1164
- // Connect to the mesh server
1165
- meshserver = MeshServerCreateControl(domainUrl, authCookie);
1166
- meshserver.onStateChanged = onStateChanged;
1167
- meshserver.onMessage = onMessage;
1168
- meshserver.trace = (args.trace == 1);
1169
- meshserver.Start();
1170
-
1171
- // Setup page controls
1172
- Q('sortselect').selectedIndex = sort = getstore('sort', 0);
1173
- Q('sizeselect').selectedIndex = getstore('_viewsize', 1);
1174
- Q('SearchInput').value = getstore('_search', '');
1175
- showRealNames = (getstore('showRealNames', 0) == 1);
1176
- Q('RealNameCheckBox').checked = showRealNames;
1177
- Q('viewselect').value = getstore('_deviceView', 1);
1178
- Q('DeskControl').checked = (getstore('DeskControl', 1) == 1);
1179
- QV('accountChangeEmailAddressSpan', (features & 0x200000) == 0);
1180
-
1181
- // Display the page devices
1182
- masterUpdate(3)
1183
- for (var j = 1; j < 5; j++) { Q('devViewButton' + j).classList.remove('viewSelectorSel'); }
1184
- Q('devViewButton' + Q('viewselect').value).classList.add('viewSelectorSel');
1185
-
1186
- // Setup upload drag & drop
1187
- Q('p5filetable').addEventListener('drop', p5fileDragDrop, false);
1188
- Q('p5filetable').addEventListener('dragover', p5fileDragOver, false);
1189
- Q('p5filetable').addEventListener('dragleave', p5fileDragLeave, false);
1190
- //Q('p5fileCatchAllInput').addEventListener('drop', p5fileDragDrop, false);
1191
- //Q('p5fileCatchAllInput').addEventListener('dragover', p5fileDragOver, false);
1192
- //Q('p5fileCatchAllInput').addEventListener('dragleave', p5fileDragLeave, false);
1193
-
1194
- // Setup upload drag & drop
1195
- Q('p13filetable').addEventListener('drop', p13fileDragDrop, false);
1196
- Q('p13filetable').addEventListener('dragover', p13fileDragOver, false);
1197
- Q('p13filetable').addEventListener('dragleave', p13fileDragLeave, false);
1198
-
1199
- // Timeline update interval
1200
- setInterval(updateDeviceTimeline, 120000); // Check every 2 minutes
1201
-
1202
- // Load desktop settings
1203
- var t = localStorage.getItem('desktopsettings');
1204
- if (t != null) { desktopsettings = JSON.parse(t); }
1205
- t = localStorage.getItem('multidesktopsettings');
1206
- if (t != null) { multidesktopsettings = JSON.parse(t); }
1207
- applyDesktopSettings();
1208
-
1209
- // Terminal special keys
1210
- var x = '';
1211
- for (var c = 1; c < 27; c++) x += '<option value=\'' + c + '\'>' + "Ctrl" + '-' + String.fromCharCode(64 + c) + ' (' + c + ')</option>';
1212
- QH('specialkeylist', x);
1213
-
1214
- // Setup server stats panels
1215
- setupGeneralServerStats();
1216
- setupServerTimelineStats();
1217
-
1218
- // Setup the user interface in the right mode
1219
- userInterfaceSelectMenu();
1220
-
1221
- // If SSPI or LDAP authentication not used, allow batch account creation.
1222
- QV('p4UserBatchCreate', (features & 0x00080000) == 0);
1223
- }
1224
-
1225
- // Toggle the web page to full screen
1226
- function toggleAspectRatio(toggle) {
1227
- if (toggle === 1) { deskAspectRatio = ((deskAspectRatio + 1) % 3); putstore('deskAspectRatio', deskAspectRatio); }
1228
- deskAdjust();
1229
- }
1230
-
1231
- // If FullScreen, toggle menu to be horisontal or vertical
1232
- function toggleStackMenu(toggle) {
1233
- if (webPageFullScreen == true) {
1234
- if (toggle === 1) {
1235
- webPageStackMenu = !webPageStackMenu;
1236
- putstore('webPageStackMenu', webPageStackMenu);
1237
- }
1238
- if (webPageStackMenu == false) {
1239
- QC('body').remove('menu_stack');
1240
- } else {
1241
- QC('body').add('menu_stack');
1242
- if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
1243
- }
1244
- deskAdjust();
1245
- }
1246
- }
1247
-
1248
- // Toggle user interface menu
1249
- function showUserInterfaceSelectMenu() {
1250
- Q('uiViewButton1').classList.remove('uiSelectorSel');
1251
- Q('uiViewButton2').classList.remove('uiSelectorSel');
1252
- Q('uiViewButton3').classList.remove('uiSelectorSel');
1253
- Q('uiViewButton4').classList.remove('uiSelectorSel');
1254
- try { Q('uiViewButton' + uiMode).classList.add('uiSelectorSel'); } catch (ex) { }
1255
- QV('uiMenu', (QS('uiMenu').display == 'none'));
1256
- //Q('uiViewButton1').focus();
1257
- if (nightMode) { Q('uiViewButton4').classList.add('uiSelectorSel'); }
1258
- }
1259
-
1260
- function userInterfaceSelectMenu(s) {
1261
- if (s) { uiMode = s; putstore('uiMode', uiMode); }
1262
- webPageFullScreen = (uiMode < 3);
1263
- webPageStackMenu = (uiMode > 1);
1264
- toggleFullScreen(0);
1265
- toggleStackMenu(0);
1266
- if (webPageStackMenu && (xxcurrentView >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
1267
- }
1268
-
1269
- function toggleNightMode() {
1270
- nightMode = !nightMode;
1271
- if (nightMode) { QC('body').add('night'); } else { QC('body').remove('night'); }
1272
- putstore('_nightMode', nightMode?'1':'0');
1273
- }
1274
-
1275
- // Toggle the web page to full screen
1276
- function toggleFullScreen(toggle) {
1277
- if (toggle === 1) { webPageFullScreen = !webPageFullScreen; putstore('webPageFullScreen', webPageFullScreen); }
1278
- var hide = 0;
1279
- if (args.hide) { hide = parseInt(args.hide); }
1280
- if (webPageFullScreen == false) {
1281
- QC('body').remove('menu_stack');
1282
- QC('body').remove('fullscreen');
1283
- QC('body').remove('arg_hide');
1284
- if (xxcurrentView >= 10) QC('column_l').add('room4submenu');
1285
- QV('UserDummyMenuSpan', false);
1286
- //QV('page_leftbar', false);
1287
- } else {
1288
- QC('body').add('fullscreen');
1289
- if (hide & 16) QC('body').add('arg_hide'); // This is replacement for QV('page_leftbar', !(hide & 16));
1290
- QV('page_leftbar', !(hide & 16));
1291
- QV('MainMenuSpan', !(hide & 16));
1292
- if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
1293
- QV('UserDummyMenuSpan', (xxcurrentView < 10) && webPageFullScreen);
1294
- }
1295
- masterUpdate(512);
1296
- QV('body', true);
1297
- }
1298
-
1299
- function getNodeFromId(id) { if (nodes != null) { for (var i in nodes) { if (nodes[i]._id == id) return nodes[i]; } } return null; }
1300
- function reload() {
1301
- var x = window.location.href;
1302
- if (x.endsWith('/#')) { x = x.substring(0, x.length - 2); }
1303
- window.location.href = x;
1304
- }
1305
-
1306
- function onStateChanged(server, state, prevState, errorCode) {
1307
- if (state == 0) {
1308
- // Control web socket disconnected
1309
- setDialogMode(0); // Close any dialog boxes if present
1310
- go(0); // Go to disconnection panel
1311
-
1312
- // Clean up
1313
- powerTimeline = null;
1314
- powerTimelineReq = null;
1315
- powerTimelineNode = null;
1316
- powerTimelineUpdate = null;
1317
- deleteAllNotifications(); // Close and clear notifications if present
1318
- hideContextMenu(); // Hide the context menu if present
1319
- QV('verifyEmailId2', false);
1320
- QV('logoutControl', false);
1321
- if (errorCode == 'noauth') { QH('p0span', "Unable to perform authentication"); return; }
1322
- if (prevState == 2) { if (autoReconnect) { setTimeout(serverPoll, 5000); } } else { QH('p0span', "Unable to connect web socket"); }
1323
- if (authCookieRenewTimer != null) { clearInterval(authCookieRenewTimer); authCookieRenewTimer = null; }
1324
- } else if (state == 2) {
1325
- // Fetch list of meshes, nodes, files
1326
- meshserver.send({ action: 'meshes' });
1327
- meshserver.send({ action: 'nodes', id: '{{currentNode}}' });
1328
- if (pluginHandler != null) { meshserver.send({ action: 'plugins' }); }
1329
- if ('{{currentNode}}' == '') { meshserver.send({ action: 'files' }); }
1330
- if ('{{viewmode}}' == '') { go(1); }
1331
- authCookieRenewTimer = setInterval(function () { meshserver.send({ action: 'authcookie' }); }, 1800000); // Request a cookie refresh every 30 minutes.
1332
- }
1333
- }
1334
-
1335
- // Poll the server, if it responds, refresh the page.
1336
- function serverPoll() {
1337
- var xdr = null;
1338
- try { xdr = new XDomainRequest(); } catch (e) { }
1339
- if (!xdr) xdr = new XMLHttpRequest();
1340
- xdr.open('HEAD', window.location.href);
1341
- xdr.timeout = 15000;
1342
- xdr.onload = function () { reload(); };
1343
- xdr.onerror = xdr.ontimeout = function () { setTimeout(serverPoll, 10000); };
1344
- xdr.send();
1345
- }
1346
-
1347
- // Return true if this browser supports clickonce
1348
- function detectClickOnce() {
1349
- for (var i in window.navigator.mimeTypes) { if (window.navigator.mimeTypes[i].type == 'application/x-ms-application') { return true; } }
1350
- var userAgent = window.navigator.userAgent.toUpperCase();
1351
- return (userAgent.indexOf('.NET CLR 3.5') >= 0) || (userAgent.indexOf('(WINDOWS NT ') >= 0);
1352
- }
1353
-
1354
- function updateSiteAdmin() {
1355
- var noServerBackup = '{{{noServerBackup}}}';
1356
- var siteRights = userinfo.siteadmin;
1357
- if (noServerBackup == 1) { siteRights &= 0xFFFFFFFA; } // If not server backups allowed, remove server backup and restore permissions
1358
-
1359
- // Update account actions
1360
- QV('p2AccountSecurity', ((features & 4) == 0) && (serverinfo.domainauth == false) && ((features & 4096) != 0)); // Hide Account Security if in single user mode, domain authentication to 2 factor auth not supported.
1361
- QV('p2AccountActions', ((features & 4) == 0) && (serverinfo.domainauth == false)); // Hide Account Actions if in single user mode or domain authentication
1362
- QV('p2AccountImage', ((features & 4) == 0) && (serverinfo.domainauth == false)); // If account actions are not visible, also remove the image on that panel
1363
- QV('p2ServerActions', siteRights & 21);
1364
- QV('LeftMenuMyServer', siteRights & 21); // 16 + 4 + 1
1365
- QV('MainMenuMyServer', siteRights & 21);
1366
- QV('p2ServerActionsBackup', siteRights & 1);
1367
- QV('p2ServerActionsRestore', siteRights & 4);
1368
- QV('p2ServerActionsVersion', siteRights & 16);
1369
- QV('MainMenuMyFiles', siteRights & 8);
1370
- QV('LeftMenuMyFiles', siteRights & 8);
1371
- QV('MainMenuMyPlugins', ((pluginHandler != null) && (siteRights & 0xFFFFFFFF)));
1372
- //QV('LeftMenuMyPlugins', ((pluginHandler != null) && (siteRights & 0xFFFFFFFF))); // ************
1373
- if (((siteRights & 8) == 0) && (xxcurrentView == 5)) { setDialogMode(0); go(1); }
1374
- if (currentNode != null) { gotoDevice(currentNode._id, xxcurrentView, true); }
1375
-
1376
- // Update user management state
1377
- if ((userinfo.siteadmin & 2) != 0)
1378
- {
1379
- // We are user administrator
1380
- if (users == null) { meshserver.send({ action: 'users' }); }
1381
- if (wssessions == null) { meshserver.send({ action: 'wssessioncount' }); }
1382
- } else {
1383
- // We are not user administrator
1384
- users = null;
1385
- wssessions = null;
1386
- updateUsers();
1387
- if (xxcurrentView == 4 || ((xxcurrentView >= 30) && (xxcurrentView < 40))) { setDialogMode(0); go(1); currentUser = null; }
1388
- }
1389
- meshserver.send({ action: 'events', limit: parseInt(p3limitdropdown.value) });
1390
- QV('ServerConsole', userinfo.siteadmin === 0xFFFFFFFF);
1391
- QV('ServerTrace', userinfo.siteadmin === 0xFFFFFFFF);
1392
- if ((xxcurrentView == 115) && (userinfo.siteadmin != 0xFFFFFFFF)) { go(6); }
1393
- if ((xxcurrentView == 6) && ((userinfo.siteadmin & 21) == 0)) { go(1); }
1394
-
1395
- // If we are site administrator, register to get server statistics
1396
- if ((siteRights & 21) != 0) { meshserver.send({ action: 'serverstats', interval: 10000 }); }
1397
- }
1398
-
1399
- // To boost the speed of the web page when even floods occur, this method perform a delayed update on the web page.
1400
- var updateNaggleTimer = null;
1401
- var updateNaggleFlags = 0;
1402
- function masterUpdate(flags) {
1403
- updateNaggleFlags |= flags;
1404
- if (updateNaggleTimer == null) {
1405
- updateNaggleTimer = setTimeout(function () {
1406
- if (updateNaggleFlags & 512) { center(); }
1407
- if (updateNaggleFlags & 1) { onSearchInputChanged(); }
1408
- if (updateNaggleFlags & 2) { onSortSelectChange(false); }
1409
- if (updateNaggleFlags & 128) { updateMeshes(); }
1410
- if (updateNaggleFlags & 4) { updateDevices(); }
1411
- if (updateNaggleFlags & 8) { drawNotifications(); }
1412
- if (updateNaggleFlags & 16) { updateMapMarkers(); }
1413
- if (updateNaggleFlags & 32) { eventsUpdate(); }
1414
- if (updateNaggleFlags & 64) { refreshMap(false, true); }
1415
- if (updateNaggleFlags & 256) { drawDeviceTimeline(); }
1416
- if (updateNaggleFlags & 1024) { deviceEventsUpdate(); }
1417
- if (updateNaggleFlags & 2048) { userEventsUpdate(); }
1418
- if (updateNaggleFlags & 4096) { p20updateMesh(); }
1419
- updateNaggleTimer = null;
1420
- updateNaggleFlags = 0;
1421
- }, 150);
1422
- }
1423
- }
1424
-
1425
- var backupCodesWarningDone = false;
1426
- function updateSelf() {
1427
- QV('verifyEmailId', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true));
1428
- QV('verifyEmailId2', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true));
1429
- QV('manageOtp', (userinfo.otpsecret == 1) || (userinfo.otphkeys > 0));
1430
- QV('authAppSetupCheck', userinfo.otpsecret == 1);
1431
- QV('authKeySetupCheck', userinfo.otphkeys > 0);
1432
- QV('authCodesSetupCheck', userinfo.otpkeys > 0);
1433
- masterUpdate(4 + 128 + 4096);
1434
-
1435
- // Check if backup codes should really be enabled
1436
- if ((backupCodesWarningDone == false) && !(userinfo.otpkeys > 0) && (((userinfo.otpsecret == 1) && !(userinfo.otphkeys > 0)) || ((userinfo.otpsecret != 1) && (userinfo.otphkeys == 1)))) {
1437
- var n = { text: "Please add two-factor backup codes. If the current factor is lost, there is not way to recover this account.", title: "Two factor authentication" };
1438
- addNotification(n);
1439
- backupCodesWarningDone = true;
1440
- }
1441
-
1442
- // If we can't create new groups, hide all links that can do that.
1443
- var newGroupsAllowed = ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 64) == 0));
1444
- QV('p2createMeshLink1', newGroupsAllowed);
1445
- QV('p2createMeshLink2', newGroupsAllowed);
1446
- QV('getStarted1', newGroupsAllowed);
1447
- QV('getStarted2', !newGroupsAllowed);
1448
-
1449
- if (typeof userinfo.passchange == 'number') {
1450
- if (userinfo.passchange == -1) { QH('p2nextPasswordUpdateTime', " - Reset on next login."); }
1451
- else if ((passRequirements != null) && (typeof passRequirements.reset == 'number')) {
1452
- var seconds = (userinfo.passchange) + (passRequirements.reset * 86400) - Math.floor(Date.now() / 1000);
1453
- if (seconds < 0) { QH('p2nextPasswordUpdateTime', " - Reset on next login."); }
1454
- else if (seconds < 3600) { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} minute{1}.", Math.floor(seconds / 60), addLetterS(Math.floor(seconds / 60)))); }
1455
- else if (seconds < 86400) { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} hour{1}.", Math.floor(seconds / 3600), addLetterS(Math.floor(seconds / 3600)))); }
1456
- else { QH('p2nextPasswordUpdateTime', format(" - Reset in {0} day{1}."), Math.floor(seconds / 86400), addLetterS(Math.floor(seconds / 86400))); }
1457
- }
1458
- }
1459
- }
1460
-
1461
- function addLetterS(x) { return (x > 1) ? 's' : ''; }
1462
- function setSessionActivity() { sessionActivity = Date.now(); QH('idleTimeoutNotify', ''); }
1463
- function checkIdleSessionTimeout() {
1464
- var delta = (Date.now() - sessionActivity);
1465
- if (delta > serverinfo.timeout) { window.location.href = 'logout'; } else {
1466
- var ds = Math.round((serverinfo.timeout - delta) / 1000);
1467
- if (ds <= 60) {
1468
- QH('idleTimeoutNotify', '<br />' + format("{0} second{1} until disconnect", ds, addLetterS(ds)));
1469
- } else {
1470
- ds = Math.round(ds / 60);
1471
- if (ds <= 5) { QH('idleTimeoutNotify', '<br />' + format("{0} minute{1} until disconnect", ds, addLetterS(ds))); }
1472
- }
1473
- }
1474
- }
1475
-
1476
- function onMessage(server, message) {
1477
- switch (message.action) {
1478
- case 'trace': {
1479
- serverTrace.unshift(message);
1480
- displayServerTrace();
1481
- break;
1482
- }
1483
- case 'traceinfo': {
1484
- if (typeof message.traceSources == 'object') {
1485
- if ((message.traceSources != null) && (message.traceSources.length > 0)) {
1486
- serverTraceSources = message.traceSources;
1487
- QH('p41traceStatus', EscapeHtml(message.traceSources.join(', ')));
1488
- } else {
1489
- serverTraceSources = [];
1490
- QH('p41traceStatus', "None");
1491
- }
1492
- }
1493
- break;
1494
- }
1495
- case 'serverstats': {
1496
- updateGeneralServerStats(message);
1497
- break;
1498
- }
1499
- case 'servertimelinestats': {
1500
- setServerTimelineStats(message.events);
1501
- break;
1502
- }
1503
- case 'authcookie': {
1504
- // Got an authentication cookie refresh
1505
- authCookie = message.cookie;
1506
- authRelayCookie = message.rcookie;
1507
- break;
1508
- }
1509
- case 'serverinfo': {
1510
- serverinfo = message.serverinfo;
1511
- if (serverinfo.timeout) { setInterval(checkIdleSessionTimeout, 10000); checkIdleSessionTimeout(); }
1512
- if (debugmode == 1) { console.log('Server time: ', printDateTime(new Date(serverinfo.serverTime))); }
1513
- break;
1514
- }
1515
- case 'userinfo': {
1516
- userinfo = message.userinfo;
1517
- updateSiteAdmin();
1518
- updateSelf();
1519
- break;
1520
- }
1521
- case 'users': {
1522
- users = {};
1523
- for (var m in message.users) { users[message.users[m]._id] = message.users[m]; }
1524
- updateUsers();
1525
- break;
1526
- }
1527
- case 'wssessioncount': {
1528
- wssessions = message.wssessions;
1529
- updateUsers();
1530
- break;
1531
- }
1532
- case 'meshes': {
1533
- meshes = {};
1534
- for (var m in message.meshes) { meshes[message.meshes[m]._id] = message.meshes[m]; }
1535
- masterUpdate(4 + 128);
1536
- break;
1537
- }
1538
- case 'files': {
1539
- filetree = setupBackPointers(message.filetree);
1540
- updateFiles();
1541
- d3updatefiles();
1542
- break;
1543
- }
1544
- case 'nodes': {
1545
- nodes = [];
1546
- for (var m in message.nodes) {
1547
- if (!meshes[m]) { console.log('Invalid mesh (1): ' + m); continue; }
1548
- for (var n in message.nodes[m]) {
1549
- if (message.nodes[m][n]._id == null) { console.log('Invalid node (' + n + '): ' + JSON.stringify(message.nodes)); continue; }
1550
- message.nodes[m][n].namel = message.nodes[m][n].name.toLowerCase();
1551
- if (message.nodes[m][n].rname) { message.nodes[m][n].rnamel = message.nodes[m][n].rname.toLowerCase(); } else { message.nodes[m][n].rnamel = message.nodes[m][n].namel; }
1552
- message.nodes[m][n].meshnamel = meshes[m].name.toLowerCase();
1553
- message.nodes[m][n].meshid = m;
1554
- message.nodes[m][n].state = (message.nodes[m][n].state)?(message.nodes[m][n].state):0;
1555
- message.nodes[m][n].desc = message.nodes[m][n].desc;
1556
- message.nodes[m][n].ip = message.nodes[m][n].ip;
1557
- if (!message.nodes[m][n].icon) message.nodes[m][n].icon = 1;
1558
- message.nodes[m][n].ident = ++nodeShortIdent;
1559
- nodes.push(message.nodes[m][n]);
1560
- }
1561
- }
1562
- masterUpdate(1 | 2 | 4 | 64);
1563
-
1564
- if (xxcurrentView == -1) { if ('{{viewmode}}' != '') { go(parseInt('{{viewmode}}')); } else { setDialogMode(0); go(1); } }
1565
- if ('{{currentNode}}' != '') { gotoDevice('{{currentNode}}',parseInt('{{viewmode}}'));}
1566
- break;
1567
- }
1568
- case 'powertimeline': {
1569
- if (message.nodeid != powerTimelineReq) break;
1570
- powerTimelineNode = message.nodeid;
1571
- powerTimeline = message.timeline;
1572
- powerTimelineUpdate = Date.now() + 300000; // Update every 5 minutes
1573
- for (var i in powerTimeline) { if (i % 2 == 1) { powerTimeline[i] = powerTimeline[i] * 1000; } } // Decompress time
1574
- if (currentNode._id == message.nodeid) { masterUpdate(256); }
1575
- break;
1576
- }
1577
- case 'getsysinfo': {
1578
- if (message.nodeid != powerTimelineReq) break;
1579
- //console.log('getsysinfo', message); // ***********************
1580
- if (message.noinfo === true) {
1581
- QH('p17info', "No information for this device.");
1582
- } else {
1583
- var x = '', s = {};
1584
- if (message.hardware) {
1585
- if (message.hardware.identifiers) {
1586
- var ident = message.hardware.identifiers;
1587
- // BIOS
1588
- x += '<div class=DevSt style=margin-bottom:3px><b>' + "BIOS" + '</b></div>';
1589
- if (ident.bios_vendor) { x += addDetailItem("Vendor", ident.bios_vendor, s); }
1590
- if (ident.bios_version) { x += addDetailItem("Version", ident.bios_version, s); }
1591
- x += '<br />';
1592
-
1593
- // Motherboard
1594
- x += '<div class=DevSt style=margin-bottom:3px><b>' + "Motherboard" + '</b></div>';
1595
- if (ident.board_vendor) { x += addDetailItem("Vendor", ident.board_vendor, s); }
1596
- if (ident.board_name) { x += addDetailItem("Name", ident.board_name, s); }
1597
- if (ident.board_serial && (ident.board_serial != '')) { x += addDetailItem("Serial", ident.board_serial, s); }
1598
- if (ident.board_version) { x += addDetailItem("Version", ident.board_version, s); }
1599
- if (ident.product_uuid) { x += addDetailItem("Identifier", ident.product_uuid, s); }
1600
- x += '<br />';
1601
- }
1602
-
1603
- if (message.hardware.windows) {
1604
- if (message.hardware.windows.memory) {
1605
- // Memory
1606
- x += '<div class=DevSt style=margin-bottom:3px><b>' + "Memory" + '</b></div>';
1607
-
1608
- // Sort Memory
1609
- function memorySort(a, b) { if (a.BankLabel > b.BankLabel) return 1; if (a.BankLabel < b.BankLabel) return -1; return 0; }
1610
- message.hardware.windows.memory.sort(memorySort);
1611
-
1612
- x += '<table style=width:100%>';
1613
- for (var i in message.hardware.windows.memory) {
1614
- var m = message.hardware.windows.memory[i];
1615
- x += '<tr><td VALIGN=Top style=width:38px><img src="images/ram2.png" />'
1616
- x += '<td><div style=background-color:lightgray;border-radius:5px;padding:8px>';
1617
- x += '<div><b>' + m.BankLabel + '</b></div>';
1618
- if (m.Capacity) { x += addDetailItem("Capacity / Speed", format("{0} Mb, {1} Mhz", (m.Capacity / 1024 / 1024), m.Speed), s); }
1619
- if (m.PartNumber) { x += addDetailItem("Part Number", ((m.Manufacturer && m.Manufacturer != 'Undefined')?(m.Manufacturer + ', '):'') + m.PartNumber, s); }
1620
- x += '</div>';
1621
- }
1622
- x += '</table><br />';
1623
- }
1624
-
1625
- if (message.hardware.windows.osinfo) {
1626
- // Operating System
1627
- var m = message.hardware.windows.osinfo;
1628
- x += '<div class=DevSt style=margin-bottom:3px><b>' + "Operating System" + '</b></div>';
1629
- if (m.Caption) { x += addDetailItem("Name", m.Caption, s); }
1630
- if (m.Version) { x += addDetailItem("Version", m.Version, s); }
1631
- if (m.OSArchitecture) { x += addDetailItem("Architecture", m.OSArchitecture, s); }
1632
- x += '<br />';
1633
- }
1634
-
1635
- // Disks
1636
- //x += '<div class=DevSt style=margin-bottom:3px><b>Disks</b></div>';
1637
- //x += '<br />';
1638
- }
1639
- }
1640
-
1641
- QH('p17info', x);
1642
- }
1643
- break;
1644
- }
1645
- case 'lastconnect': {
1646
- var node = getNodeFromId(message.nodeid);
1647
- if (node != null) {
1648
- node.lastconnect = message.time;
1649
- node.lastaddr = message.addr;
1650
- if ((currentNode._id == node._id) && (Q('MainComputerState').innerHTML == '')) {
1651
- QH('MainComputerState', '<span>' + "Last seen:" + '<br />' + printDateTime(new Date(node.lastconnect)) + '</span>');
1652
- }
1653
- }
1654
- break;
1655
- }
1656
- case 'msg': {
1657
- // Check if this is a message from a node
1658
- if (message.nodeid != null) {
1659
- var index = -1;
1660
- if (nodes != null) { for (var i in nodes) { if (nodes[i]._id == message.nodeid) { index = i; break; } } }
1661
- if (index != -1) {
1662
- // Node was found, dispatch the message
1663
- if (message.type == 'console') { p15consoleReceive(nodes[index], message.value, message.source); } // This is a console message.
1664
- else if (message.type == 'notify') { // This is a notification message.
1665
- var n = getstore('notifications', 0);
1666
- if (((n & 8) == 0) && (message.amtMessage != null)) { break; } // Intel AMT desktop & terminal messages should be ignored.
1667
- var n = { text: message.value, title: message.title, icon: message.icon };
1668
- if (message.nodeid != null) { n.nodeid = message.nodeid; }
1669
- if (message.tag != null) { n.tag = message.tag; }
1670
- if (message.username != null) { n.username = message.username; }
1671
- addNotification(n);
1672
- } else if (message.type == 'ps') {
1673
- showDeskToolsProcesses(message);
1674
- } else if (message.type == 'services') {
1675
- showDeskToolsServices(message);
1676
- } else if ((message.type == 'getclip') && (xxdialogTag == 'clipboard') && (currentNode != null) && (currentNode._id == message.nodeid)) {
1677
- Q('d2clipText').value = message.data;
1678
- } else if ((message.type == 'setclip') && (xxdialogTag == 'clipboard') && (currentNode != null) && (currentNode._id == message.nodeid)) {
1679
- // Display success/fail on the clipboard dialog box.
1680
- QH('dlgClipStatus', message.success ? '<span style=color:green>' + "Success" + '</span>' : '<span style=color:red>' + "Failed" + '</span>')
1681
- setTimeout(function () { try { QH('dlgClipStatus', ''); } catch (ex) { } }, 2000);
1682
- }
1683
- }
1684
- } else {
1685
- if (message.type == 'notify') { // This is a notification message.
1686
- var n = { text: message.value, title: message.title, icon: message.icon };
1687
- if (message.tag != null) { n.tag = message.tag; }
1688
- if (message.username != null) { n.username = message.username; }
1689
- addNotification(n);
1690
- }
1691
- }
1692
- break;
1693
- }
1694
- case 'getnetworkinfo': {
1695
- if ((currentNode._id == message.nodeid) && (xxdialogMode == 2) && (xxdialogTag == 'if' + message.nodeid)) {
1696
- if (message.netif == null) {
1697
- QH('d2netinfo', "No network interface information available for this device.");
1698
- } else {
1699
- var x = '<div class=dialogText>';
1700
-
1701
- if (currentNode.lastconnect) { x += addHtmlValue2("Last agent connection", printDateTime(new Date(currentNode.lastconnect))); }
1702
- if (currentNode.lastaddr) {
1703
- var splitip = currentNode.lastaddr.split(':');
1704
- if (splitip.length > 2) {
1705
- // IPv6
1706
- x += addHtmlValue2("Last agent address", currentNode.lastaddr + ' <img src="images/link4.png" title="Copy address to clipboard" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(currentNode.lastaddr) + '\") width=10 height=10>');
1707
- } else {
1708
- // IPv4
1709
- if (isPrivateIP(currentNode.lastaddr)) {
1710
- x += addHtmlValue2("Last agent address", splitip[0] + ' <img src="images/link4.png" title="' + "Copy address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(splitip[0]) + '\") width=10 height=10>');
1711
- } else {
1712
- x += addHtmlValue2("Last agent address", '<a href="https://iplocation.com/?ip=' + splitip[0] + '" rel="noreferrer noopener" target="MeshIPLoopup">' + splitip[0] + '</a> <img src="images/link4.png" title="' + "Copy address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(splitip[0]) + '\") width=10 height=10>');
1713
- }
1714
- }
1715
- }
1716
-
1717
- x += addHtmlValue2("Last interfaces update", printDateTime(new Date(message.updateTime)));
1718
- for (var i in message.netif) {
1719
- var net = message.netif[i];
1720
- x += '<hr />'
1721
- if (net.name) { x += addHtmlValue2("Name", '<b>' + EscapeHtml(net.name) + '</b>'); }
1722
- if (net.desc) { x += addHtmlValue2("Description", EscapeHtml(net.desc).replace('(R)', '®').replace('(r)', '®')); }
1723
- if (net.dnssuffix) { x += addHtmlValue2("DNS suffix", EscapeHtml(net.dnssuffix) + ' <img src="images/link4.png" title="' + "Copy name to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.dnssuffix) + '\") width=10 height=10>'); }
1724
- if (net.mac) { x += addHtmlValue2("MAC address", '<a href="https://dnslytics.com/mac-address-lookup/' + net.mac.substring(0, 6) + '" rel="noreferrer noopener" target="MeshMACLoopup">' + EscapeHtml(net.mac.toLowerCase()) + '</a> <img src="images/link4.png" title="' + "Copy MAC address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.mac.toLowerCase()) + '\") width=10 height=10>'); }
1725
- if (net.v4addr) { x += addHtmlValue2("IPv4 address", EscapeHtml(net.v4addr) + ' <img src="images/link4.png" title="' + "Copy address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.v4addr) + '\") width=10 height=10>'); }
1726
- if (net.v4mask) { x += addHtmlValue2("IPv4 mask", EscapeHtml(net.v4mask) + ' <img src="images/link4.png" title="' + "Copy address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.v4mask) + '\") width=10 height=10>'); }
1727
- if (net.v4gateway) { x += addHtmlValue2("IPv4 gateway", EscapeHtml(net.v4gateway) + ' <img src="images/link4.png" title="' + "Copy address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.v4gateway) + '\") width=10 height=10>'); }
1728
- if (net.gatewaymac) { x += addHtmlValue2("Gateway MAC", '<a href="https://dnslytics.com/mac-address-lookup/' + net.gatewaymac.substring(0, 6) + '" rel="noreferrer noopener" target="MeshMACLoopup">' + EscapeHtml(net.gatewaymac.toLowerCase()) + '</a> <img src="images/link4.png" title="' + "Copy MAC address to clipboard" + '" style="cursor:pointer" onclick=copyTextToClip2(\"' + encodeURIComponent(net.gatewaymac.toLowerCase()) + '\") width=10 height=10>'); }
1729
- }
1730
- x += '</div>';
1731
- QH('d2netinfo', x);
1732
- }
1733
- }
1734
- break;
1735
- }
1736
- case 'serverversion': {
1737
- if ((xxdialogMode == 2) && (xxdialogTag == 'MeshCentralServerUpdate')) {
1738
- var x = '<div class=dialogText>';
1739
- if (!message.current) { message.current = "Unknown"; }
1740
- if (!message.latest) { message.latest = "Unknown"; }
1741
- x += addHtmlValue2("Current Version", '<b>' + EscapeHtml(message.current) + '</b>');
1742
- x += addHtmlValue2("Latest Version", '<b>' + EscapeHtml(message.latest) + '</b>');
1743
- x += '</div>';
1744
- if ((message.latest.indexOf('.') == -1) || (message.current == message.latest) || ((features & 2048) == 0)) {
1745
- setDialogMode(2, "MeshCentral Version", 1, null, x);
1746
- } else {
1747
- setDialogMode(2, "MeshCentral Version", 3, server_showVersionDlgEx, x + '<br /><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> ' + "Check and click OK to start server self-update." + '</label>');
1748
- server_showVersionDlgUpdate();
1749
- }
1750
- }
1751
- break;
1752
- }
1753
- case 'servererrors': {
1754
- if ((xxdialogMode == 2) && (xxdialogTag == 'MeshCentralServerErrors')) {
1755
- if (message.data == null) {
1756
- setDialogMode(2, "MeshCentral Server Errors", 1, null, "Server has no error log.");
1757
- } else {
1758
- var x = '<div class="dialogText dialogTextLog"><pre id=d2ServerErrorsLogPre>' + message.data + '<pre></div>';
1759
- setDialogMode(2, "MeshCentral Server Errors", 3, server_showErrorsDlgEx, x + '<br /><div style=float:right><img src=images/link4.png height=10 width=10 title="' + "Download error log" + '" style=cursor:pointer onclick=d2CopyServerErrorsToClip()></div><div><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> ' + "Check and click OK to clear error log." + '</label></div>');
1760
- server_showVersionDlgUpdate();
1761
- }
1762
- }
1763
- break;
1764
- }
1765
- case 'serverconsole': {
1766
- p15consoleReceive('serverconsole', message.value);
1767
- break;
1768
- }
1769
- case 'events': {
1770
- if ((message.nodeid != null) && (message.nodeid == currentNode._id)) {
1771
- currentDeviceEvents = message.events;
1772
- masterUpdate(1024);
1773
- } else if ((message.user != null) && (message.user == currentUser.name)) {
1774
- currentUserEvents = message.events;
1775
- masterUpdate(2048);
1776
- } else {
1777
- events = message.events;
1778
- masterUpdate(32);
1779
- }
1780
- break;
1781
- }
1782
- case 'getcookie': {
1783
- if (message.tag == 'clickonce') {
1784
- var basicPort = '{{{serverRedirPort}}}' == '' ? '{{{serverPublicPort}}}' : '{{{serverRedirPort}}}';
1785
- var rdpurl = 'http://' + window.location.hostname + ':' + basicPort + '/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F' + window.location.hostname + '%2Fmeshrelay.ashx%3Fauth=' + message.cookie + '&CH={{{webcerthash}}}&AP=' + message.protocol + ((debugmode == 1) ? '' : '&HOL=1');
1786
- var newWindow = window.open(rdpurl, '_blank');
1787
- newWindow.opener = null;
1788
- }
1789
- break;
1790
- }
1791
- case 'getNotes': {
1792
- var n = Q('d2devNotes');
1793
- if (n && (message.id == decodeURIComponent(n.attributes['noteid'].value))) {
1794
- if (message.notes) { QH('d2devNotes', decodeURIComponent(message.notes)); } else { QH('d2devNotes', ''); }
1795
- var ro = (n.attributes['ro'].value == 'true');
1796
- if (ro == false) { // If we have permissions, set read/write on this note.
1797
- n.removeAttribute('readonly');
1798
- QE('idx_dlgOkButton', true);
1799
- QV('idx_dlgOkButton', true);
1800
- focusTextBox('d2devNotes');
1801
- }
1802
- }
1803
- break;
1804
- }
1805
- case 'otpauth-request': {
1806
- if ((xxdialogMode == 2) && (xxdialogTag == 'otpauth-request')) {
1807
- var secret = message.secret;
1808
- if (secret.length == 52) { secret = secret.split(/(.............)/).filter(Boolean).join(' '); }
1809
- else if (secret.length == 32) { secret = secret.split(/(....)/).filter(Boolean).join(' '); secret = secret.substring(0, 20) + '<br/>' + secret.substring(20) }
1810
- QH('d2optinfo', '<table style=width:380px><tr><td style=vertical-align:top>' + "Install <a href=\"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2\" rel=\"noreferrer noopener\" target=_blank>Google Authenticator</a> or a compatible application and scan the barcode, use <a href=\"' + message.url + '\" rel=\"noreferrer noopener\" target=_blank> this link</a> or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login." + '<br /><br />Secret<br /><tt id=d2optsecret secret=\"' + message.secret + '\" style=font-size:12px>' + secret + '</tt><br /><br /></td><td style=width:1px;vertical-align:top><a href=\"' + message.url + '\" rel=\"noreferrer noopener\" target=_blank><div id="qrcode"></div></a></td><tr><td colspan=2 style="text-align:center;border-top:1px solid black"><br />' + "Enter the token here for 2-step login:" + ' <input type=text onkeypress=\"return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)\" onkeyup=account_addOtpCheck(event) onkeydown=account_addOtpCheck() maxlength=6 id=d2otpauthinput type=text></td></table>');
1811
- new QRCode(Q('qrcode'), { text: message.url, width: 128, height: 128, colorDark: '#000000', colorLight: '#EEE', correctLevel: QRCode.CorrectLevel.H });
1812
- QV('idx_dlgOkButton', true);
1813
- QE('idx_dlgOkButton', false);
1814
- Q('d2otpauthinput').focus();
1815
- }
1816
- break;
1817
- }
1818
- case 'otpauth-setup': {
1819
- if (xxdialogMode) return;
1820
- setDialogMode(2, "Authenticator App", 1, null, message.success ? ('<b style=color:green>' + "Authenticator app activation successful." + '</b> ' + "You will now need a valid token to login again.") : ('<b style=color:red>' + "2-step login activation failed." + '</b> ' + "Clear the secret from the application and try again. You only have a few minutes to enter the proper code."));
1821
- break;
1822
- }
1823
- case 'otpauth-clear': {
1824
- if (xxdialogMode) return;
1825
- setDialogMode(2, "Authenticator App", 1, null, message.success ? ('<b>' + "Authenticator application removed." + '</b> ' + "You can reactivate this feature at any time.") : ('<b style=color:red>' + "2-step login activation removal failed." + '</b> ' + "Try again."));
1826
- break;
1827
- }
1828
- case 'otpauth-getpasswords': {
1829
- if (xxdialogMode) return;
1830
- var x = "One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place.";
1831
- x += '<div style="border-radius:6px;border: 2px dashed #888;width:100%;margin-top:8px"><div style="padding:8px;font-family:Arial, Helvetica, sans-serif;font-size:20px;font-weight:bold"><table class=selecttext style=width:100%;text-align:center>';
1832
- if (message.passwords) {
1833
- var j = 0, clipb = '';
1834
- for (var i in message.passwords) {
1835
- if (++j % 2) { x += '<tr>'; }
1836
- var p = '' + message.passwords[i].p;
1837
- while (p.length < 8) { p = '0' + p; }
1838
- if (message.passwords[i].u === true) {
1839
- x += '<td>' + p.substring(0, 4) + ' ' + p.substring(4);
1840
- if (clipb != '') { clipb += ' '; }
1841
- clipb += p;
1842
- } else {
1843
- x += '<td><strike style=color:#BBB>' + p.substring(0, 4) + ' ' + p.substring(4); + '</strike>';
1844
- }
1845
- }
1846
- } else {
1847
- x += '<tr><td>' + "No Active Tokens";
1848
- }
1849
- x += '</table></div></div><br />';
1850
- x += '<div><input type=button value=' + "Close" + ' onclick=setDialogMode(0) style=float:right></input>';
1851
- x += '<input type=button value="' + "Generate New Tokens" + '" onclick="account_manageOtp(1);"></input>';
1852
- if (message.passwords != null) {
1853
- x += '<input type=button value="' + "Clear Tokens" + '" onclick="account_manageOtp(2);"></input>';
1854
- x += ' <img src=images/link4.png height=10 width=10 title="' + "Copy valid codes to clipboard" + '" style=cursor:pointer onclick=copyTextToClip2("' + encodeURIComponent(clipb) + '")>';
1855
- }
1856
- x += '</div><br />';
1857
- setDialogMode(2, "Manage Backup Codes", 8, null, x, 'otpauth-manage');
1858
- break;
1859
- }
1860
- case 'otp-hkey-get': {
1861
- if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) return;
1862
- var start = '<div style="border-radius:6px;border:2px solid #CCC;background-color:#BBB;width:100%;box-sizing:border-box;margin-bottom:6px"><div style="margin:3px;font-family:Arial, Helvetica, sans-serif;font-size:16px;font-weight:bold"><table style=width:100%;text-align:left>';
1863
- var end = '</table></div></div>';
1864
- var x = "<a href=\"https://www.yubico.com/\" rel=\"noreferrer noopener\" target=\"_blank\">Hardware keys</a> are used as secondary login authentication.";
1865
- x += '<div style="max-height:150px;overflow-y:auto;overflow-x:hidden;margin-top:6px;margin-bottom:6px">';
1866
- if (message.keys && message.keys.length > 0) {
1867
- for (var i in message.keys) {
1868
- var key = message.keys[i], type = (key.type == 2)?'OTP':'WebAuthn';
1869
- x += start + '<tr style=margin:5px><td style=width:30px><img width=24 height=18 src="images/hardware-key-' + type + '-24.png" style=margin-top:4px><td style=width:250px>' + key.name + '<td><input type=button value="' + "Remove" + '" onclick=account_removehkey(" + key.i + ")></input>' + end;
1870
- }
1871
- } else {
1872
- x += start + '<tr style=text-align:center><td>' + "No Keys Configured" + end;
1873
- }
1874
- x += '</div>';
1875
- x += '<div><input type=button value="' + "Close" + '" onclick=setDialogMode(0) style=float:right></input>';
1876
- if ((features & 0x00020000) != 0) { x += '<input id=d2addkey3 type=button value="' + "Add Key" + '" onclick="account_addhkey(3);"></input>'; }
1877
- if ((features & 0x00004000) != 0) { x += '<input id=d2addkey2 type=button value="' + "Add YubiKey® OTP" + '" onclick="account_addhkey(2);"></input>'; }
1878
- x += '</div><br />';
1879
- setDialogMode(2, "Manage Security Keys", 8, null, x, 'otpauth-hardware-manage');
1880
- if (u2fSupported() == false) { QE('d2addkey1', false); }
1881
- break;
1882
- }
1883
- case 'otp-hkey-yubikey-add': {
1884
- if (message.result) {
1885
- meshserver.send({ action: 'otp-hkey-get' }); // Success, ask for the full list of keys.
1886
- } else {
1887
- setDialogMode(2, "Add Security Key", 1, null, '<br />' + "Error, Unable to add key." + '<br /><br />');
1888
- }
1889
- break;
1890
- }
1891
- case 'otp-hkey-setup-response': {
1892
- if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) return;
1893
- if (message.result == true) {
1894
- meshserver.send({ action: 'otp-hkey-get' }); // Success, ask for the full list of keys.
1895
- } else {
1896
- setDialogMode(2, "Add Security Key", 1, null, '<br />' + "ERROR: Unable to add key." + '<br /><br />', 'otpauth-hardware-manage');
1897
- }
1898
- break;
1899
- }
1900
- case 'webauthn-startregister': {
1901
- if (xxdialogMode && (xxdialogTag != 'otpauth-hardware-manage')) return;
1902
- var x = "Press the key button now." + '<br /><br /><div style=width:100%;text-align:center><img width=120 height=117 src="images/hardware-keypress-120.png" /></div><input id=dp1keyname style=display:none value=' + message.name + ' />';
1903
- setDialogMode(2, "Add Security Key", 2, null, x);
1904
-
1905
- var publicKey = message.request;
1906
- message.request.challenge = Uint8Array.from(atob(message.request.challenge), function (c) { return c.charCodeAt(0) })
1907
- message.request.user.id = Uint8Array.from(atob(message.request.user.id), function (c) { return c.charCodeAt(0) })
1908
- navigator.credentials.create({ publicKey: publicKey })
1909
- .then(function(newCredentialInfo) {
1910
- // Public key credential
1911
- var r = { rawId: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.rawId))), response: { attestationObject: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.response.attestationObject))), clientDataJSON: btoa(String.fromCharCode.apply(null, new Uint8Array(newCredentialInfo.response.clientDataJSON))) }, type: newCredentialInfo.type };
1912
- meshserver.send({ action: 'webauthn-endregister', response: r });
1913
- setDialogMode(0);
1914
- }, function(error) {
1915
- // Error
1916
- setDialogMode(2, "Add Security Key", 1, null, "ERROR: " + error);
1917
- });
1918
- break;
1919
- }
1920
- case 'event': {
1921
- if (!message.event.nolog) {
1922
- if (currentNode && (message.event.nodeid == currentNode._id)) {
1923
- // If this event has a nodeid and we are looking at this node, update the log in real time.
1924
- currentDeviceEvents.unshift(message.event);
1925
- var eventLimit = parseInt(p16limitdropdown.value);
1926
- while (currentDeviceEvents.length > eventLimit) { currentDeviceEvents.pop(); } // Remove element(s) at the end
1927
- masterUpdate(1024);
1928
- }
1929
-
1930
- if (currentUser && (message.event.userid == currentUser._id)) {
1931
- // If this event has a userid and we are looking at this user, update the log in real time.
1932
- currentUserEvents.unshift(message.event);
1933
- var eventLimit = parseInt(p31limitdropdown.value);
1934
- while (currentUserEvents.length > eventLimit) { currentUserEvents.pop(); } // Remove element(s) at the end
1935
- masterUpdate(2048);
1936
- }
1937
-
1938
- // Add this event to the master events log.
1939
- events.unshift(message.event);
1940
- var eventLimit = parseInt(p3limitdropdown.value);
1941
- while (events.length > eventLimit) { events.pop(); } // Remove element(s) at the end
1942
- masterUpdate(32);
1943
- }
1944
- if (message.event.noact) break; // Take no action on this event
1945
- switch (message.event.action) {
1946
- case 'userWebState': {
1947
- // New user web state, update the web page as needed
1948
- if (localStorage != null) {
1949
- var oldShowRealNames = localStorage.getItem('showRealNames');
1950
- var oldUiMode = localStorage.getItem('uiMode');
1951
- var oldSort = localStorage.getItem('sort');
1952
- var oldLoctag = localStorage.getItem('loctag');
1953
-
1954
- var webstate = JSON.parse(message.event.state);
1955
- for (var i in webstate) { localStorage.setItem(i, webstate[i]); }
1956
-
1957
- // Update the web page
1958
- if ((webstate.deskAspectRatio != null) && (webstate.deskAspectRatio != deskAspectRatio)) { deskAspectRatio = webstate.deskAspectRatio; deskAdjust(); }
1959
- if ((webstate.showRealNames != null) && (webstate.showRealNames != oldShowRealNames)) { showRealNames = Q('RealNameCheckBox').checked = (webstate.showRealNames == '1'); masterUpdate(6); }
1960
- if ((webstate.uiMode != null) && (webstate.uiMode != oldUiMode)) { userInterfaceSelectMenu(parseInt(webstate.uiMode)); }
1961
- if ((webstate.sort != null) && (webstate.sort != oldSort)) { document.getElementById('sortselect').selectedIndex = sort = parseInt(webstate.sort); masterUpdate(6); }
1962
- if ((webstate.loctag != null) && (webstate.loctag != oldLoctag)) { if (webstate.loctag != null) { args.locale = webstate.loctag; } else { delete args.locale; } masterUpdate(0xFFFFFFFF); }
1963
- }
1964
- break;
1965
- }
1966
- case 'servertimelinestats': { addServerTimelineStats(message.event.data); break; }
1967
- case 'accountcreate':
1968
- case 'accountchange': {
1969
- // An account was created or changed
1970
- if (userinfo.name == message.event.account.name) {
1971
- var newsiteadmin = message.event.account.siteadmin?message.event.account.siteadmin:0;
1972
- var oldsiteadmin = userinfo.siteadmin?userinfo.siteadmin:0;
1973
- if ((message.event.account.quota != userinfo.quota) || (((userinfo.siteadmin & 8) == 0) && ((message.event.account.siteadmin & 8) != 0))) { meshserver.send({ action: 'files' }); }
1974
- var oldgroups = userinfo.groups;
1975
- userinfo = message.event.account;
1976
- if (oldsiteadmin != newsiteadmin) updateSiteAdmin();
1977
- updateSelf();
1978
-
1979
- if ((userinfo.siteadmin & 2) != 0) {
1980
- // Compare our groups
1981
- var og = oldgroups ? oldgroups : [];
1982
- var ng = userinfo.groups ? userinfo.groups : [];
1983
- if (og.join(',') != ng.join(',')) {
1984
- // Our groups have changed, re-ask for a list of users.
1985
- users = wssessions = null;
1986
- meshserver.send({ action: 'users' });
1987
- meshserver.send({ action: 'wssessioncount' });
1988
- }
1989
- }
1990
- }
1991
- if (users == null) break;
1992
-
1993
- // Check if the account is part of our user group
1994
- if ((userinfo.groups == null) || (userinfo.groups.length == 0) || (findOne(message.event.account.groups, userinfo.groups) == true)) {
1995
- users[message.event.account._id] = message.event.account; // Part of our groups, update this user.
1996
- } else {
1997
- delete users[message.event.account._id]; // No longer part of our groups, remove this user.
1998
- }
1999
-
2000
- updateUsers();
2001
- break;
2002
- }
2003
- case 'accountremove': {
2004
- // An account was removed
2005
- if (users == null) break;
2006
- delete users['user/' + domain + '/' + message.event.username.toLowerCase()];
2007
- updateUsers();
2008
- break;
2009
- }
2010
- case 'createmesh': {
2011
- // A new mesh was created
2012
- if ((meshes[message.event.meshid] == null) && (message.event.links[userinfo._id] != null)) { // Check if this is a mesh create for a mesh we own. If site administrator, we get all messages so need to ignore some.
2013
- meshes[message.event.meshid] = { _id: message.event.meshid, name: message.event.name, mtype: message.event.mtype, desc: message.event.desc, links: message.event.links };
2014
- masterUpdate(4 + 128);
2015
- meshserver.send({ action: 'files' });
2016
- }
2017
- break;
2018
- }
2019
- case 'meshchange': {
2020
- // Update mesh information
2021
- if (meshes[message.event.meshid] == null) {
2022
- // This is a new mesh for us
2023
- meshes[message.event.meshid] = { _id: message.event.meshid, name: message.event.name, mtype: message.event.mtype, desc: message.event.desc, links: message.event.links };
2024
- meshserver.send({ action: 'nodes' }); // Request a refresh of all nodes (TODO: We could optimize this to only request nodes for the new mesh).
2025
- } else {
2026
- // This is an existing mesh
2027
- if (message.event.name != null) {
2028
- meshes[message.event.meshid].name = message.event.name;
2029
- for (var i in nodes) { if (nodes[i].meshid == message.event.meshid) { nodes[i].meshnamel = message.event.name.toLowerCase(); } }
2030
- }
2031
- if (message.event.desc != null) { meshes[message.event.meshid].desc = message.event.desc; }
2032
- if (message.event.flags != null) { meshes[message.event.meshid].flags = message.event.flags; }
2033
- if (message.event.consent != null) { meshes[message.event.meshid].consent = message.event.consent; }
2034
- if (message.event.links) { meshes[message.event.meshid].links = message.event.links; }
2035
- if (message.event.amt) { meshes[message.event.meshid].amt = message.event.amt; }
2036
-
2037
- // Check if we lost rights to this mesh in this change.
2038
- if (meshes[message.event.meshid].links[userinfo._id] == null) {
2039
- if ((xxcurrentView == 20) && (currentMesh == meshes[message.event.meshid])) go(2);
2040
- delete meshes[message.event.meshid];
2041
-
2042
- // Delete all nodes in that mesh
2043
- var newnodes = [];
2044
- for (var i in nodes) { if (nodes[i].meshid != message.event.meshid) { newnodes.push(nodes[i]); } }
2045
- nodes = newnodes;
2046
-
2047
- // If we are looking at a node in the deleted mesh, move back to "My Devices"
2048
- if (xxcurrentView >= 10 && xxcurrentView < 20 && currentNode && currentNode.meshid == message.event.meshid) { setDialogMode(0); go(1); }
2049
- }
2050
- }
2051
- masterUpdate(4 + 128);
2052
- if (currentNode && (currentNode.meshid == message.event.meshid)) { currentNode = null; if ((xxcurrentView >= 10) && (xxcurrentView < 20)) { go(1); } }
2053
- //meshserver.send({ action: 'files' }); // TODO: Why do we need to do this??
2054
-
2055
- // If we are looking at a mesh that is now deleted, move back to "My Account"
2056
- if (xxcurrentView == 20 && currentMesh._id == message.event.meshid) { masterUpdate(4096); }
2057
- break;
2058
- }
2059
- case 'deletemesh': {
2060
- // Delete the mesh
2061
- if (meshes[message.event.meshid]) {
2062
- delete meshes[message.event.meshid];
2063
- masterUpdate(128);
2064
- meshserver.send({ action: 'files' });
2065
- }
2066
-
2067
- // Delete all nodes in that mesh
2068
- var newnodes = [];
2069
- if (nodes != null) { for (var i in nodes) { if (nodes[i].meshid != message.event.meshid) { newnodes.push(nodes[i]); } } }
2070
- nodes = newnodes;
2071
- masterUpdate(4);
2072
-
2073
- // If we are looking at a mesh that is now deleted, move back to "My Account"
2074
- if (xxcurrentView >= 20 && xxcurrentView < 30 && currentMesh._id == message.event.meshid) { setDialogMode(0); go(2); }
2075
- // If we are looking at a node in the deleted mesh, move back to "My Devices"
2076
- if (xxcurrentView >= 10 && xxcurrentView < 20 && currentNode && currentNode.meshid == message.event.meshid) { setDialogMode(0); go(1); }
2077
-
2078
- break;
2079
- }
2080
- case 'addnode': {
2081
- var node = message.event.node;
2082
- if (!meshes[node.meshid]) break; // This is a node for a mesh we don't know. Happens when we are site administrator, we get all messages.
2083
- if (getNodeFromId(node._id) != null) break; // This node is already known.
2084
- node.namel = node.name.toLowerCase();
2085
- if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
2086
- node.meshnamel = meshes[node.meshid].name.toLowerCase();
2087
- node.state = 0;
2088
- if (!node.icon) node.icon = 1;
2089
- node.ident = ++nodeShortIdent;
2090
- if (nodes == null) { }
2091
- nodes.push(node);
2092
-
2093
- // Web page update
2094
- masterUpdate(1 | 2 | 4 | 16);
2095
-
2096
- break;
2097
- }
2098
- case 'removenode': {
2099
- var index = -1;
2100
- for (var i in nodes) { if (nodes[i]._id == message.event.nodeid) { index = i; break; } }
2101
- if (index != -1) {
2102
- var node = nodes[index];
2103
- if (currentNode == node) {
2104
- if (xxcurrentView >= 10 && xxcurrentView < 20) { setDialogMode(0); go(1); }
2105
- currentNode = null;
2106
- // TODO: Correctly disconnect from this node (Desktop/Terminal/Files...)
2107
- }
2108
- nodes.splice(index, 1);
2109
-
2110
- // Web page update
2111
- masterUpdate(4 | 16);
2112
- }
2113
- break;
2114
- }
2115
- case 'changenode': {
2116
- var index = -1;
2117
- for (var i in nodes) { if (nodes[i]._id == message.event.nodeid) { index = i; break; } }
2118
- if (index != -1) {
2119
- var node = nodes[index];
2120
-
2121
- // Change the node
2122
- node.name = message.event.node.name;
2123
- node.rname = message.event.node.rname;
2124
- node.users = message.event.node.users;
2125
- node.host = message.event.node.host;
2126
- node.desc = message.event.node.desc;
2127
- node.ip = message.event.node.ip;
2128
- node.osdesc = message.event.node.osdesc;
2129
- node.publicip = message.event.node.publicip;
2130
- node.iploc = message.event.node.iploc;
2131
- node.wifiloc = message.event.node.wifiloc;
2132
- node.gpsloc = message.event.node.gpsloc;
2133
- node.tags = message.event.node.tags;
2134
- node.userloc = message.event.node.userloc;
2135
- if (message.event.node.agent != null) {
2136
- if (node.agent == null) node.agent = {};
2137
- if (message.event.node.agent.ver != null) { node.agent.ver = message.event.node.agent.ver; }
2138
- if (message.event.node.agent.id != null) { node.agent.id = message.event.node.agent.id; }
2139
- if (message.event.node.agent.caps != null) { node.agent.caps = message.event.node.agent.caps; }
2140
- if (message.event.node.agent.core != null) { node.agent.core = message.event.node.agent.core; } else { if (node.agent.core) { delete node.agent.core; } }
2141
- node.agent.tag = message.event.node.agent.tag;
2142
- }
2143
- if (message.event.node.intelamt != null) {
2144
- if (node.intelamt == null) node.intelamt = {};
2145
- if (message.event.node.intelamt.state != null) { node.intelamt.state = message.event.node.intelamt.state; }
2146
- if (message.event.node.intelamt.host != null) { node.intelamt.user = message.event.node.intelamt.host; }
2147
- if (message.event.node.intelamt.user != null) { node.intelamt.user = message.event.node.intelamt.user; }
2148
- if (message.event.node.intelamt.tls != null) { node.intelamt.tls = message.event.node.intelamt.tls; }
2149
- if (message.event.node.intelamt.ver != null) { node.intelamt.ver = message.event.node.intelamt.ver; }
2150
- if (message.event.node.intelamt.tag != null) { node.intelamt.tag = message.event.node.intelamt.tag; }
2151
- if (message.event.node.intelamt.uuid != null) { node.intelamt.uuid = message.event.node.intelamt.uuid; }
2152
- if (message.event.node.intelamt.realm != null) { node.intelamt.realm = message.event.node.intelamt.realm; }
2153
- }
2154
- if (message.event.node.av != null) { node.av = message.event.node.av; }
2155
- node.namel = node.name.toLowerCase();
2156
- if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
2157
- if (message.event.node.icon) { node.icon = message.event.node.icon; }
2158
-
2159
- // Web page update
2160
- masterUpdate(2 | 4 | 8 | 16);
2161
- refreshDevice(node._id);
2162
-
2163
- if ((currentNode == node) && (xxdialogMode != null) && (xxdialogTag == '@xxmap')) { p10showNodeLocationDialog(); }
2164
- }
2165
- break;
2166
- }
2167
- case 'nodemeshchange': {
2168
- var index = -1;
2169
- for (var i in nodes) { if (nodes[i]._id == message.event.nodeid) { index = i; break; } }
2170
- if (index != -1) {
2171
- var node = nodes[index];
2172
- if (meshes[message.event.newMeshId] == null) {
2173
- // We don't see the new mesh, remove this device
2174
-
2175
- // TODO: Correctly disconnect from this node (Desktop/Terminal/Files...)
2176
- if (currentNode == node) { if (xxcurrentView >= 10 && xxcurrentView < 20) { setDialogMode(0); go(1); } currentNode = null; }
2177
- nodes.splice(index, 1);
2178
- masterUpdate(4 | 16);
2179
- } else {
2180
- // We see the new mesh, move this device
2181
- node.meshid = message.event.newMeshId;
2182
- node.meshnamel = meshes[message.event.newMeshId].name.toLowerCase();
2183
- masterUpdate(1 | 2 | 4);
2184
- }
2185
- refreshDevice(message.event.nodeid);
2186
- } else {
2187
- // This is a new device, add it.
2188
- var node = message.event.node;
2189
- if (!meshes[node.meshid]) break; // This is a node for a mesh we don't know. Happens when we are site administrator, we get all messages.
2190
- node.namel = node.name.toLowerCase();
2191
- if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
2192
- node.meshnamel = meshes[node.meshid].name.toLowerCase();
2193
- node.state = 0;
2194
- if (!node.icon) node.icon = 1;
2195
- node.ident = ++nodeShortIdent;
2196
- if (nodes == null) { }
2197
- nodes.push(node);
2198
-
2199
- // Web page update
2200
- masterUpdate(1 | 2 | 4 | 16);
2201
- }
2202
- break;
2203
- }
2204
- case 'nodeconnect': {
2205
- // Indicated a node has changed connectivity state
2206
- var index = -1;
2207
- for (var i in nodes) { if (nodes[i]._id == message.event.nodeid) { index = i; break; } }
2208
- if (index != -1) {
2209
- var node = nodes[index];
2210
-
2211
- // Event the connection change if needed
2212
- var n = getstore('notifications', 0); // Account notification settings
2213
-
2214
- // Per-group notification settings
2215
- if (message.event.meshid && userinfo.links && userinfo.links[message.event.meshid] && userinfo.links[message.event.meshid].notify) {
2216
- n &= userinfo.links[message.event.meshid].notify;
2217
- } else {
2218
- n = 0;
2219
- }
2220
-
2221
- // Show the notification
2222
- if (n & 2) {
2223
- if (((node.conn & 1) == 0) && ((message.event.conn & 1) != 0)) { addNotification({ text: "Agent connected", title: node.name, icon: node.icon, nodeid: node._id }); }
2224
- if (((node.conn & 2) == 0) && ((message.event.conn & 2) != 0)) { addNotification({ text: "Intel AMT detected", title: node.name, icon: node.icon, nodeid: node._id }); }
2225
- if (((node.conn & 4) == 0) && ((message.event.conn & 4) != 0)) { addNotification({ text: "Intel AMT CIRA connected", title: node.name, icon: node.icon, nodeid: node._id }); }
2226
- if (((node.conn & 16) == 0) && ((message.event.conn & 16) != 0)) { addNotification({ text: "MQTT connected", title: node.name, icon: node.icon, nodeid: node._id }); }
2227
- }
2228
- if (n & 4) {
2229
- if (((node.conn & 1) != 0) && ((message.event.conn & 1) == 0)) { addNotification({ text: "Agent disconnected", title: node.name, icon: node.icon, nodeid: node._id }); }
2230
- if (((node.conn & 2) != 0) && ((message.event.conn & 2) == 0)) { addNotification({ text: "Intel AMT not detected", title: node.name, icon: node.icon, nodeid: node._id }); }
2231
- if (((node.conn & 4) != 0) && ((message.event.conn & 4) == 0)) { addNotification({ text: "Intel AMT CIRA disconnected", title: node.name, icon: node.icon, nodeid: node._id }); }
2232
- if (((node.conn & 16) != 0) && ((message.event.conn & 16) == 0)) { addNotification({ text: "MQTT disconnected", title: node.name, icon: node.icon, nodeid: node._id }); }
2233
- }
2234
-
2235
- // Change the node connection state
2236
- node.conn = message.event.conn;
2237
- node.pwr = message.event.pwr;
2238
-
2239
- // Web page update
2240
- masterUpdate(4 | 16);
2241
- refreshDevice(node._id);
2242
- }
2243
- break;
2244
- }
2245
- case 'wssessioncount': {
2246
- // Update the active web socket session count for a user
2247
- if (wssessions != null) {
2248
- if (message.event.count == 0 && wssessions['user/' + domain + '/' + message.event.username.toLowerCase()]) {
2249
- delete wssessions['user/' + domain + '/' + message.event.username.toLowerCase()];
2250
- } else {
2251
- wssessions['user/' + domain + '/' + message.event.username.toLowerCase()] = message.event.count;
2252
- }
2253
- updateUsers();
2254
- }
2255
- break;
2256
- }
2257
- case 'login': {
2258
- // Update the last login time
2259
- if (users != null && users['user/' + domain + '/' + message.event.username.toLowerCase()]) {
2260
- users['user/' + domain + '/' + message.event.username.toLowerCase()].login = Math.floor(new Date(message.event.time).getTime() / 1000);
2261
- }
2262
- break;
2263
- }
2264
- case 'scanamtdevice': {
2265
- // Populate the Intel AMT scan dialog box with the result of the RMCP scan
2266
- if ((xxdialogMode == null) || (!Q('dp1range')) || (Q('dp1range').value != message.event.range)) return;
2267
- var x = '';
2268
- if (message.event.results == null) {
2269
- // The scan could not occur because of an error. Likely the user range was invalid.
2270
- x = '<div style=width:100%;text-align:center;margin-top:12px>' + "Unable to scan this address range." + '</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>' + "Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100" + '</div>';
2271
- } else {
2272
- // Go thru all the results and populate the dialog box
2273
- amtScanResults = message.event.results;
2274
- for (var i in message.event.results) {
2275
- var r = message.event.results[i], shortname = r.hostname;
2276
- if (shortname.length > 20) { shortname = shortname.substring(0, 20) + '...'; }
2277
- var str = '<b title="' + EscapeHtml(r.hostname) + '">' + EscapeHtml(shortname) + '</b> - v' + r.ver;
2278
- if (r.state == 2) { if (r.tls == 1) { str += " with TLS."; } else { str += " without TLS."; } } else { str += ' not activated.'; }
2279
- x += '<div style=width:100%;margin-bottom:2px;background-color:lightgray><div style=padding:4px><div style=display:inline-block;margin-right:5px><input class=DevScanCheckbox name=dp1checkbox tag="' + EscapeHtml(i) + '" type=checkbox onclick=addAmtScanToMeshCheckbox() /></div><div class=j1 style=display:inline-block></div><div style=display:inline-block;margin-left:5px;overflow-x:auto;white-space:nowrap>' + str + '</div></div></div>';
2280
- }
2281
- // If no results where found, display a nice message
2282
- if (x == '') { x = '<div style=width:100%;text-align:center;margin-top:12px>Scan returned no results.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>'; }
2283
- }
2284
- // Set the html in the dialog box and re-enable the scan button
2285
- QH('dp1results', x);
2286
- QE('dp1range', true);
2287
- QE('dp1rangebutton', true);
2288
- break;
2289
- }
2290
- case 'notify': {
2291
- var n = { text: message.event.value, title: message.event.title, icon: message.event.icon };
2292
- if (message.event.tag != null) { n.tag = message.event.tag; }
2293
- addNotification(n);
2294
- break;
2295
- }
2296
- case 'traceinfo': {
2297
- if (typeof message.event.traceSources == 'object') {
2298
- if ((message.event.traceSources != null) && (message.event.traceSources.length > 0)) {
2299
- serverTraceSources = message.event.traceSources;
2300
- QH('p41traceStatus', EscapeHtml(message.event.traceSources.join(', ')));
2301
- } else {
2302
- serverTraceSources = [];
2303
- QH('p41traceStatus', "None");
2304
- }
2305
- }
2306
- break;
2307
- }
2308
- case 'sysinfohash': {
2309
- // If the sysinfo document has changed and we are looking at it, request an update.
2310
- if ((currentNode != null) && (message.event.nodeid == powerTimelineReq)) {
2311
- meshserver.send({ action: 'getsysinfo', nodeid: message.event.nodeid });
2312
- }
2313
- break;
2314
- }
2315
- case 'stopped': { // Server is stopping.
2316
- // Disconnect
2317
- //console.log(message.msg);
2318
- break;
2319
- }
2320
- case 'updatePluginList': {
2321
- installedPluginList = message.event.list;
2322
- updatePluginList();
2323
- break;
2324
- }
2325
- case 'pluginStateChange': {
2326
- if (pluginHandler == null) break;
2327
- pluginHandler.refreshPluginHandler();
2328
- break;
2329
- }
2330
- default:
2331
- //console.log('Unknown message.event.action', message.event.action);
2332
- break;
2333
- }
2334
- break;
2335
- }
2336
- case 'createInviteLink': { // Agent installation invitation link
2337
- if (xxdialogTag != message.meshid) break;
2338
- var servername = serverinfo.name;
2339
- if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { 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.
2340
- var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
2341
- var url;
2342
- if (serverinfo.https == true) {
2343
- var portStr = (serverinfo.port == 443) ? '' : (':' + serverinfo.port);
2344
- url = 'https://' + servername + portStr + domainUrl + 'agentinvite?c=' + message.cookie;
2345
- } else {
2346
- var portStr = (serverinfo.port == 80) ? '' : (':' + serverinfo.port);
2347
- url = 'http://' + servername + portStr + domainUrl + 'agentinvite?c=' + message.cookie;
2348
- }
2349
- Q('agentInvitationLink').href = url;
2350
- var t = format("{0} hour{1}", message.expire, addLetterS(message.expire));
2351
- if (message.expire == 24) { t = "1 day"; }
2352
- if (message.expire == 168) { t = "1 week"; }
2353
- if (message.expire == 5040) { t = "1 month"; }
2354
- if (message.expire == 0) { t = "Unlimited"; }
2355
- QH('agentInvitationLink', format("Invitation Link ({0})", t));
2356
- QV('agentInvitationLinkDiv', true);
2357
- break;
2358
- }
2359
- case 'getmqttlogin': {
2360
- if ((currentNode == null) || (currentNode._id != message.nodeid) || (xxdialogMode != null)) return;
2361
- var x = "These settings can be used to connect MQTT for this device." + '<br /><br />';
2362
- delete message.action;
2363
- delete message.nodeid;
2364
- x += '<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>' + JSON.stringify(message) + '</textarea>';
2365
- /*
2366
- x += addHtmlValue('Username', '<input style=width:230px readonly value="' + message.user + '" />');
2367
- x += addHtmlValue('Password', '<input style=width:230px readonly value="' + message.pass + '" />');
2368
- x += addHtmlValue('WS URL', '<input style=width:230px readonly value="' + message.wsUrl + '" />');
2369
- if (message.mpsUrl && message.mpsCertHash) {
2370
- x += addHtmlValue('MPS URL', '<input style=width:230px readonly value="' + message.mpsUrl + '" />');
2371
- x += addHtmlValue('MPS Cert Hash', '<input style=width:230px readonly value="' + message.mpsCertHash + '" />');
2372
- }
2373
- */
2374
- setDialogMode(2, "MQTT Credentials", 1, null, x);
2375
- break;
2376
- }
2377
- case 'stopped': { // Server is stopping.
2378
- // Disconnect
2379
- autoReconnect = false;
2380
- QH('p0span', message.msg);
2381
- break;
2382
- }
2383
- case 'updatePluginList': {
2384
- installedPluginList = message.list;
2385
- updatePluginList();
2386
- break;
2387
- }
2388
- case 'pluginVersionsAvailable': {
2389
- if (pluginHandler == null) break;
2390
- updatePluginList(message.list);
2391
- break;
2392
- }
2393
- case 'downgradePluginVersions': {
2394
- var vSelect = '<select id="lastPluginVersion">';
2395
- message.info.versionList.forEach(function(v) { vSelect += '<option value="' + v.zipball_url + '">' + v.name + '</option>'; });
2396
- vSelect += '</select>';
2397
- setDialogMode(2, "Plugin Action", 3, pluginActionEx, format('Select the version to downgrade the plugin: {0}', message.info.name) + '<hr />' + vSelect + '<hr />' + "Please be aware that downgrading is not recommended. Please only do so in the event that a recent upgrade has broken something." + + '<input id="lastPluginAct" type="hidden" value="downgrade" /><input id="lastPluginId" type="hidden" value="' + message.info.id + '" />');
2398
- break;
2399
- }
2400
- case 'pluginError': {
2401
- setDialogMode(2, "Plugin Error", 1, null, message.msg);
2402
- break;
2403
- }
2404
- case 'plugin': {
2405
- if ((pluginHandler == null) || (typeof message.plugin != 'string')) break;
2406
- try { pluginHandler[message.plugin][message.method](server, message); } catch (e) { console.log('Error loading plugin handler ('+ e + ')'); }
2407
- break;
2408
- }
2409
- default:
2410
- //console.log('Unknown message.action', message.action);
2411
- break;
2412
- }
2413
- }
2414
-
2415
- //
2416
- // MY DEVICES
2417
- //
2418
-
2419
- function onRealNameCheckBox() {
2420
- showRealNames = Q('RealNameCheckBox').checked;
2421
- putstore('showRealNames', showRealNames ? 1 : 0);
2422
- masterUpdate(6);
2423
- return;
2424
- }
2425
-
2426
- function onDeviceViewChange(i) {
2427
- if (i != null) { Q('viewselect').value = i; }
2428
- for (var j = 1; j < 5; j++) { Q('devViewButton' + j).classList.remove('viewSelectorSel'); }
2429
- Q('devViewButton' + Q('viewselect').value).classList.add('viewSelectorSel');
2430
- putstore('_deviceView', Q('viewselect').value);
2431
- putstore('_viewsize', Q('sizeselect').value);
2432
- masterUpdate(4);
2433
- setTimeout(function () { masterUpdate(512); }, 200);
2434
- }
2435
-
2436
- function ondockeypress(e) {
2437
- setSessionActivity();
2438
- if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) {
2439
- // Check what keys we are allows to send
2440
- if (currentNode != null) {
2441
- var mesh = meshes[currentNode.meshid];
2442
- var meshrights = mesh.links[userinfo._id].rights;
2443
- var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0)));
2444
- if (inputAllowed == false) return false;
2445
- var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0)));
2446
- if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; }
2447
- }
2448
- return desktop.m.handleKeys(e);
2449
- }
2450
- if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) { return terminal.m.TermHandleKeys(e); }
2451
- if (!xxdialogMode && ((xxcurrentView == 15) || (xxcurrentView == 115))) return agentConsoleHandleKeys(e);
2452
- if (!xxdialogMode && xxcurrentView == 4) {
2453
- if (e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
2454
- var processed = 0;
2455
- if (e.key) {
2456
- if (e.key.length === 1 && userSearchFocus == 0) { Q('UserSearchInput').value = ((Q('UserSearchInput').value + e.key)); processed = 1; }
2457
- if (e.keyCode == 8 && userSearchFocus == 0) { var x = Q('UserSearchInput').value; Q('UserSearchInput').value = x.substring(0, x.length - 1); processed = 1; }
2458
- if (e.keyCode == 27) { Q('UserSearchInput').value = ''; processed = 1; }
2459
- } else {
2460
- if (e.charCode != 0 && userSearchFocus == 0) { Q('UserSearchInput').value = ((Q('UserSearchInput').value + String.fromCharCode(e.charCode))); processed = 1; }
2461
- }
2462
- if (processed > 0) { if (processed == 1) { onUserSearchInputChanged(); } return haltEvent(e); }
2463
- }
2464
- if (xxdialogMode || xxcurrentView != 1) return;
2465
- if (e.ctrlKey == true && e.charCode == 96) {
2466
- showRealNames = !showRealNames;
2467
- Q('RealNameCheckBox').value = showRealNames;
2468
- putstore('showRealNames', showRealNames ? 1 : 0);
2469
- masterUpdate(6)
2470
- return;
2471
- }
2472
- if (e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
2473
- if (Q('viewselect').value < 3) {
2474
- var processed = 0;
2475
- if (e.key) {
2476
- if (e.key.length === 1 && searchFocus == 0) { Q('SearchInput').value = ((Q('SearchInput').value + e.key)); processed = 1; }
2477
- if (e.keyCode == 8 && searchFocus == 0) { var x = Q('SearchInput').value; Q('SearchInput').value = x.substring(0, x.length - 1); processed = 1; }
2478
- if (e.keyCode == 27) { Q('SearchInput').value = ''; processed = 1; }
2479
- } else {
2480
- if (e.charCode != 0 && searchFocus == 0) { Q('SearchInput').value = ((Q('SearchInput').value + String.fromCharCode(e.charCode))); processed = 1; }
2481
- }
2482
- if (processed > 0) { if (processed == 1) { masterUpdate(5); } return haltEvent(e); }
2483
- }
2484
- if (Q('viewselect').value == 3) {
2485
- if (e.key) {
2486
- if (e.key.length === 1 && mapSearchFocus == 0) { Q('mapSearchLocation').value = ((Q('mapSearchLocation').value + e.key)); processed = 1; }
2487
- //if (e.keyCode == 8 && mapSearchFocus == 0) { var x = Q('mapSearchLocation').value; Q('mapSearchLocation').value = x.substring(0, x.length - 1); processed = 1; }
2488
- if (e.keyCode == 27) { Q('mapSearchLocation').value = ''; mapCloseSearchWindow(); processed = 1; }
2489
- if (e.keyCode == 13) { getSearchLocation(); }
2490
- } else {
2491
- if (e.charCode != 0 && mapSearchFocus == 0) { Q('mapSearchLocation').value = ((Q('mapSearchLocation').value + String.fromCharCode(e.charCode))); processed = 1; }
2492
- }
2493
- }
2494
- }
2495
-
2496
- function ondockeydown(e) {
2497
- setSessionActivity();
2498
- if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) {
2499
- // Check what keys we are allows to send
2500
- if (currentNode != null) {
2501
- var mesh = meshes[currentNode.meshid];
2502
- var meshrights = mesh.links[userinfo._id].rights;
2503
- var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0)));
2504
- if (inputAllowed == false) return false;
2505
- var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0)));
2506
- if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; }
2507
- }
2508
- return desktop.m.handleKeyDown(e);
2509
- }
2510
- if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) { terminal.m.TermHandleKeyDown(e); if ((e.keyCode >= 37) && (e.keyCode <= 40)) { haltEvent(e); } }
2511
- if (!xxdialogMode && xxcurrentView == 13 && e.keyCode == 116 && p13filetree != null) { haltEvent(e); return false; } // F5 Refresh on files
2512
- if (!xxdialogMode && ((xxcurrentView == 15) || (xxcurrentView == 115))) { return agentConsoleHandleKeys(e); }
2513
- if (!xxdialogMode && xxcurrentView == 4) {
2514
- if (e.keyCode === 8 && userSearchFocus == 0) { var x = Q('UserSearchInput').value; Q('UserSearchInput').value = (x.substring(0, x.length - 1)); processed = 1; }
2515
- if (e.keyCode === 27) { Q('UserSearchInput').value = ''; processed = 1; }
2516
- if (processed > 0) { if (processed == 1) { masterUpdate(5); } return haltEvent(e); }
2517
- }
2518
- if (xxdialogMode || xxcurrentView != 1 || e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
2519
- var processed = 0;
2520
- if (Q('viewselect').value < 3) {
2521
- if (e.keyCode === 8 && searchFocus == 0) { var x = Q('SearchInput').value; Q('SearchInput').value = (x.substring(0, x.length - 1)); processed = 1; }
2522
- if (e.keyCode === 27) { Q('SearchInput').value = ''; processed = 1; }
2523
- if (processed > 0) { if (processed == 1) { masterUpdate(5); } return haltEvent(e); }
2524
- }
2525
- if (Q('viewselect').value == 3) {
2526
- if (e.keyCode === 8 && mapSearchFocus == 0) { var x = Q('mapSearchLocation').value; Q('mapSearchLocation').value = (x.substring(0, x.length - 1)); processed = 1; }
2527
- if (e.keyCode === 27) { Q('mapSearchLocation').value = ''; mapCloseSearchWindow(); processed = 1; }
2528
- }
2529
- }
2530
-
2531
- function ondockeyup(e) {
2532
- setSessionActivity();
2533
- if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked) {
2534
- // Check what keys we are allows to send
2535
- if (currentNode != null) {
2536
- var mesh = meshes[currentNode.meshid];
2537
- var meshrights = mesh.links[userinfo._id].rights;
2538
- var inputAllowed = ((meshrights == 0xFFFFFFFF) || (((meshrights & 8) != 0) && ((meshrights & 256) == 0)));
2539
- if (inputAllowed == false) return false;
2540
- var limitedInputAllowed = ((meshrights != 0xFFFFFFFF) && (((meshrights & 8) != 0) && ((meshrights & 256) == 0) && ((meshrights & 4096) != 0)));
2541
- if (limitedInputAllowed == true) { if ((e.altKey == true) || (e.ctrlKey == true) || ((e.keyCode < 32) && (e.keyCode != 8) && (e.keyCode != 13)) || (e.keyCode > 90)) return false; }
2542
- }
2543
- return desktop.m.handleKeyUp(e);
2544
- }
2545
- if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) { return terminal.m.TermHandleKeyUp(e); }
2546
- if (!xxdialogMode && xxcurrentView == 13 && e.keyCode == 116 && p13filetree != null) { p13folderup(9999); haltEvent(e); return false; } // F5 Refresh on files
2547
- if (!xxdialogMode && xxcurrentView == 4) { if ((e.keyCode === 8 && searchFocus == 0) || e.keyCode === 27) { return haltEvent(e); } }
2548
- if (xxdialogMode && e.keyCode == 27) { dialogclose(0); }
2549
- if (xxdialogMode || xxcurrentView != 0 || e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
2550
- if (Q('viewselect').value < 3) { if ((e.keyCode === 8 && searchFocus == 0) || e.keyCode === 27) { return haltEvent(e); } }
2551
- if (Q('viewselect').value == 3) { if ((e.keyCode === 8 && mapSearchFocus == 0) || e.keyCode === 27) { return haltEvent(e); } }
2552
- }
2553
-
2554
- //function ondocfocus() { }
2555
- // TODO: Add handleReleaseKeys() for Intel AMT.
2556
- function ondocblur() { if (!xxdialogMode && xxcurrentView == 11 && desktop && Q('DeskControl').checked && desktop.m.handleReleaseKeys) { return desktop.m.handleReleaseKeys(); } }
2557
-
2558
- // Highlights the device being hovered
2559
- function devMouseHover(element, over) {
2560
- setSessionActivity();
2561
- var view = Q('viewselect').value;
2562
- if (view == 1) {
2563
- var e = element.children[1].children[1];
2564
- e.children[0].classList.remove('g1s');
2565
- e.children[1].classList.remove('e2s');
2566
- e.children[2].classList.remove('g2s');
2567
- if (over == 1) {
2568
- e.children[0].classList.add('g1s');
2569
- e.children[1].classList.add('e2s');
2570
- e.children[2].classList.add('g2s');
2571
- }
2572
- } else if (view == 2) {
2573
- var e = element;
2574
- e.children[2].classList.remove('g1s');
2575
- e.children[4].classList.remove('e2s');
2576
- e.children[3].classList.remove('g2s');
2577
- if (over == 1) {
2578
- e.children[2].classList.add('g1s');
2579
- e.children[4].classList.add('e2s');
2580
- e.children[3].classList.add('g2s');
2581
- }
2582
- }
2583
- }
2584
-
2585
- var deviceHeaderId = 0;
2586
- var deviceHeaderTotal = 0;
2587
- var deviceHeadersTitles = {};
2588
- var deviceHeaderCount;
2589
- var deviceHeaders = {};
2590
- var oldviewmode = 0;
2591
- function updateDevices() {
2592
- if (nodes == null) { return; }
2593
- var r = '', c = 0, current = null, count = 0, displayedMeshes = {}, view = Q('viewselect').value, groups = {}, groupCount = {};
2594
- QV('xdevices', view < 4);
2595
- QV('xdevicesmap', view == 4);
2596
- QV('devListToolbar', view < 3);
2597
- QV('kvmListToolbar', view == 3);
2598
- QV('devMapToolbar', view == 4);
2599
- QV('devListToolbarSize', view == 3);
2600
- QV('NoMeshesPanel', meshcount == 0);
2601
- //QV('devListToolbarView', (meshcount != 0) && (nodes.length > 0));
2602
- QV('devListToolbarViewIcons', (meshcount != 0) && (nodes.length > 0));
2603
- QV('devListToolbarSort', (meshcount != 0) && (nodes.length > 0) && (view < 4));
2604
- if ((meshcount == 0) || (nodes.length == 0)) { view = 1; sort = 0; }
2605
- if (view == 4) {
2606
- setTimeout( function() { if (xxmap.map != null) { xxmap.map.updateSize(); } }, 200);
2607
- // TODO
2608
- } else {
2609
- // 3 wide, list view or desktop view
2610
- deviceHeaderId = 0;
2611
- deviceHeaderCount = {};
2612
- deviceHeaderTotal = 0;
2613
- deviceHeaders = {};
2614
- deviceHeadersTitles = {};
2615
- var kvmDivs = [];
2616
-
2617
- // Perform node sort
2618
- if (sort == 0) { nodes.sort(meshSort); }
2619
- else if (sort == 1) { nodes.sort(powerSort); }
2620
- else if (sort == 2) { if (showRealNames == true) { nodes.sort(deviceHostSort); } else { nodes.sort(deviceSort); } }
2621
-
2622
- // Save the list of currently checked nodeid's
2623
- var checkedNodeids = [], elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = 0;
2624
- for (var i=0;i<elements.length;i++) { if (elements[i].checked) { checkedNodeids.push(elements[i].value); } }
2625
- if ((oldviewmode < 3) && (view == 3)) { multiDesktopFilter = checkedNodeids; }
2626
- else if ((oldviewmode == 3) && (view < 3)) { checkedNodeids = multiDesktopFilter; }
2627
-
2628
- // Compute the width of the device view.
2629
- var totalDeviceViewWidth = Q('column_l').clientWidth - 60;
2630
- var deviceBoxWidth = Math.floor(totalDeviceViewWidth / 301);
2631
- deviceBoxWidth = 301 + Math.floor((totalDeviceViewWidth - (deviceBoxWidth * 301)) / deviceBoxWidth);
2632
-
2633
- if ((view == 2) && (sort != 3)) {
2634
- r += '<table style=width:100%;margin-top:4px cellpadding=0 cellspacing=0><th style=color:gray><th style=color:gray;width:120px>' + "User" + '<th style=color:gray;width:120px>' + "Address" + '<th style=color:gray;width:100px>' + "Connectivity"; //<th style=color:gray;width:100px>State';
2635
- }
2636
-
2637
- // Go thru the list of nodes and display them
2638
- for (var i in nodes) {
2639
- var node = nodes[i];
2640
- if (node.v == false) continue;
2641
- var mesh2 = meshes[node.meshid], meshlinks = mesh2.links[userinfo._id];
2642
- if (meshlinks == null) continue;
2643
- var meshrights = meshlinks.rights;
2644
- if ((view == 3) && (mesh2.mtype == 1)) continue;
2645
- if (sort == 0) {
2646
- // Mesh header
2647
- if (node.meshid != current) {
2648
- deviceHeaderSet();
2649
- var extra = '';
2650
- if (view == 2) { r += '<tr><td colspan=5>'; }
2651
- if (meshes[node.meshid].mtype == 1) { extra = '<span class=devHeaderx>' + ", Intel® AMT only" + '</span>'; }
2652
- if ((view == 1) && (current != null)) { if (c == 2) { r += '<td><div style=width:301px></div></td>'; } if (r != '') { r += '</tr></table>'; } }
2653
- if (view == 2) { r += '<div>'; }
2654
- r += '<div class=DevSt style=width:100%;padding-top:4px><span style=float:right>';
2655
- r += '<span id=DevxHeader' + deviceHeaderId + ' class=devHeaderx></span>' + extra;
2656
- r += '</span><span id=MxMESH tabindex=0 style=cursor:pointer onclick=gotoMesh("' + node.meshid + '") onkeypress="if (event.key==\'Enter\') gotoMesh(\'' + node.meshid + '\')">' + EscapeHtml(meshes[node.meshid].name) + '</span>' + getMeshActions(mesh2, meshrights) + '</div>';
2657
- if (view == 2) { r += '</div>'; }
2658
- current = node.meshid;
2659
- displayedMeshes[current] = 1;
2660
- c = 0;
2661
- }
2662
- } else if (sort == 1) {
2663
- // Power header
2664
- var pwr = node.pwr?node.pwr:0;
2665
- if (pwr !== current) {
2666
- deviceHeaderSet();
2667
- if ((view == 1) && (current !== null)) { if (c == 2) { r += '<td><div style=width:301px></div></td>'; } if (r != '') { r += '</tr></table>'; } }
2668
-
2669
- if (view == 2) { r += '<tr><td>'; }
2670
- r += '<div class=DevSt style=width:100%;padding-top:4px><span id=DevxHeader' + deviceHeaderId + ' class=devHeaderx style=float:right></span><span>' + PowerStateStr2(node.pwr) + '</span></div>';
2671
-
2672
- current = pwr;
2673
- c = 0;
2674
- }
2675
- } else if (sort == 2) {
2676
- // Device header
2677
- if (current == null) { current = '1'; }
2678
- }
2679
-
2680
- count++;
2681
- var title = EscapeHtml(node.name);
2682
- if (title.length == 0) { title = '<i>' + "None" + '</i>'; }
2683
- if ((node.rname != null) && (node.rname.length > 0)) { title += ' / ' + EscapeHtml(node.rname); }
2684
- var name = EscapeHtml(node.name);
2685
- if (showRealNames == true && node.rname != null) name = EscapeHtml(node.rname);
2686
- if (name.length == 0) { name = '<i>' + "None" + '</i>'; }
2687
-
2688
- // Node
2689
- var icon = node.icon;
2690
- if ((!node.conn) || (node.conn == 0)) { icon += ' gray'; }
2691
- if (view == 1) {
2692
- r += '<div id=devs onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:' + deviceBoxWidth + 'px;height:50px;padding-top:1px;padding-bottom:1px><div style=width:22px;height:50%;float:left;padding-top:12px><input class="' + node.meshid + ' DeviceCheckbox" onclick=p1updateInfo() value=devid_' + node._id + ' type=checkbox></div><div style=height:100%;cursor:pointer tabindex=0 onclick=gotoDevice(\'' + node._id + '\',null,null,event) onkeypress="if (event.key==\'Enter\') gotoDevice(\'' + node._id + '\',null,null,event)"><div class="i' + icon + '" style=width:50px;float:left></div><div style=height:100%><div class=g1></div><div class=e2><div class=e1 style=width:' + (deviceBoxWidth - 100) + 'px title="' + title + '">' + name + '</div><div>' + NodeStateStr(node) + '</div></div><div class=g2></div></div></div></div>';
2693
- } else if (view == 2) {
2694
- var states = [];
2695
- if (node.conn) {
2696
- if ((node.conn & 1) != 0) { states.push('<span title=\"' + "Mesh agent is connected and ready for use." + '\">' + "Agent" + '</span>'); }
2697
- if ((node.conn & 2) != 0) { states.push('<span title=\"' + "Intel® AMT CIRA is connected and ready for use." + '\">' + "CIRA" + '</span>'); }
2698
- else if ((node.conn & 4) != 0) { states.push('<span title=\"' + "Intel® AMT is routable." + '\">' + "AMT" + '</span>'); }
2699
- if ((node.conn & 8) != 0) { states.push('<span title=\"' + "Mesh agent is reachable using another agent as relay." + '\">' + "Relay" + '</span>'); }
2700
- if ((node.conn & 16) != 0) { states.push('<span title=\"' + "MQTT connection to the device is active." + '\">' + "MQTT" + '</span>'); }
2701
- }
2702
- r += '<tr><td><div id=devs class=bar18 tabindex=0 onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=height:18px;width:100%;font-size:medium onkeypress="if (event.key==\'Enter\') gotoDevice(\'' + node._id + '\',null,null,event)">';
2703
- r += '<div class=deviceBarCheckbox><input class="' + node.meshid + ' DeviceCheckbox" onclick=p1updateInfo() value=devid_' + node._id + ' type=checkbox></div>';
2704
- r += '<div class=deviceBarIcon onclick=gotoDevice(\'' + node._id + '\',null,null,event)><div class=\"j' + icon + '\" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>';
2705
- r += '<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>';
2706
- r += '<div style=cursor:pointer;font-size:14px title="' + title + '" onclick=gotoDevice(\'' + node._id + '\',null,null,event)><span style=width:300px>' + name + '</span></div></div></td>';
2707
- r += '<td style=text-align:center>' + getUserShortStr(node);
2708
- r += '<td style=text-align:center>' + (node.ip != null ? node.ip : '');
2709
- r += '<td style=text-align:center>' + states.join(' + ');
2710
- //r += '<td style=text-align:center>' + (node.pwr != null ? powerStateStrings[node.pwr] : '');
2711
- r += '</tr>';
2712
- } else if ((view == 3) && (node.conn & 1) && (((meshrights & 8) || (meshrights & 256)) != 0) && ((node.agent.caps & 1) != 0)) { // Check if we have rights and agent is capable of KVM.
2713
- if ((multiDesktopFilter) && ((multiDesktopFilter.length == 0) || (multiDesktopFilter.indexOf('devid_' + node._id) >= 0))) {
2714
- r += '<div id=devs style=display:inline-block;margin:1px;background-color:lightgray;border-radius:5px;position:relative><div tabindex=0 style=padding:3px;cursor:pointer onclick=gotoDevice(\'' + node._id + '\',11,null,event) onkeypress="if (event.key==\'Enter\') gotoDevice(\'' + node._id + '\',11,null,event)">';
2715
- //r += '<input class="' + node.meshid + ' DeviceCheckbox" onclick=p1updateInfo() value=devid_' + node._id + ' type=checkbox style=float:left>';
2716
- r += '<div class="j' + icon + '" style=width:16px;float:left></div> ' + name + '</div>';
2717
- r += '<span onclick=gotoDevice(\'' + node._id + '\',null,null,event)></span><div id=xkvmid_' + node._id.split('/')[2] + '><div id=skvmid_' + node._id.split('/')[2] + ' tabindex=0 style="position:absolute;color:white;left:5px;top:27px;text-shadow:0px 0px 5px #000;z-index:1000;cursor:default" onclick=toggleKvmDevice(\'' + node._id + '\') onkeypress="if (event.key==\'Enter\') toggleKvmDevice(\'' + node._id + '\')">' + "Disconnected" + '</div></div>';
2718
- r += '</div>';
2719
- kvmDivs.push(node._id);
2720
- }
2721
- }
2722
-
2723
- // If we are displaying devices by group, put the device in the right group.
2724
- if ((sort == 3) && (r != '')) {
2725
- if (node.tags) {
2726
- for (var j in node.tags) {
2727
- var tag = node.tags[j];
2728
- if (groups[tag] == null) { groups[tag] = r; groupCount[tag] = 1; } else { groups[tag] += r; groupCount[tag] += 1; }
2729
- if (view == 3) break;
2730
- }
2731
- }
2732
- r = '';
2733
- }
2734
-
2735
- deviceHeaderTotal++;
2736
- if (typeof deviceHeaderCount[node.state] == 'undefined') { deviceHeaderCount[node.state] = 1; } else { deviceHeaderCount[node.state]++; }
2737
- }
2738
-
2739
- // Above 32 devices, gray out the auto connect feature.
2740
- if (kvmDivs.length >= 32) { Q('autoConnectDesktopCheckbox').checked = false; }
2741
- QE('autoConnectDesktopCheckbox', kvmDivs.length < 32);
2742
-
2743
- // If displaying devices by groups, sort the group names and display the devices.
2744
- if (sort == 3) {
2745
- if (view == 2) { r = '<table style=width:100%;margin-top:4px cellpadding=0 cellspacing=0><th style=color:gray><th style=color:gray;width:120px>' + "User" + '<th style=color:gray;width:120px>' + "Address" + '<th style=color:gray;width:100px>' + "Connectivity"; }
2746
-
2747
- var groupNames = [];
2748
- for (var i in groups) { groupNames.push(i); }
2749
- groupNames.sort(function (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); });
2750
- for (var j in groupNames) {
2751
- var i = groupNames[j];
2752
- if (view == 2) {
2753
- r += '<tr><td colspan=4><div class=DevSt style=width:100%;padding-top:4px><span class=devHeaderx style=float:right>' + groupCount[i] + ' node' + ((groupCount[i] > 1) ? 's' : '') + '</span><span>' + i + '</span></div>' + groups[i];
2754
- } else {
2755
- r += '<div class=DevSt style=width:100%;padding-top:4px><span class=devHeaderx style=float:right>' + groupCount[i] + ' node' + ((groupCount[i] > 1) ? 's' : '') + '</span><span>' + i + '</span></div>' + groups[i];
2756
- }
2757
- }
2758
- }
2759
-
2760
- // If there is nothing to display, explain the problem
2761
- if ((r == '') && (meshcount > 0) && (Q('SearchInput').value != '')) {
2762
- if (sort == 3) {
2763
- r = '<div style="margin:30px">' + "No devices are included in any groups, click on a device\'s \"Groups\" to add to a group." + '</div>';
2764
- } else {
2765
- r = '<div style="margin:30px">' + "No devices matching this search." + '</div>';
2766
- }
2767
- }
2768
-
2769
- if ((view == 1) && (c == 2)) r += '<td><div style=width:301px></div></td>'; // Adds device padding
2770
-
2771
- // Display all empty device groups, we need to do this because users can add devices to these at any time.
2772
- if ((sort == 0) && (Q('SearchInput').value == '') && (view < 3)) {
2773
- for (var i in meshes) {
2774
- var mesh = meshes[i], meshlink = mesh.links[userinfo._id];
2775
- if (meshlink != null) {
2776
- var meshrights = meshlink.rights;
2777
- if (displayedMeshes[mesh._id] == null) {
2778
- if ((current != '') && (r != '')) { r += '</tr></table>'; }
2779
- r += '<table style=width:100%;padding-top:4px cellpadding=0 cellspacing=0><tr><td colspan=3 class=DevSt><span id=MxMESH style=cursor:pointer onclick=gotoMesh("' + mesh._id + '")>' + EscapeHtml(mesh.name) + '</span><span>';
2780
- r += getMeshActions(mesh, meshrights);
2781
- r += '</span></td></tr><tr>';
2782
- if (mesh.mtype == 1) {
2783
- r += '<td><div style=padding:10px><i>' + "No Intel® AMT devices in this mesh";
2784
- if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addDeviceToMesh(\"' + mesh._id + '\")\'>' + "add one" + '</a>'; }
2785
- }
2786
- if (mesh.mtype == 2) {
2787
- r += '<td><div style=padding:10px><i>' + "No devices in this group";
2788
- if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addAgentToMesh(\"' + mesh._id + '\")\'>' + "add one" + '</a>'; }
2789
- }
2790
- r += '.</i></div></td>';
2791
- current = mesh._id;
2792
- count++;
2793
- }
2794
- }
2795
- }
2796
- }
2797
- r += '</tr></table><div style=height:1px></div>'; // This height of 1 div fixes a problem in Linux firefox browsers
2798
-
2799
- // Add a "Add Device Group" option
2800
- r += '<div style=border-top-style:solid;border-top-width:1px;border-top-color:#DDDDDD;cursor:pointer;font-size:10px>';
2801
- if ((view < 3) && (sort == 0) && (meshcount > 0) && ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 64) == 0))) {
2802
- r += '<a href=# onclick="return account_createMesh()" title=\"' + "Create a new group of devices." + '\" style=cursor:pointer>' + "Add Device Group" + '</a> ';
2803
- }
2804
- if ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 128) == 0)) {
2805
- r += '<a href=# onclick=\'return p10showMeshCmdDialog(0)\' style=cursor:pointer title=\"' + "Download MeshCmd, a command line tool that performs many functions." + '\">' + "MeshCmd" + '</a> ';
2806
- if (navigator.platform.toLowerCase() == 'win32') { r += '<a href=# onclick=\'return p10showMeshRouterDialog()\' style=cursor:pointer title=\"' + "Download MeshCentral Router, a TCP port mapping tool." + '\">' + "Router" + '</a> '; }
2807
- }
2808
- r += '</div><br/>';
2809
-
2810
- QH('xdevices', r);
2811
- deviceHeaderSet();
2812
-
2813
- // Re-check nodeid's
2814
- var elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = 0;
2815
- if (checkedNodeids) { for (var i=0;i<elements.length;i++) { elements[i].checked = (checkedNodeids.indexOf(elements[i].value) >= 0); } }
2816
-
2817
- for (var i in deviceHeaders) { QH(i, deviceHeaders[i]); }
2818
- for (var i in deviceHeadersTitles) { Q(i).title = deviceHeadersTitles[i]; }
2819
- p1updateInfo();
2820
-
2821
- // Take care of KVM surfaces in desktop view mode
2822
- if (view == 3) {
2823
- // Figure out and adjust the size to fill the width of the div
2824
- var vsize = [{ x: 180, y: 101 }, { x: 302, y: 169 }, { x: 454, y: 255 }][Q('sizeselect').selectedIndex];
2825
- //var realw = vsize.x + 2, tw = Q('xdevices').clientWidth - 30, xw = Math.floor(tw / realw);
2826
- var realw = vsize.x + 2, tw = totalDeviceViewWidth - 5, xw = Math.floor(tw / realw);
2827
- xw = realw + Math.floor((tw - (xw * realw)) / xw);
2828
- vsize.y = vsize.y * (xw / vsize.x);
2829
- vsize.x = xw;
2830
-
2831
- for (var i in multiDesktop) { multiDesktop[i].xxdelete = true; }
2832
- for (var i in kvmDivs) {
2833
- var id = kvmDivs[i], shortid = id.split('/')[2], desk = multiDesktop[id];
2834
- if (desk != null) {
2835
- // This device already has a canvas, use it.
2836
- desk.m.CanvasId.setAttribute('style', 'background-color:black;width:' + vsize.x + 'px;height:' + vsize.y + 'px');
2837
- Q('xkvmid_' + shortid).appendChild(desk.m.CanvasId);
2838
- delete desk.xxdelete;
2839
- QH('skvmid_' + shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][((desk.m.State == null)?desk.m.state:desk.m.State)]);
2840
- } else {
2841
- var node = getNodeFromId(id);
2842
- if ((desktopNode == node) && (desktop != null)) { // Check if the main desktop is this device, if it is, use that.
2843
- // This device already has a canvas, use it.
2844
- var c = desktop.m.CanvasId;
2845
- c.setAttribute('id', 'kvmid_' + shortid);
2846
- c.setAttribute('style', 'background-color:black;width:' + vsize.x + 'px;height:' + vsize.y + 'px');
2847
- c.setAttribute('onclick', 'toggleKvmDevice(\'' + id + '\')');
2848
- c.removeAttribute('onmousedown');
2849
- c.removeAttribute('onmouseup');
2850
- c.removeAttribute('onmousemove');
2851
- Q('xkvmid_' + shortid).appendChild(c);
2852
- QH('skvmid_' + shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][((desktop.m.State == null)?desktop.m.state:desktop.m.State)]);
2853
- if (desktop.m.SendCompressionLevel) { desktop.m.SendCompressionLevel(1, multidesktopsettings.quality, multidesktopsettings.scaling, multidesktopsettings.framerate); }
2854
- desktop.shortid = shortid;
2855
- desktop.onStateChanged = onMultiDesktopStateChange;
2856
- multiDesktop[id] = desktop;
2857
- desktop = desktopNode = currentNode = null;
2858
- // Setup a replacement desktop
2859
- QH('DeskParent', '<canvas id="Desk" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>');
2860
- } else {
2861
- // This is a new device, create a canvas for it.
2862
- var c = document.createElement('canvas');
2863
- c.setAttribute('id', 'kvmid_' + shortid);
2864
- c.setAttribute('width', 640);
2865
- c.setAttribute('height', 480);
2866
- c.setAttribute('oncontextmenu', 'return false');
2867
- c.setAttribute('style', 'background-color:black;width:' + vsize.x + 'px;height:' + vsize.y + 'px');
2868
- c.setAttribute('onclick', 'toggleKvmDevice(\'' + id + '\')');
2869
- try { Q('xkvmid_' + shortid).appendChild(c); } catch (ex) {}
2870
- // Check if we need to auto-connect
2871
- if (Q('autoConnectDesktopCheckbox').checked == true) { setTimeout(function() { connectMultiDesktop(node, 1); }, 100); }
2872
- }
2873
- }
2874
- }
2875
- for (var i in multiDesktop) {
2876
- // If a device is no longer viewed, disconnect it.
2877
- if (multiDesktop[i].xxdelete == true) { multiDesktop[i].Stop(); delete multiDesktop[i]; }
2878
- else if (debugmode && multiDesktop[i].m && multiDesktop[i].m.onScreenSizeChange) {
2879
- mdeskAdjust(multiDesktop[i].m, multiDesktop[i].m.ScreenWidth, multiDesktop[i].m.ScreenHeight, multiDesktop[i].m.CanvasId); // Adjust screen size change
2880
- }
2881
- }
2882
- deskAdjust();
2883
- } else {
2884
- disconnectAllKvmFunction();
2885
- Q('autoConnectDesktopCheckbox').checked = false;
2886
- }
2887
- }
2888
- oldviewmode = view;
2889
- }
2890
-
2891
- function toggleKvmDevice(node) {
2892
- if (typeof node == 'string') { node = getNodeFromId(node); } // Convert nodeid to node if needed
2893
- var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights;
2894
- if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights
2895
- //var conn = 0;
2896
- //if ((node.conn & 1) != 0) { conn = 1; } else if ((node.conn & 6) != 0) { conn = 2; } // Check what type of connect we can do (Agent vs AMT)
2897
- if (node.conn & 1) { connectMultiDesktop(node, 1); }
2898
- }
2899
- }
2900
-
2901
- function getUserShortStr(node) {
2902
- if (node == null || node.users == null || node.users.length == 0) return '';
2903
- if (node.users.length > 1) { return '<span title="' + EscapeHtml(node.users.join(', ')) + '">' + nobreak(format("{0} users", node.users.length)) + '</span>'; }
2904
- var u = node.users[0], su = u, i = u.indexOf('\\');
2905
- if (i > 0) { su = u.substring(i + 1); }
2906
- su = EscapeHtml(su);
2907
- if (su.length > 15) { su = su.substring(0, 14) + '…'; }
2908
- return '<span title="' + EscapeHtml(u) + '">' + su + '</span>';
2909
- }
2910
-
2911
- function autoConnectDesktops() { if (Q('autoConnectDesktopCheckbox').checked == true) { connectAllKvmFunction(); } }
2912
- function connectAllKvmFunction(force) {
2913
- if (xxdialogMode) return false;
2914
- if (force !== true) { // We need to count how many devices will need to be connected, if it's a lot, prompt first.
2915
- var count = 0;
2916
- for (var i in nodes) {
2917
- var node = nodes[i], nodeid = nodes[i]._id;
2918
- if (multiDesktop[nodeid] == null) {
2919
- var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights;
2920
- if ((meshrights & 8) || (meshrights & 256)) { // Requires remote control rights or desktop view only rights
2921
- //var conn = 0;
2922
- //if ((node.conn & 1) != 0) { conn = 1; } else if ((node.conn & 6) != 0) { conn = 2; } // Check what type of connect we can do (Agent vs AMT)
2923
- if (node.conn & 1) { count++; }
2924
- }
2925
- }
2926
- }
2927
- if (count > 8) { setDialogMode(2, "Connect All", 3, function() { connectAllKvmFunction(true); }, format("Are you sure you want to connect to {0} devices?", count)); return; }
2928
- }
2929
-
2930
- // Perform connect all
2931
- for (var i in nodes) { if (multiDesktop[nodes[i]._id] == null) { toggleKvmDevice(nodes[i]._id); } }
2932
- }
2933
- function disconnectAllKvmFunction() { if (xxdialogMode) return false; for (var nodeid in multiDesktop) { multiDesktop[nodeid].Stop(); } multiDesktop = {}; }
2934
- function onMultiDesktopStateChange(desk, state) { try { QH('skvmid_' + desk.shortid, ["Disconnected", "Connecting...", "Setup...", '', ''][state]); } catch (ex) {} }
2935
-
2936
- function showMultiDesktopSettings() {
2937
- QV('d7amtkvm', false);
2938
- QV('d7meshkvm', true);
2939
- d7bitmapquality.value = multidesktopsettings.quality;
2940
- d7bitmapscaling.value = multidesktopsettings.scaling;
2941
- if (multidesktopsettings.framerate) { d7framelimiter.value = multidesktopsettings.framerate; } else { d7framelimiter.value = 1000; }
2942
- setDialogMode(7, "Remote Desktop Settings", 3, showMultiDesktopSettingsChanged);
2943
- }
2944
-
2945
- function showMultiDesktopSettingsChanged() {
2946
- multidesktopsettings.quality = d7bitmapquality.value;
2947
- multidesktopsettings.scaling = d7bitmapscaling.value;
2948
- multidesktopsettings.framerate = d7framelimiter.value;
2949
- localStorage.setItem('multidesktopsettings', JSON.stringify(multidesktopsettings));
2950
- // Make changes to all current connections
2951
- for (var i in multiDesktop) { multiDesktop[i].m.SendCompressionLevel(1, multidesktopsettings.quality, multidesktopsettings.scaling, multidesktopsettings.framerate); }
2952
- }
2953
-
2954
- function connectMultiDesktop(node, contype) {
2955
- var nodeid = node._id, shortid = nodeid.split('/')[2];
2956
- var desk = multiDesktop[nodeid];
2957
- if (desk == null) {
2958
- if (Q('kvmid_' + shortid) == null) return; // Check if this device is being displayed, if not, exit now.
2959
- if (contype == 2) {
2960
- // Setup the Intel AMT remote desktop
2961
- if ((node.intelamt.user == null) || (node.intelamt.user == '')) { return; }
2962
- desk = CreateAmtRedirect(CreateAmtRemoteDesktop('kvmid_' + shortid), authCookie);
2963
- desk.shortid = shortid;
2964
- //desk.debugmode = debugmode;
2965
- desk.onStateChanged = onMultiDesktopStateChange;
2966
- desk.m.bpp = 1;
2967
- desk.m.useZRLE = true;
2968
- desk.m.showmouse = true;
2969
- desk.m.onKvmData = function (data) { console.log('KVM Data received in multi-desktop mode, this is not supported.'); }; // KVM Data Channel not supported in multi-desktop right now.
2970
- //desk.m.onScreenSizeChange = deskAdjust;
2971
- if (debugmode > 0) { desk.m.onScreenSizeChange = mdeskAdjust; } // Multi-Desktop Adjust
2972
- desk.Start(nodeid, 16994, '*', '*', 0);
2973
- desk.contype = 2;
2974
- multiDesktop[nodeid] = desk;
2975
- } else if (contype == 1) {
2976
- // Setup the Mesh Agent remote desktop
2977
- desk = CreateAgentRedirect(meshserver, CreateAgentRemoteDesktop('kvmid_' + shortid), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
2978
- desk.shortid = shortid;
2979
- desk.attemptWebRTC = attemptWebRTC;
2980
- desk.onStateChanged = onMultiDesktopStateChange;
2981
- //desk.onConsoleMessageChange = function () { console.log('CONSOLEMSG:', desk.consoleMessage); }
2982
- desk.m.CompressionLevel = multidesktopsettings.quality;
2983
- desk.m.ScalingLevel = multidesktopsettings.scaling;
2984
- desk.m.FrameRateTimer = multidesktopsettings.framerate;
2985
- //desk.m.onDisplayinfo = deskDisplayInfo;
2986
- //desk.m.onScreenSizeChange = deskAdjust;
2987
- if (debugmode > 0) { desk.m.onScreenSizeChange = mdeskAdjust; } // Multi-Desktop Adjust
2988
- desk.Start(nodeid);
2989
- desk.contype = 1;
2990
- multiDesktop[nodeid] = desk;
2991
- }
2992
- } else {
2993
- // Disconnect and clean up the remote desktop
2994
- desk.Stop();
2995
- delete multiDesktop[nodeid];
2996
- }
2997
- }
2998
-
2999
- function getMeshActions(mesh, meshrights) {
3000
- if ((meshrights & 4) == 0) return '';
3001
- var r = '';
3002
- if ((features & 1024) == 0) { // If CIRA is allowed
3003
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Add a new Intel® AMT computer that is located on the internet." + '\" onclick=\'return addCiraDeviceToMesh(\"' + mesh._id + '\")\'>' + "Add CIRA" + '</a>';
3004
- }
3005
- if (mesh.mtype == 1) {
3006
- if ((features & 1) == 0) { // If not WAN-Only
3007
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Add a new Intel® AMT computer that is located on the local network." + '\" onclick=\'return addDeviceToMesh(\"' + mesh._id + '\")\'>' + "Add Local" + '</a>';
3008
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Add a new Intel® AMT computer by scanning the local network." + '\" onclick=\'return addAmtScanToMesh(\"' + mesh._id + '\")\'>' + "Scan Network" + '</a>';
3009
- }
3010
- if (mesh.amt && (mesh.amt.type == 2)) { // CCM activation
3011
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Perform Intel AMT client control mode (CCM) activation." + '\" onclick=\'return showCcmActivation(\"' + mesh._id + '\")\'>' + "Activation" + '</a>';
3012
- } else if (mesh.amt && (mesh.amt.type == 3) && ((features & 0x00100000) != 0)) { // ACM activation
3013
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Perform Intel AMT admin control mode (ACM) activation." + '\" onclick=\'return showAcmActivation(\"' + mesh._id + '\")\'>' + "Activation" + '</a>';
3014
- }
3015
- }
3016
- if (mesh.mtype == 2) {
3017
- r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Add a new computer to this mesh by installing the mesh agent." + '\" onclick=\'return addAgentToMesh(\"' + mesh._id + '\")\'>' + "Add Agent" + '</a>';
3018
- if ((features & 2) == 0) { r += ' <a href=# style=cursor:pointer;font-size:10px title=\"' + "Invite someone to install the mesh agent on this mesh." + '\" onclick=\'return inviteAgentToMesh(\"' + mesh._id + '\")\'>' + "Invite" + '</a>'; }
3019
- }
3020
- return r;
3021
- }
3022
-
3023
- function addDeviceToMesh(meshid) {
3024
- if (xxdialogMode) return false;
3025
- var mesh = meshes[meshid];
3026
- var x = format("Add a new Intel® AMT device to device group \"{0}\".", EscapeHtml(mesh.name)) + '<br /><br />';
3027
- x += addHtmlValue("Device Name", '<input id=dp1devicename style=width:230px maxlength=32 autocomplete=off onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');
3028
- x += addHtmlValue("Hostname", '<input id=dp1hostname style=width:230px maxlength=32 autocomplete=off placeholder=\"' + "Same as device name" + '\" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');
3029
- x += addHtmlValue("Username", '<input id=dp1username style=width:230px maxlength=32 autocomplete=off placeholder=\"' + "admin" + '\" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');
3030
- x += addHtmlValue("Password", '<input id=dp1password type=password style=width:230px autocomplete=off maxlength=32 onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');
3031
- x += addHtmlValue("Security", '<select id=dp1tls style=width:236px><option value=0>' + "No TLS security" + '</option><option value=1>' + "TLS security required" + '</option></select>');
3032
- setDialogMode(2, "Add Intel® AMT device", 3, addDeviceToMeshEx, x, meshid);
3033
- validateDeviceToMesh();
3034
- Q('dp1devicename').focus();
3035
- return false;
3036
- }
3037
-
3038
- // Intel AMT CCM Activation
3039
- function showCcmActivation(meshid) {
3040
- if (xxdialogMode) return false;
3041
- var servername = serverinfo.name, mesh = meshes[meshid];
3042
- if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { 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.
3043
- var url, domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
3044
- if (serverinfo.https == true) {
3045
- var portStr = (serverinfo.port == 443) ? '' : (':' + serverinfo.port);
3046
- url = 'wss://' + servername + portStr + domainUrl;
3047
- } else {
3048
- var portStr = (serverinfo.port == 80) ? '' : (':' + serverinfo.port);
3049
- url = 'ws://' + servername + portStr + domainUrl;
3050
- }
3051
- var x = format("Perform Intel AMT client control mode (CCM) activation to group \"{0}\" by downloading the MeshCMD tool and running it like this:", EscapeHtml(mesh.name)) + '<br /><br />';
3052
- x += '<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtccm --url ' + url + 'amtactivate?id=' + meshid.split('/')[2] + ' --serverhttpshash ' + serverinfo.tlshash + '</textarea>';
3053
- setDialogMode(2, "Intel® AMT activation", 9, null, x);
3054
- Q('idx_dlgOkButton').focus();
3055
- return false;
3056
- }
3057
-
3058
- // Intel AMT ACM Activation
3059
- function showAcmActivation(meshid) {
3060
- if (xxdialogMode) return false;
3061
- var servername = serverinfo.name, mesh = meshes[meshid];
3062
- if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { 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.
3063
- var url, domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
3064
- if (serverinfo.https == true) {
3065
- var portStr = (serverinfo.port == 443) ? '' : (':' + serverinfo.port);
3066
- url = 'wss://' + servername + portStr + domainUrl;
3067
- } else {
3068
- var portStr = (serverinfo.port == 80) ? '' : (':' + serverinfo.port);
3069
- url = 'ws://' + servername + portStr + domainUrl;
3070
- }
3071
- var x = format("Perform Intel AMT admin control mode (ACM) activation to group \"{0}\" by downloading the MeshCMD tool and running it like this:", EscapeHtml(mesh.name)) + '<br /><br />';
3072
- x += '<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtacm --url ' + url + 'amtactivate?id=' + meshid.split('/')[2] + ' --serverhttpshash ' + serverinfo.tlshash + '</textarea>';
3073
- if (serverinfo.amtAcmFqdn != null) {
3074
- x += ('<div style=margin-top:8px>' + "Intel AMT will need to be set with a Trusted FQDN in MEBx or have a wired LAN on the network:" + ' <b>' + serverinfo.amtAcmFqdn.join(', ') + '</b></div>');
3075
- }
3076
- setDialogMode(2, "Intel® AMT activation", 9, null, x);
3077
- Q('idx_dlgOkButton').focus();
3078
- return false;
3079
- }
3080
-
3081
- // Display the Intel AMT scanning dialog box
3082
- function addAmtScanToMesh(meshid) {
3083
- if (xxdialogMode) return false;
3084
- var x = "Enter a range of IP addresses to scan for Intel AMT devices." + '<br /><br />';
3085
- x += addHtmlValue("IP Range", '<input id=dp1range style=width:184px value="192.168.1.0/24" onkeyup=addAmtScanToMeshKeyUp(event) /><input id=dp1rangebutton type=button value=\"' + "Scan" + '\" onclick=addAmtScanToMeshButton()></input>');
3086
- x += '<div id=dp1results style="width:100%;height:200px;background-color:white;border:1px gray solid;overflow-y:scroll"></div>';
3087
- setDialogMode(2, "Scan for Intel® AMT devices", 3, addAmtScanToMeshEx, x, meshid);
3088
- QE('idx_dlgOkButton', false);
3089
- QH('dp1results', '<div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>');
3090
- focusTextBox('dp1range');
3091
- return false;
3092
- }
3093
-
3094
- function addAmtScanToMeshKeyUp(e) {
3095
- if (e.keyCode == 13) { haltEvent(e); addAmtScanToMeshButton(); }
3096
- }
3097
-
3098
- // Called when OK is pressed on the Intel AMT scanning box
3099
- function addAmtScanToMeshEx(button, meshid) {
3100
- var elements = document.getElementsByClassName('DevScanCheckbox'), checkcount = 0;
3101
- for (var i=0;i<elements.length;i++) {
3102
- if (elements[i].checked) {
3103
- var ipaddr = elements[i].getAttribute('tag');
3104
- var amtinfo = amtScanResults[ipaddr];
3105
- meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: ipaddr, hostname: amtinfo.hostname, amtusername: '', amtpassword: '', amttls: amtinfo.tls });
3106
- }
3107
- }
3108
- }
3109
-
3110
- // If the user presses the "Scan" button on the Intel AMT scanning dialog box, start a scan.
3111
- function addAmtScanToMeshButton() {
3112
- QE('dp1range', false);
3113
- QE('dp1rangebutton', false);
3114
- QH('dp1results', '<div style=width:100%;text-align:center;margin-top:12px>' + "Scanning..." + '</div>');
3115
- meshserver.send({ action: 'scanamtdevice', range: Q('dp1range').value });
3116
- }
3117
-
3118
- // Called when a scanned computer is checked or unchecked.
3119
- function addAmtScanToMeshCheckbox() {
3120
- var elements = document.getElementsByClassName('DevScanCheckbox'), checkcount = 0;
3121
- for (var i=0;i<elements.length;i++) { if (elements[i].checked) checkcount++; }
3122
- QE('idx_dlgOkButton', checkcount > 0);
3123
- }
3124
-
3125
- function addCiraDeviceToMesh(meshid) {
3126
- if (xxdialogMode) return false;
3127
- var mesh = meshes[meshid];
3128
-
3129
- // Replace non alphabetic characters (@ and $) with 'X' because MPS username cannot accept it.
3130
- var meshidx = meshid.split('/')[2].replace(/\@/g, 'X').replace(/\$/g, 'X');
3131
-
3132
- var y = '<select id=dlgAddCiraSel onclick=dlgAddCiraSelClick() style=width:230px><option value=0>' + "MeshCommander Script" + '</option><option value=1>' + "Manual Username/Password" + '</option>';
3133
- if ((features & 16) == 0) { y += ('<option value=2>' + "Manual Certificate" + '</option></select>'); } // Only display this option if Intel AMT CIRA with Mutual-Auth is allowed.
3134
-
3135
- var x = '';
3136
- x += addHtmlValue("Setup Method", y);
3137
- x += '<hr>';
3138
-
3139
- // Setup CIRA using a MeshCommander script (Pretty Simple)
3140
- x += '<div id=dlgAddCira0>' + format("To add a new Intel® AMT device to device group \"{0}\" with CIRA, download the following script files and use <a href='http://meshcommander.com' rel='noreferrer noopener' target='_blank'>MeshCommander</a> to run the script to configure computers.", EscapeHtml(mesh.name)) + '<br /><br />';
3141
- //x += addHtmlValue('Setup CIRA', '<a href="mescript.ashx?type=1&meshid=' + meshidx.substring(0, 16) + '" download>cira_setup.mescript</a>');
3142
- x += addHtmlValue("Setup CIRA", '<a href="mescript.ashx?type=1&meshid=' + meshid + '" download>cira_setup.mescript</a>');
3143
- x += addHtmlValue("Cleanup CIRA", '<a href="mescript.ashx?type=2" download>cira_clean.mescript</a>');
3144
- x += '</div>';
3145
-
3146
- // Setup CIRA with user/pass authentication (Somewhat difficult)
3147
- x += '<div id=dlgAddCira1 style=display:none>' + format("To add a new Intel® AMT device to device group \"{0}\" with CIRA, load the following certificate as trusted root within Intel AMT", EscapeHtml(mesh.name));
3148
- if (serverinfo.mpspass) { x += (" and authenticate to the server using this username and password." + '<br /><br />'); } else { x += (" and authenticate to the server using this username and any password." + '<br /><br />'); }
3149
- x += addHtmlValue("Root Certificate", '<a href=\"' + "MeshServerRootCert.cer" + '\" download>' + "Root Certificate File" + '</a>');
3150
- x += addHtmlValue("Username", '<input style=width:230px readonly value="' + meshidx.substring(0, 16) + '" />');
3151
- if (serverinfo.mpspass) { x += addHtmlValue("Password", '<input style=width:230px readonly value="' + EscapeHtml(serverinfo.mpspass) + '" />'); }
3152
- if (serverinfo != null) { x += addHtmlValue("MPS Server", '<input style=width:230px readonly value="' + EscapeHtml(serverinfo.mpsname) + ':' + serverinfo.mpsport + '" />'); }
3153
- x += '</div>';
3154
-
3155
- // Setup CIRA with certificate authentication (Really difficult, only if TLS offload is not used)
3156
- if ((features & 16) == 0) {
3157
- x += '<div id=dlgAddCira2 style=display:none>' + format("To add a new Intel® AMT device to device group \"{0}\" with CIRA, load the following certificate as trusted root within Intel AMT, authenticate using a client certificate with the following common name and connect to the following server.", EscapeHtml(mesh.name)) + '<br /><br />';
3158
- x += addHtmlValue("Root Certificate", '<a href="MeshServerRootCert.cer" download>' + "Root Certificate File" + '</a>');
3159
- x += addHtmlValue("Organization", '<input style=width:230px readonly value="' + meshidx + '" />');
3160
- if (serverinfo != null) { x += addHtmlValue("MPS Server", '<input style=width:230px readonly value="' + EscapeHtml(serverinfo.mpsname) + ':' + serverinfo.mpsport + '" />'); }
3161
- x += '</div>';
3162
- }
3163
-
3164
- setDialogMode(2, "Add Intel® AMT CIRA device", 2, null, x, 'fileDownload');
3165
- Q('dlgAddCiraSel').focus();
3166
- return false;
3167
- }
3168
-
3169
- function dlgAddCiraSelClick() {
3170
- var val = Q('dlgAddCiraSel').value;
3171
- QV('dlgAddCira0', val == 0);
3172
- QV('dlgAddCira1', val == 1);
3173
- QV('dlgAddCira2', val == 2);
3174
- }
3175
-
3176
- // Return true is the input string looks like an email address
3177
- function checkEmail(str) {
3178
- var x = str.split('@');
3179
- var ok = ((x.length == 2) && (x[0].length > 0) && (x[1].split('.').length > 1) && (x[1].length > 2));
3180
- if (ok == true) { var y = x[1].split('.'); for (var i in y) { if (y[i].length == 0) { ok = false; } } }
3181
- return ok;
3182
- }
3183
-
3184
- function inviteAgentToMesh(meshid) {
3185
- if (xxdialogMode) return false;
3186
- var x = '', mesh = meshes[meshid];
3187
- if (features & 64) {
3188
- x += addHtmlValue("Invitation Type", '<select id=d2InviteType onchange=d2ChangedInviteType() style=width:236px><option value=0>Link invitation</option><option value=1>Email invitation</option></select>') + '<hr />';
3189
- x += '<div id=emailInviteDiv style=display:none>' + format("Invite someone to install the mesh agent. An email with be sent with the link to the mesh agent installation for the \"{0}\" device group.", EscapeHtml(mesh.name)) + '<br /><br />';
3190
- x += addHtmlValue("Name (optional)", '<input id=agentInviteName value="" style=width:230px maxlength=64 />');
3191
- x += addHtmlValue("Email", '<input id=agentInviteEmail style=width:230px placeholder=\"' + "example@email.com" + '\" onkeyup=validateAgentInvite()></input>');
3192
- x += addHtmlValue("Operating System", '<select id=agentInviteNameOs onchange=d2ChangedInviteType() style=width:236px><option value=4>' + "Send installation link" + '</option><option value=0 selected>' + "Any supported" + '</option><option value=1>' + "Windows only" + '</option><option value=3>' + "Apple MacOS only" + '</option><option value=2>' + "Linux only" + '</option></select>');
3193
- x += '<div id=d2agentexpirediv>';
3194
- x += addHtmlValue("Link Expiration", '<select id=agentInviteExpire style=width:236px><option value=1>' + "1 hour" + '</option><option value=8>' + "8 hours" + '</option><option value=24>' + "1 day" + '</option><option value=168>' + "1 week" + '</option><option value=5040>' + "1 month" + '</option><option value=0>' + "Unlimited" + '</option></select>');
3195
- x += '</div>';
3196
- x += addHtmlValue("Installation Type", '<select id=agentInviteType style=width:236px><option value=0>' + "Background and interactive" + '</option><option value=2>' + "Background only" + '</option><option value=1>' + "Interactive only" + '</option></select>');
3197
- x += addHtmlValue("Message" + '<br />' + "(optional)", '<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>');
3198
- x += '</div>';
3199
- }
3200
- x += '<div id=urlInviteDiv>' + format("Invite someone to install the mesh agent by sharing an invitation link. This link points the user to installation instructions for the \"{0}\" device group. The link is public and no account for this server is needed.", EscapeHtml(mesh.name)) + '<br /><br />';
3201
- x += addHtmlValue("Link Expiration", '<select id=d2inviteExpire style=width:236px onchange=d2RequestInvitationLink()><option value=1>' + "1 hour" + '</option><option value=8>' + "8 hours" + '</option><option value=24>' + "1 day" + '</option><option value=168>' + "1 week" + '</option><option value=5040>' + "1 month" + '</option><option value=0>' + "Unlimited" + '</option></select>');
3202
- x += '<div id=agentInvitationLinkDiv style="text-align:center;font-size:large;margin:16px;display:none"><a href=# id=agentInvitationLink target="_blank" style=cursor:pointer></a> <img src=images/link4.png height=10 width=10 title=\"' + "Copy link to clipboard" + '\" style=cursor:pointer onclick=d2CopyInviteToClip()></div></div>';
3203
- setDialogMode(2, "Invite", 3, performAgentInvite, x, meshid);
3204
- if (features & 64) { Q('d2InviteType').focus(); d2ChangedInviteType(); } else { Q('d2inviteExpire').focus(); validateAgentInvite(); }
3205
- d2RequestInvitationLink();
3206
- return false;
3207
- }
3208
-
3209
- function d2RequestInvitationLink() {
3210
- meshserver.send({ action: 'createInviteLink', meshid: xxdialogTag, expire: parseInt(Q('d2inviteExpire').value), flags: 0 });
3211
- }
3212
-
3213
- function d2ChangedInviteType() {
3214
- QV('urlInviteDiv', Q('d2InviteType').value == 0);
3215
- QV('d2agentexpirediv', Q('agentInviteNameOs').value == 4);
3216
- QV('emailInviteDiv', Q('d2InviteType').value == 1);
3217
- validateAgentInvite();
3218
- }
3219
-
3220
- function d2CopyInviteToClip() { copyTextToClip(Q('agentInvitationLink').href); }
3221
-
3222
- function validateAgentInvite() {
3223
- if ((features & 64) && (Q('d2InviteType').value == 1)) {
3224
- QE('idx_dlgOkButton', checkEmail(Q('agentInviteEmail').value));
3225
- QV('idx_dlgCancelButton', true);
3226
- } else {
3227
- QE('idx_dlgOkButton', true);
3228
- QV('idx_dlgCancelButton', false);
3229
- }
3230
- }
3231
-
3232
- function performAgentInvite(button, meshid) {
3233
- if ((features & 64) && (Q('d2InviteType').value == 1)) {
3234
- meshserver.send({ action: 'inviteAgent', meshid: meshid, email: Q('agentInviteEmail').value, name: Q('agentInviteName').value, os: Q('agentInviteNameOs').value, flags: Q('agentInviteType').value, msg: Q('agentInviteMessage').value, expire: parseInt(Q('agentInviteExpire').value) });
3235
- }
3236
- }
3237
-
3238
- function addAgentToMesh(meshid) {
3239
- if (xxdialogMode) return false;
3240
- var mesh = meshes[meshid], x = '', installType = 0;
3241
- x += addHtmlValue("Operating System", '<select id=aginsSelect onchange=addAgentToMeshClick() style=width:236px><option value=0>' + "Windows" + '</option><option value=1>' + "Linux / BSD" + '</option><option value=2>' + "Apple MacOS" + '</option><option value=3>' + "Windows (UnInstall)" + '</option><option value=4>' + "Linux / BSD (UnInstall)" + '</option></select>');
3242
- x += '<div id=aginsTypeDiv>';
3243
- 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>');
3244
- x += '</div><hr>';
3245
-
3246
- // \/:*?"<>|
3247
- var meshfilename = mesh.name
3248
- meshfilename = meshfilename.split('\\').join('').split('/').join('').split(':').join('').split('*').join('').split('?').join('').split('"').join('').split('<').join('').split('>').join('').split('|').join('').split(' ').join('').split('\'').join('');
3249
-
3250
- // Windows agent install
3251
- //x += "<div id=agins_windows>To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and configuration file and install the agent on the computer to manage.<br /><br />";
3252
- x += '<div id=agins_windows>' + format("To add a new computer to device group \"{0}\", download the mesh agent and install it the computer to manage. This agent has server and device group information embedded within it.", EscapeHtml(mesh.name)) + '<br /><br />';
3253
- x += addHtmlValue("Mesh Agent", '<a id=aginsw32lnk href="meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=0" download onclick="setDialogMode(0)" title=\"' + "32bit version of the MeshAgent" + '\">' + "Windows (.exe)" + '</a> <img src=images/link4.png height=10 width=10 title="Copy Windows 32bit agent URL to clipboard" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=",1)>');
3254
- x += addHtmlValue("Mesh Agent", '<a id=aginsw64lnk href="meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=0" download onclick="setDialogMode(0)" title=\"' + "64bit version of the MeshAgent" + '\">' + "Windows x64 (.exe)" + '</a> <img src=images/link4.png height=10 width=10 title="Copy Windows 64bit agent URL to clipboard" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=",1)>');
3255
- if (debugmode > 0) { x += addHtmlValue("Settings File", '<a id=aginswmshlnk href="meshsettings?id=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank">' + format("{0} settings (.msh)", EscapeHtml(mesh.name)) + '</a>'); }
3256
- x += '</div>';
3257
-
3258
- // Linux agent install
3259
- x += '<div id=agins_linux style=display:none>' + format("To add a computer to {0} run the following command. Root credentials will be needed.", EscapeHtml(mesh.name)) + '<br />';
3260
- x += '<textarea id=agins_linux_area rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>';
3261
- x += '<div style=\'font-size:x-small\'>' + "* For BSD, run \"pkg install wget sudo bash\" first." + '</div></div>';
3262
-
3263
- // MacOS agent install
3264
- x += '<div id=agins_osx style=display:none>' + format("To add a new computer to device group \"{0}\", download the mesh agent and install it the computer to manage. This agent installer has server and device group information embedded within it.", EscapeHtml(mesh.name)) + '<br /><br />';
3265
- x += addHtmlValue("Mesh Agent", '<a href="meshosxagent?id=16&meshid=' + meshid.split('/')[2] + '" rel="noreferrer noopener" target="_blank" title="64bit version of MacOS Mesh Agent">MacOS Agent (64bit)</a> <img src=images/link4.png height=10 width=10 title="' + "Copy MacOS agent URL to clipboard" + '" style=cursor:pointer onclick=copyAgentUrl("meshosxagent?id=16&meshid=' + meshid.split('/')[2] + '",0)>');
3266
- x += '</div>';
3267
-
3268
- // Windows agent uninstall
3269
- x += '<div id=agins_windows_un style=display:none>' + "To remove a mesh agent, download the file below, run it and click \"uninstall\"." + '<br /><br />';
3270
- x += addHtmlValue("Mesh Agent", '<a href="meshagents?id=3" download onclick="setDialogMode(0)" title="' + "32bit version of the MeshAgent" + '">' + "Windows (.exe)" + '</a>');
3271
- x += addHtmlValue("Mesh Agent", '<a href="meshagents?id=4" download onclick="setDialogMode(0)" title="' + "64bit version of the MeshAgent" + '">' + "Windows x64 (.exe)" + '</a>');
3272
- x += '</div>';
3273
-
3274
- // Linux agent uninstall
3275
- x += '<div id=agins_linux_un style=display:none>' + "To remove a mesh agent, run the following command. Root credentials will be needed." + '<br />';
3276
- x += '<textarea id=agins_linux_area_un rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>';
3277
- x += '</div>';
3278
-
3279
- setDialogMode(2, "Add Mesh Agent", 2, null, x, 'fileDownload');
3280
- var servername = serverinfo.name;
3281
- if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { 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.
3282
- var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
3283
-
3284
- if (serverinfo.https == true)
3285
- {
3286
- var portStr = (serverinfo.port == 443)?'':(':' + serverinfo.port);
3287
- if ((features & 0x2000) == 0)
3288
- {
3289
- Q('agins_linux_area').value = '(wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-check-certificate -O ./meshinstall.sh || wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\' || ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\'\r\n';
3290
- Q('agins_linux_area_un').value = '(wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-check-certificate -O ./meshinstall.sh || wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n';
3291
- }
3292
- else
3293
- {
3294
- // Server asked that agent be installed to preferably not use a HTTP proxy.
3295
- Q('agins_linux_area').value = 'wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\' || ./meshinstall.sh https://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\'\r\n';
3296
- Q('agins_linux_area_un').value = 'wget https://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n';
3297
- }
3298
- }
3299
- else
3300
- {
3301
- var portStr = (serverinfo.port == 80) ? '' : (':' + serverinfo.port);
3302
- if ((features & 0x2000) == 0)
3303
- {
3304
- Q('agins_linux_area').value = '(wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 -O ./meshinstall.sh || wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\'\r\n';
3305
- Q('agins_linux_area_un').value = '(wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 -O ./meshinstall.sh || wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n';
3306
- }
3307
- else
3308
- {
3309
- // Server asked that agent be installed to preferably not use a HTTP proxy.
3310
- Q('agins_linux_area').value = 'wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://' + servername + portStr + domainUrlNoSlash + ' \'' + meshid.split('/')[2] + '\'\r\n';
3311
- Q('agins_linux_area_un').value = 'wget http://' + servername + portStr + domainUrl + 'meshagents?script=1 --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n';
3312
- }
3313
- }
3314
- Q('aginsSelect').focus();
3315
- addAgentToMeshClick();
3316
- return false;
3317
- }
3318
-
3319
- function copyAgentUrl(url,addflag) {
3320
- var servername = serverinfo.name;
3321
- if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { 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.
3322
- var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
3323
- var portStr = (serverinfo.port == 443) ? '' : (':' + serverinfo.port);
3324
- var c = 'https://' + servername + portStr + domainUrl + url;
3325
- if (addflag == 1) c += Q('aginsType').value;
3326
- copyTextToClip(c);
3327
- }
3328
-
3329
- function addAgentToMeshClick() {
3330
- var v = Q('aginsSelect').value;
3331
- QV('agins_windows', v == 0);
3332
- QV('agins_linux', v == 1);
3333
- QV('agins_osx', v == 2);
3334
- QV('agins_windows_un', v == 3);
3335
- QV('agins_linux_un', v == 4);
3336
- QV('aginsTypeDiv', v == 0);
3337
-
3338
- // Fix the links if needed
3339
- Q('aginsw32lnk').href = (Q('aginsw32lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value;
3340
- Q('aginsw64lnk').href = (Q('aginsw64lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value;
3341
- if (debugmode > 0) { Q('aginswmshlnk').href = (Q('aginswmshlnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; }
3342
- }
3343
-
3344
- function validateDeviceToMesh() {
3345
- QE('idx_dlgOkButton', (Q('dp1devicename').value.length > 0) && (passwordcheck(Q('dp1password').value)));
3346
- }
3347
-
3348
- function addDeviceToMeshEx(button, meshid) {
3349
- var amtuser = Q('dp1username').value;
3350
- if (amtuser == '') amtuser = 'admin';
3351
- var host = Q('dp1hostname').value;
3352
- if (host == '') host = Q('dp1devicename').value;
3353
- meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: Q('dp1devicename').value, hostname: host, amtusername: amtuser, amtpassword: Q('dp1password').value, amttls: Q('dp1tls').value });
3354
- }
3355
-
3356
- function deviceHeaderSet() {
3357
- if (deviceHeaderId == 0) { deviceHeaderId = 1; return; }
3358
- deviceHeaders['DevxHeader' + deviceHeaderId] = ((deviceHeaderTotal == 1) ? "1 node" : format("{0} nodes", deviceHeaderTotal));
3359
- //var title = '';
3360
- //for (x in deviceHeaderCount) { if (title.length > 0) title += ', '; title += deviceHeaderCount[x] + ' ' + PowerStateStr2(x); }
3361
- //deviceHeadersTitles["DevxHeader" + deviceHeaderId] = title;
3362
- deviceHeaderId++;
3363
- deviceHeaderCount = {};
3364
- deviceHeaderTotal = 0;
3365
- }
3366
-
3367
- var powerStateStrings = ['', '<span title=\"' + "Device is powered on." + '\">' + "Powered" + '</span>', '<span title=\"' + "Device is in sleep state (S1)." + '\">' + "Sleeping" + '</span>', '<span title=\"' + "Device is in sleep state (S2)." + '\">' + "Sleeping" + '</span>', '<span title=\"' + "Device is in deep sleep state (S3)." + '\">' + "Deep Sleep" + '</span>', '<span title=\"' + "Device is in hibernating state (S4)." + '\">' + "Hibernating" + '</span>', '<span title=\"' + "Device is in powered off state (S5)." + '\">' + "Soft-Off" + '</span>', '<span title=\"' + "Device is detected but power state could not be obtained." + '\">' + "Present" + '</span>'];
3368
- var powerStateStrings2 = ['', "Device is powered", "Device is in sleep state (S1)", "Device is in sleep state (S2)", "Device is in deep sleep state (S3)", "Device is hibernating (S4)", "Device is in soft-off state (S5)", "Device is present, but power state cannot be determined"];
3369
- var powerColorTable = ['pwsTransparent', 'pwsBlack', 'pwsBlue', 'pwsBlue2', 'pwsLightblue', 'pwsBlueviolet', 'pwsDarkgreen', 'pwsLightseagreen', 'pwsLightseagreen2'];
3370
- function NodeStateStr(node) {
3371
- var states = [];
3372
- if (node.state > 0 && node.state < powerStatetable.length) state.push(powerStatetable[node.state]);
3373
- if (node.conn) {
3374
- if ((node.conn & 1) != 0) { states.push('<span title=\"' + "Mesh agent is connected and ready for use." + '\">' + "Agent" + '</span>'); }
3375
- if ((node.conn & 2) != 0) { states.push('<span title=\"' + "Intel® AMT CIRA is connected and ready for use." + '\">' + "CIRA" + '</span>'); }
3376
- else if ((node.conn & 4) != 0) { states.push('<span title=\"' + "Intel® AMT is routable." + '\">' + "AMT" + '</span>'); }
3377
- if ((node.conn & 8) != 0) { states.push('<span title=\"' + "Mesh agent is reachable using another agent as relay." + '\">' + "Relay" + '</span>'); }
3378
- if ((node.conn & 16) != 0) { states.push('<span title=\"' + "MQTT connection to the device is active." + '\">' + "MQTT" + '</span>'); }
3379
- }
3380
- if ((node.pwr != null) && (node.pwr != 0)) { states.push(powerStateStrings[node.pwr]); }
3381
- return states.join(', ');
3382
- }
3383
-
3384
- function PowerStateStr(x) {
3385
- if (x < powerStatetable.length) return powerStatetable[x];
3386
- return '';
3387
- }
3388
-
3389
- function PowerStateStr2(x) {
3390
- if ((x != 0) && (x < powerStatetable.length)) return powerStatetable[x];
3391
- return "Unknown";
3392
- }
3393
-
3394
- function selectallButtonFunction() {
3395
- var elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = 0;
3396
- for (var i=0;i<elements.length;i++) { if (elements[i].checked === true) checkcount++; }
3397
- for (var i=0;i<elements.length;i++) { elements[i].checked = (checkcount == 0); }
3398
- p1updateInfo();
3399
- }
3400
-
3401
- function p1updateInfo() {
3402
- var elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = 0;
3403
- for (var i=0;i<elements.length;i++) { if (elements[i].checked === true) { checkcount++; } }
3404
- if (checkcount > 0) {
3405
- QE('GroupActionButton', true);
3406
- Q('SelectAllButton').value = "Select None";
3407
- QV('cxmgroupsplit', true);
3408
- QV('cxmdesktop', true);
3409
- } else {
3410
- QE('GroupActionButton', false);
3411
- Q('SelectAllButton').value = "Select All";
3412
- QV('cxmgroupsplit', false);
3413
- QV('cxmdesktop', false);
3414
- }
3415
- }
3416
-
3417
- function groupActionFunction() {
3418
- var addedOptions = '', nodeids = getCheckedDevices();
3419
-
3420
- // Check if any of the selected devices have a MQTT connection active
3421
- if (features & 0x00400000) {
3422
- for (var i in nodeids) { if ((getNodeFromId(nodeids[i]).conn & 16) != 0) { addedOptions += '<option value=103>' + "Send MQTT Message" + '</option>'; break; } }
3423
- }
3424
-
3425
- // Display the "Uninstall Agent" option if allowed and we selected connected devices.
3426
- for (var i in nodeids) {
3427
- var node = getNodeFromId(nodeids[i]);
3428
- var mesh = meshes[node.meshid];
3429
- var meshrights = mesh.links[userinfo._id].rights;
3430
- if (((node.conn & 1) != 0) && ((meshrights & 32768) != 0)) { addedOptions += '<option value=104>' + "Uninstall Agent" + '</option>'; break; }
3431
- }
3432
-
3433
- var x = "Select an operation to perform on all selected devices. Actions will be performed only with proper rights." + '<br /><br />';
3434
- x += addHtmlValue("Operation", '<select id=d2groupop><option value=100>' + "Wake-up devices" + '</option><option value=4>' + "Sleep devices" + '</option><option value=3>' + "Reset devices" + '</option><option value=2>' + "Power off devices" + '</option><option value=102>' + "Move to device group" + '</option>' + addedOptions + '<option value=101>' + "Delete devices" + '</option></select>');
3435
- setDialogMode(2, "Group Action", 3, groupActionFunctionEx, x);
3436
- }
3437
-
3438
- // Get the list of checked devices, removes any duplicates.
3439
- function getCheckedDevices() {
3440
- var nodeids = [], elements = document.getElementsByClassName("DeviceCheckbox"), checkcount = 0;
3441
- for (var i=0;i<elements.length;i++) { if (elements[i].checked) { if (elements[i].value) { var nid = elements[i].value.substring(6); if (nodeids.indexOf(nid) == -1) { nodeids.push(nid); } } } }
3442
- return nodeids;
3443
- }
3444
-
3445
- function groupActionFunctionEx() {
3446
- var op = Q('d2groupop').value;
3447
- if (op == 100) {
3448
- // Group wake
3449
- meshserver.send({ action: 'wakedevices', nodeids: getCheckedDevices() });
3450
- } else if (op == 101) {
3451
- // Group delete, ask for confirmation
3452
- var x = "Confirm delete selected devices(s)?" + '<br /><br />';
3453
- x += '<label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelEx() />' + "Confirm" + '</label>';
3454
- setDialogMode(2, "Delete Nodes", 3, groupActionFunctionDelEx, x);
3455
- QE('idx_dlgOkButton', false);
3456
- } else if (op == 102) {
3457
- // Move computers to a different group
3458
- p10showChangeGroupDialog(getCheckedDevices());
3459
- } else if (op == 103) {
3460
- // Send MQTT Message
3461
- p10showSendMqttMsgDialog(getCheckedDevices());
3462
- } else if (op == 104) {
3463
- // Uninstall agent
3464
- p10showSendUninstallAgentDialog(getCheckedDevices());
3465
- } else {
3466
- // Power operation
3467
- meshserver.send({ action: 'poweraction', nodeids: getCheckedDevices(), actiontype: parseInt(op) });
3468
- }
3469
- }
3470
-
3471
- function d2groupActionFunctionDelEx() { QE('idx_dlgOkButton', Q('d2check').checked); }
3472
- function groupActionFunctionDelEx() { meshserver.send({ action: 'removedevices', nodeids: getCheckedDevices() }); }
3473
-
3474
- function onSortSelectChange(skipsave) {
3475
- sort = document.getElementById('sortselect').selectedIndex;
3476
- if (!skipsave) { putstore('sort', sort); }
3477
- }
3478
-
3479
- function meshSort(a, b) { if (a.meshnamel > b.meshnamel) return 1; if (a.meshnamel < b.meshnamel) return -1; if (a.meshid == b.meshid) { if (showRealNames == true) { if (a.rnamel > b.rnamel) return 1; if (a.rnamel < b.rnamel) return -1; return 0; } else { if (a.namel > b.namel) return 1; if (a.namel < b.namel) return -1; return 0; } } return 0; }
3480
- function powerSort(a, b) { var ap = a.pwr?a.pwr:0; var bp = b.pwr?b.pwr:0; if (ap > bp) return -1; if (ap < bp) return 1; if (ap == bp) { if (showRealNames == true) { if (a.rnamel > b.rnamel) return 1; if (a.rnamel < b.rnamel) return -1; return 0; } else { if (a.namel > b.namel) return 1; if (a.namel < b.namel) return -1; return 0; } } return 0; }
3481
- function deviceSort(a, b) { if (a.namel > b.namel) return 1; if (a.namel < b.namel) return -1; return 0; }
3482
- function deviceHostSort(a, b) { if (a.rnamel > b.rnamel) return 1; if (a.rnamel < b.rnamel) return -1; return 0; }
3483
- function onSearchFocus(x) { searchFocus = x; }
3484
- function onMapSearchFocus(x) { mapSearchFocus = x; }
3485
- function onUserSearchFocus(x) { userSearchFocus = x; }
3486
- function onConsoleFocus(x) { consoleFocus = x; }
3487
-
3488
- function onSearchInputChanged() {
3489
- var x = Q('SearchInput').value.toLowerCase().trim(); putstore('_search', x);
3490
- var userSearch = null, ipSearch = null, groupSearch = null;
3491
- if (x.startsWith('user:')) { userSearch = x.substring(5); }
3492
- else if (x.startsWith('u:')) { userSearch = x.substring(2); }
3493
- else if (x.startsWith('ip:')) { ipSearch = x.substring(3); }
3494
- else if (x.startsWith('group:')) { groupSearch = x.substring(6); }
3495
- else if (x.startsWith('g:')) { groupSearch = x.substring(2); }
3496
-
3497
- if (x == '') {
3498
- // No search
3499
- for (var d in nodes) { nodes[d].v = true; }
3500
- } else if (ipSearch != null) {
3501
- // IP address search
3502
- for (var d in nodes) { nodes[d].v = ((nodes[d].ip != null) && (nodes[d].ip.indexOf(ipSearch) >= 0)); }
3503
- } else if (groupSearch != null) {
3504
- // Group filter
3505
- for (var d in nodes) { nodes[d].v = (meshes[nodes[d].meshid].name.toLowerCase().indexOf(groupSearch) >= 0); }
3506
- } else if (userSearch != null) {
3507
- // User search
3508
- for (var d in nodes) {
3509
- nodes[d].v = false;
3510
- if (nodes[d].users && nodes[d].users.length > 0) { for (var i in nodes[d].users) { if (nodes[d].users[i].toLowerCase().indexOf(userSearch) >= 0) { nodes[d].v = true; } } }
3511
- }
3512
- } else {
3513
- // Device name search
3514
- try {
3515
- var rs = x.split(/\s+/).join('|'), rx = new RegExp(rs); // In some cases (like +), this can throw an exception.
3516
- for (var d in nodes) {
3517
- nodes[d].v = (rx.test(nodes[d].name.toLowerCase())) || (nodes[d].rnamel != null && rx.test(nodes[d].rnamel.toLowerCase()));
3518
- if ((nodes[d].v == false) && nodes[d].tags) {
3519
- for (var s in nodes[d].tags) {
3520
- if (rx.test(nodes[d].tags[s].toLowerCase())) {
3521
- nodes[d].v = true;
3522
- break;
3523
- } else {
3524
- nodes[d].v = false;
3525
- }
3526
- }
3527
- }
3528
- }
3529
- } catch (ex) { for (var d in nodes) { nodes[d].v = true; } }
3530
- }
3531
- }
3532
-
3533
- var contextelement = null;
3534
- function handleContextMenu(event) {
3535
- hideContextMenu();
3536
- var scrollLeft = (window.pageXOffset !== null) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
3537
- var scrollTop = (window.pageYOffset !== null) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
3538
- var elem = document.elementFromPoint(event.pageX - scrollLeft, event.pageY - scrollTop);
3539
- if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 0) && (currentNode.agent.id < 5)) {
3540
- contextelement = elem;
3541
- var contextmenudiv = document.getElementById('termShellContextMenu');
3542
- contextmenudiv.style.left = event.pageX + 'px';
3543
- contextmenudiv.style.top = event.pageY + 'px';
3544
- contextmenudiv.style.display = 'block';
3545
- } else if (elem && elem != null && elem.id == 'MxMESH') {
3546
- contextelement = elem;
3547
- var contextmenudiv = document.getElementById('meshContextMenu');
3548
- contextmenudiv.style.left = event.pageX + 'px';
3549
- contextmenudiv.style.top = event.pageY + 'px';
3550
- contextmenudiv.style.display = 'block';
3551
- } else if (elem && elem != null && elem.classList.contains('pluginTab')) {
3552
- contextelement = elem;
3553
- var contextmenudiv = document.getElementById('pluginTabContextMenu');
3554
- contextmenudiv.style.left = event.pageX + 'px';
3555
- contextmenudiv.style.top = event.pageY + 'px';
3556
- contextmenudiv.style.display = 'block';
3557
- } else {
3558
- while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
3559
- if (!elem || elem == null) return true;
3560
- contextelement = elem;
3561
- var contextmenudiv = document.getElementById('contextMenu');
3562
- contextmenudiv.style.left = event.pageX + 'px';
3563
- contextmenudiv.style.top = event.pageY + 'px';
3564
- contextmenudiv.style.display = 'block';
3565
-
3566
- // Get the node and set the menu options
3567
- var nodeid = contextelement.children[1].attributes.onclick.value;
3568
- var node = getNodeFromId(nodeid.substring(12, nodeid.length - 18));
3569
- var mesh = meshes[node.meshid];
3570
- var meshlinks = mesh.links[userinfo._id];
3571
- var meshrights = meshlinks.rights;
3572
- var consoleRights = ((meshrights & 16) != 0);
3573
-
3574
- // Check if we have terminal and file access
3575
- var terminalAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0));
3576
- var fileAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 1024) == 0));
3577
-
3578
- QV('cxdesktop', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0) || (node.intelamt && (node.intelamt.state == 2))) && ((meshrights & 8) || (meshrights & 256)));
3579
- QV('cxterminal', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (meshrights & 8) && terminalAccess);
3580
- QV('cxfiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess);
3581
- QV('cxevents', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8));
3582
- QV('cxconsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
3583
- }
3584
-
3585
- return haltEvent(event);
3586
- }
3587
-
3588
- function cmaction(action,event) {
3589
- var nodeid = contextelement.children[1].attributes.onclick.value;
3590
- nodeid = nodeid.substring(12, nodeid.length - 18);
3591
- if (action == 7) { Q('viewselect').value = 3; Q('viewselect').onchange(); Q('autoConnectDesktopCheckbox').checked = true; Q('autoConnectDesktopCheckbox').onclick(); } // Multi-Desktop
3592
- if ((action > 0) && (action < 7)) {
3593
- var panel = [0, 10, 12, 11, 13, 16, 15][action]; // (invalid), General, Desktop, Terminal, Files, Events, Console
3594
- if (event && (event.shiftKey == true)) {
3595
- // Open the device in a different tab
3596
- window.open(window.location.origin + '?node=' + nodeid.split('/')[2] + '&viewmode=' + panel + '&hide=16', 'meshcentral:' + nodeid);
3597
- } else {
3598
- // Go to the right panel
3599
- gotoDevice(nodeid, panel);
3600
-
3601
- // If possible, connect...
3602
- var mesh = meshes[currentNode.meshid];
3603
- if ((currentNode.conn & 1) && (mesh.mtype == 2)) {
3604
- if ((panel == 11) && (desktop == null) && (currentNode.agent.caps & 1)) { connectDesktop(null, 1); } // Desktop
3605
- if ((panel == 12) && (terminal == null) && (currentNode.agent.caps & 2)) { connectTerminal(null, 1); } // Terminal
3606
- if ((panel == 13) && (files == null)) { connectFiles(null); } // files
3607
- }
3608
- }
3609
- }
3610
- }
3611
-
3612
- function cmmeshaction(action) {
3613
- var meshid = contextelement.attributes.onclick.value.substring(10, contextelement.attributes.onclick.value.length - 2);
3614
- var elements = document.getElementsByClassName('DeviceCheckbox');
3615
- if ((action == 1) || (action == 2)) {
3616
- for (var i = 0; i < elements.length; i++) {
3617
- if ((elements[i].attributes) && (elements[i].attributes['class']['value'].split(' ')[0] == meshid)) { elements[i].checked = (action == 1); }
3618
- }
3619
- }
3620
- //if (action == 3) { window.location = "multidesktop.aspx?mesh=" + meshid + "&auto=1"; }
3621
- p1updateInfo();
3622
- }
3623
-
3624
- function cmtermaction(action) {
3625
- connectTerminal(null, 1, { powershell: (action == 2) });
3626
- }
3627
-
3628
- function pluginTabClose() {
3629
- var pluginTab = contextelement;
3630
- var pname = pluginTab.getAttribute('x-data-plugin-sname');
3631
- var pdiv = Q('plugin-'+pname);
3632
- pdiv.parentNode.removeChild(pdiv);
3633
- pluginTab.parentNode.removeChild(pluginTab);
3634
- QV('p7', true);
3635
- goPlugin(-1);
3636
- }
3637
-
3638
- function hideContextMenu() {
3639
- QV('contextMenu', false);
3640
- QV('meshContextMenu', false);
3641
- QV('termShellContextMenu', false);
3642
- QV('pluginTabContextMenu', false);
3643
- contextelement = null;
3644
- }
3645
-
3646
- //
3647
- // DEVICES MAP
3648
- //
3649
-
3650
- // Maps code starts from here. Initialize all the variables
3651
- var xxmap = {
3652
- map: null,
3653
- contextmenu: null,
3654
- activeInteractions: [], // Save Modified features in this list
3655
- showindex: 0,
3656
- markersSource: null, // Initialize a Source Vector
3657
- markersLayer: null,
3658
- mapLayer: null, // Create a tile and use OSM source
3659
- mapView: null, // Sets the initial view
3660
- }
3661
-
3662
- // Add a feature for every Node and change style if connection status changes
3663
- function updateMapMarkers(selectedMesh) {
3664
- if ((xxmap != null) && (xxmap.map == null)) { try { loadmap(); } catch (ex) { console.error('loadmap() exception', ex); } }
3665
- if (xxmap == null) return;
3666
- var boundingBox = null;
3667
- for (var i in nodes) {
3668
- try {
3669
- var loc = map_parseNodeLoc(nodes[i]), feature = xxmap.markersSource.getFeatureById(nodes[i]._id);
3670
- if ((loc != null) && ((nodes[i].meshid == selectedMesh) || (selectedMesh == null))) { // Draw markers for devices with locations
3671
- var lat = loc[0], lon = loc[1], type = loc[2];
3672
- if (boundingBox == null) { boundingBox = [ lat, lon, lat, lon, 0 ]; } else { if (lat < boundingBox[0]) { boundingBox[0] = lat; } if (lon < boundingBox[1]) { boundingBox[1] = lon; } if (lat > boundingBox[2]) { boundingBox[2] = lat; } if (lon > boundingBox[3]) { boundingBox[3] = lon; } }
3673
- if (feature == null) { addFeature(nodes[i]); boundingBox[4] = 1; } else { updateFeature(nodes[i], feature); feature.setStyle(markerStyle(nodes[i], loc[2])); } // Update Feature
3674
- } else {
3675
- if (feature) { xxmap.markersSource.removeFeature(feature); }
3676
- }
3677
- } catch (ex) { console.error('updateMapMarkers() exception', ex, JSON.stringify(nodes[i])); }
3678
- }
3679
- return boundingBox;
3680
- }
3681
-
3682
- // Show node details on hovering over a feature
3683
- var map_cm_popup = new ol.Overlay({ element: Q('xmap-info-window'), positioning: 'bottom-center', stopEvent: false });
3684
-
3685
- // Edit Marker item
3686
- var map_cm_editMarker = { text: "Modify node location", callback: function (obj) { modifyMarkerloc(obj.data); } };
3687
-
3688
- // Clear Marker item
3689
- var map_cm_clearMarker = { text: "Remove node location", callback: function (obj) {
3690
- meshserver.send({ action: 'changedevice', nodeid: obj.data.a, userloc: [] }); // Clear the user position marker
3691
- }};
3692
-
3693
- // Save Marker item
3694
- var map_cm_saveMarker = { text: "Save node location", callback: function (obj) { saveMarkerloc(obj.data); } };
3695
-
3696
- // Build a context menu for a feature
3697
- var map_cm_nodemenu_items = [
3698
- { text: "General information", callback: function (obj) { if (obj.data !=null) { gotoDevice(obj.data, 10); } } },
3699
- { text: "Desktop", callback: function (obj) { if (obj.data !=null) { gotoDevice(obj.data, 11); } } },
3700
- { text: "Terminal", callback: function (obj) { if (obj.data !=null) { gotoDevice(obj.data, 12); } } },
3701
- { text: "Intel® AMT", callback: function (obj) { if (obj.data !=null) { gotoDevice(obj.data, 14); } } },
3702
- '-',
3703
- { text: "Zoom-in to extent", callback: function(obj) { var coords = obj.data.getGeometry().getCoordinates(); zoomToLocation(coords, 19); } },
3704
- { text: "Zoom-out to extent", callback: function(obj) { var coords = obj.data.getGeometry().getCoordinates(); zoomToLocation(coords, 2); } }
3705
- ];
3706
-
3707
- // Context menu for clicks other than on feature
3708
- var contextmenu_items = [
3709
- { text: "Refresh", callback: function () { refreshMap(true, true); } },
3710
- { text: "Zoom to fit extent", callback: function () { zoomToFitExtent(); } },
3711
- { text: "Center map here", callback: function(obj) { xxmap.mapView.animate({ center: obj.coordinate } ); } },
3712
- { text: "Place node here", callback: function(obj) { placeNode(obj.coordinate); } }
3713
- ];
3714
-
3715
- function stringToIntHash(str) {
3716
- var hash = 0, i;
3717
- for (i = 0; i < str.length; i++) { hash = ((hash << 5) - hash) + str.charCodeAt(i); hash |= 0; }
3718
- return hash;
3719
- };
3720
-
3721
- // Get the lat/lon from a node
3722
- function map_parseNodeLoc(node) {
3723
- var loc = null, t = 0;
3724
- if (node.iploc) { loc = node.iploc; t = 1; }
3725
- if (node.wifiloc) { loc = node.wifiloc; t = 2; }
3726
- if (node.gpsloc) { loc = node.gpsloc; t = 3; }
3727
- if (node.userloc) { loc = node.userloc; t = 4; }
3728
- if ((loc == null) || (typeof loc != 'string')) return null;
3729
- loc = loc.split(',');
3730
- if (t == 1) {
3731
- // If this is IP location, randomize the position a little.
3732
- return [ parseFloat(loc[0]) + (stringToIntHash(node._id.substring(0, 20)) / 100000000000), parseFloat(loc[1]) + (stringToIntHash(node._id.substring(20)) / 100000000000), t ];
3733
- } else {
3734
- // Return the real position
3735
- return [ parseFloat(loc[0]), parseFloat(loc[1]), t ];
3736
- }
3737
- }
3738
-
3739
- // Load the entire map
3740
- function loadmap() {
3741
- if (xxmap == null) return;
3742
- if ((features & 0x8000) == 0) { QV('viewselectmapoption', false); QV('devViewButton4', false); xxmap = null; return; } // Geolocation not supported
3743
- try {
3744
- // Initialize a Source Vector
3745
- xxmap.markersSource = new ol.source.Vector();
3746
-
3747
- xxmap.markersLayer = new ol.layer.Vector({
3748
- source: xxmap.markersSource
3749
- });
3750
-
3751
- // Create a tile and use OSM source
3752
- xxmap.mapLayer = new ol.layer.Tile({ source: new ol.source.OSM() });
3753
-
3754
- xxmap.mapView = new ol.View({ // Set the initial view
3755
- center: ol.proj.transform([0, 0], 'EPSG:4326', 'EPSG:3857'),
3756
- zoom: 2,
3757
- minZoom: 2,
3758
- maxZoom: 20,
3759
- extent: ol.proj.transformExtent([-100000, -69.55, 100000, 69.55], 'EPSG:4326', 'EPSG:3857')
3760
- });
3761
-
3762
- xxmap.map = new ol.Map({
3763
- target: 'xdevicesmap',
3764
- layers: [xxmap.mapLayer, xxmap.markersLayer],
3765
- view: xxmap.mapView
3766
- });
3767
-
3768
- xxmap.map.addOverlay(map_cm_popup);
3769
-
3770
- // Goto information tab if a user clicks on a feature
3771
- xxmap.map.on('click', function(evt) {
3772
- var feature = xxmap.map.forEachFeatureAtPixel(evt.pixel, function(feat, layer) { return feat; });
3773
- if (feature) {
3774
- var nodeid = feature.getId();
3775
- if (nodeid != null) { gotoDevice(nodeid, 10); } // Goto general info tab
3776
- else { // For pointer
3777
- var nodeFeatgoto = getCorrespondingFeature(feature); gotoDevice(nodeFeatgoto.getId(), 10);
3778
- }
3779
- }
3780
- });
3781
-
3782
- // On hover feature show the name of the node. Also add pointer style
3783
- xxmap.map.on('pointermove', function(evt) {
3784
- var feature = xxmap.map.forEachFeatureAtPixel(evt.pixel, function(feat, layer) { return feat; });
3785
- if (feature) {
3786
- xxmap.map.getTargetElement().style.cursor = 'pointer';
3787
- var coord = feature.getGeometry().getCoordinates();
3788
- // map_cm_popup.setPosition(evt.coordinate);
3789
- map_cm_popup.setPosition(coord);
3790
- var featid = feature.getId();
3791
- if (featid) {
3792
- QH('xmap-info-window', feature.get('name'));
3793
- } else {
3794
- var nodeFeat = getCorrespondingFeature(feature); // Return the node feature associated to pointer.
3795
- QH('xmap-info-window', nodeFeat.get('name'));
3796
- }
3797
- } else {
3798
- xxmap.map.getTargetElement().style.cursor = '';
3799
- QH('xmap-info-window', '');
3800
- }
3801
- });
3802
-
3803
- // Initialize context menu for openlayers
3804
- var contextmenu = new ContextMenu({
3805
- width: 160,
3806
- defaultItems: false, // defaultItems are Zoom In/Zoom Out
3807
- items: contextmenu_items
3808
- });
3809
-
3810
- // On right click open the context menu
3811
- contextmenu.on("open", function (evt) {
3812
- var feature = xxmap.map.forEachFeatureAtPixel(evt.pixel, function(ft, l){ return ft; });
3813
- xxmap.contextmenu.clear(); //Clear the context menu
3814
- if (feature) {
3815
- var featId = feature.getId();
3816
- if (featId) { addContextMenuItems(feature); } // Node feature will have an id
3817
- else { // If the feature is a pointer, Get its corresponding Node feature
3818
- var nodeFeature = getCorrespondingFeature(feature); //return the node feature associated to pointer.
3819
- if (nodeFeature) { addContextMenuItems(nodeFeature); }
3820
- else{ xxmap.contextmenu.extend(contextmenu_items); }
3821
- }
3822
- }
3823
- else { xxmap.contextmenu.extend(contextmenu_items); }
3824
- });
3825
- if (xxmap.contextmenu == null) { xxmap.contextmenu = contextmenu; }
3826
- xxmap.map.addControl(xxmap.contextmenu);
3827
- //addMeshOptions(); // Adds Mesh names to mesh dropdown
3828
- } catch (ex) {
3829
- console.log(ex);
3830
- QV('viewselectmapoption', false);
3831
- QV('devViewButton4', false);
3832
- xxmap = null;
3833
- }
3834
- }
3835
-
3836
- // Add feature on to Map for a Node
3837
- function addFeature(node, lat, lon) {
3838
- var existingfeature = getModifiedFeature(node._id); // Check if Corresponding feature was Modified ( Modifed feature are in active interactions list)
3839
- if (existingfeature) { xxmap.markersSource.addFeature(existingfeature); } // Add that existing feature
3840
- else { // Add new feature for this node
3841
- if (!lat && !lon) { var loc = map_parseNodeLoc(node); lat = loc[0]; lon = loc[1]; }
3842
-
3843
- // Fix the longiture and send an event to patch the db to correct coordinate format. It will cause second unnecessary updateFeature on this node to the map.
3844
- if (lon > 180) { lon = 180 - lon; meshserver.send({ action: 'changedevice', nodeid: node._id, userloc: [ lat, lon ] }); }
3845
-
3846
- if ((lat < 90) && (lat > -90) && (lon < 180) && (lon > -180)) { // Check valid lat/lon
3847
- var feature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([lon, lat], 'EPSG:4326','EPSG:3857')), name: node.name, status: node.conn, lat: lat, lon: lon });
3848
- feature.setId(node._id); // Set id for the device as nodeid
3849
- feature.setStyle(markerStyle(node));
3850
- xxmap.markersSource.addFeature(feature); // Add the feature to Marker Source
3851
- }
3852
- }
3853
- }
3854
-
3855
- // Removing any feature from map
3856
- function removeFeature(node) {
3857
- var feature = xxmap.markersSource.getFeatureById(node._id);
3858
- if (feature) { xxmap.markersSource.removeFeature(feature); }
3859
- }
3860
-
3861
- // Update feature
3862
- function updateFeature(node, feature) {
3863
- if (node.conn != feature.get('status') ) { // Update status if changed
3864
- feature.set('status',node.conn)
3865
- feature.setStyle(markerStyle(node));
3866
- }
3867
-
3868
- // Since this is IP address location, add some fixed randomness to the location. Avoid pin pile-up.
3869
- var loc = map_parseNodeLoc(node);
3870
- if (loc != null) {
3871
- var lat = loc[0], lon = loc[1];
3872
- if ((lat != feature.get('lat')) || (lon != feature.get('lon'))) { // Update lat and lon if changed
3873
- feature.set('lat', lat); feature.set('lon', lon);
3874
- var modifiedCoordinates = ol.proj.transform([parseFloat(lon), parseFloat(lat)], 'EPSG:4326', 'EPSG:3857');
3875
- feature.getGeometry().setCoordinates(modifiedCoordinates);
3876
- }
3877
- }
3878
-
3879
- if (node.name != feature.get('name') ) { feature.set('name', node.name); } // Update name
3880
- }
3881
-
3882
- // Enable dragging of a marker after edit option is clicked in context menu
3883
- function modifyMarkerloc(ft){
3884
- var featid = ft.getId();
3885
- if (featid) {
3886
- ft.setStyle(markerStyle(getNodeFromId(ft.a), 4)); // Switch to a user marker
3887
- if ( !getActiveInteractions(ft)) {
3888
- var dragInteration = new ol.interaction.Modify({
3889
- features: new ol.Collection([ft]),
3890
- pixelTolerance: 10
3891
- });
3892
- xxmap.activeInteractions.push({ featureid: featid, feature:ft, interaction: dragInteration }); // Also keep track of Interactions
3893
- xxmap.map.addInteraction(dragInteration);
3894
- }
3895
- }
3896
- }
3897
-
3898
- // This will be called when save location option is clicked in context menu
3899
- function saveMarkerloc(ft){
3900
- var featid = ft.getId()
3901
- if (featid) {
3902
- var actInteraction = getActiveInteractions(ft);
3903
- if (actInteraction) { // Check if the interaction exists
3904
- xxmap.map.removeInteraction(actInteraction); //Clear Interaction for that node
3905
- removeInteraction(featid);
3906
- var coord = ft.getGeometry().getCoordinates();
3907
- var v = ol.proj.transform(coord, 'EPSG:3857', 'EPSG:4326');
3908
- if (v[0] > 180) { v[0] = 180 - v[0]; }
3909
- var vx = [ v[1], v[0] ]; // Flip the coordinates around, lat/long
3910
- meshserver.send({ action: 'changedevice', nodeid: featid, userloc: vx }); // Send them to server to save changes
3911
- }
3912
- }
3913
- }
3914
-
3915
- // Style the Markers
3916
- function markerStyle(node, type) {
3917
- if (type == null) {
3918
- type = 0;
3919
- if (node.iploc) { type = 1; }
3920
- if (node.wifiloc) { type = 2; }
3921
- if (node.gpsloc) { type = 3; }
3922
- if (node.userloc) { type = 4; }
3923
- }
3924
- var types = ['', '-ip','-wifi','-gps','-user'];
3925
- var color = connStateColor(node);
3926
- var style = new ol.style.Style({
3927
- image: new ol.style.Icon({ color: color, anchor: [0.5, 1], src: 'images/mapmarker' + types[type] + '.png' })
3928
- //stroke: new ol.style.Stroke({ color: '#000', width: 20 })
3929
- //text: new ol.style.Text({ text: 'bob!', textAlign: 'right', offsetX: -10, fill: new ol.style.Fill({ color: '#000' }), stroke: new ol.style.Stroke({ color: '#fff', width: 2 }) })
3930
- });
3931
-
3932
- /*
3933
- deviceMark.setStyle(new ol.style.Style({
3934
- text: new ol.style.Text({
3935
- //font: '12px helvetica,sans-serif',
3936
- text: currentNode.name,
3937
- textAlign: 'right',
3938
- offsetX: -10,
3939
- fill: new ol.style.Fill({ color: '#000' }),
3940
- stroke: new ol.style.Stroke({ color: '#fff', width: 2 })
3941
- }),
3942
- image: new ol.style.Icon(({ color: [113, 140, 0], src: 'images/dot.png' })) }));
3943
- */
3944
-
3945
- return [ style ];
3946
- }
3947
-
3948
- // TODO: Add more connection status types. Currently we only change color if connection status changes
3949
- function connStateColor(nodeConn){
3950
- if (nodeConn.conn == 1 || nodeConn.conn == 3 || nodeConn.conn == 5) { return '#00ffdd'; } // Green for connected devices
3951
- return '#C70039'; // Red if the Agent is not connected
3952
- }
3953
-
3954
- // Add save/edit option to context menu
3955
- function addContextMenuItems(feature) {
3956
- if (getActiveInteractions(feature)) { // If this feature is modified then display save option in contextmenu
3957
- map_cm_saveMarker.data = feature;
3958
- xxmap.contextmenu.push(map_cm_saveMarker);
3959
- } else {
3960
- map_cm_editMarker.data = feature;
3961
- xxmap.contextmenu.push(map_cm_editMarker);
3962
- var node = getNodeFromId(feature.a);
3963
- if (node.userloc) {
3964
- map_cm_clearMarker.data = feature;
3965
- xxmap.contextmenu.push(map_cm_clearMarker);
3966
- }
3967
- }
3968
- map_cm_nodemenu_items.forEach(function (item){
3969
- if (item.text == "Zoom-in to extent" || item.text == "Zoom-out to extent") { item.data = feature; }
3970
- else { if (item != '-') { item.data = feature.getId(); } }
3971
- });
3972
- xxmap.contextmenu.extend(map_cm_nodemenu_items);
3973
- }
3974
-
3975
- // Return a active Interaction if it exists in activeInteractions list
3976
- function getActiveInteractions(feature) {
3977
- var featid = feature.getId();
3978
- for (var i = 0; i < xxmap.activeInteractions.length; i++) {
3979
- if (xxmap.activeInteractions[i].featureid == featid) { return xxmap.activeInteractions[i].interaction; }
3980
- }
3981
- return false;
3982
- }
3983
-
3984
- // Return Modified feature based on Id
3985
- function getModifiedFeature(featid) {
3986
- if (featid) {
3987
- for (var i = 0; i < xxmap.activeInteractions.length; i++) {
3988
- if (xxmap.activeInteractions[i].featureid == featid) { return xxmap.activeInteractions[i].feature; }
3989
- }
3990
- }
3991
- return null;
3992
- }
3993
-
3994
- // Remove Interaction
3995
- function removeInteraction(ftid) {
3996
- var index = -1;
3997
- for (var i = 0; i < xxmap.activeInteractions.length; i++) {
3998
- if (xxmap.activeInteractions[i].featureid === ftid) { index = i; break; }
3999
- }
4000
- if (index >= 0) { xxmap.activeInteractions.splice(index, 1); }
4001
- }
4002
-
4003
- // Check if pointer coordinates are equal to features and return node feature
4004
- function getCorrespondingFeature(pointerFeat) {
4005
- var pointerCoord = pointerFeat.getGeometry().getCoordinates();
4006
- for (var i = 0; i < xxmap.activeInteractions.length ; i++) {
4007
- var modifiedFeatures = xxmap.activeInteractions[i].feature;
4008
- var fearCoord = modifiedFeatures.getGeometry().getCoordinates();
4009
- if (fearCoord[0].toFixed(5) == pointerCoord[0].toFixed(5) && fearCoord[1].toFixed(5) == pointerCoord[1].toFixed(5) ) { return modifiedFeatures; }
4010
- }
4011
- return null;
4012
- }
4013
-
4014
- // Refresh the map and clear list
4015
- function refreshMap(reset, rebound){
4016
- if (reset) {
4017
- xxmap.map.setTarget(null);
4018
- xxmap.map = null;
4019
- xxmap.markersSource = null;
4020
- xxmap.mapView = null;
4021
- xxmap.mapLayer = null;
4022
- xxmap.activeInteractions = []; // Clear Active Interaction list
4023
- }
4024
- //clearMeshOptions();
4025
- //onSelectMeshChange();
4026
- var box = updateMapMarkers();
4027
- if ((box != null) && (rebound || (box[4] == 1))) {
4028
- var clat = (box[0] + box[2]) / 2;
4029
- var clon = (box[1] + box[3]) / 2;
4030
- var cscale = Math.max(Math.abs(box[0] - box[2]), Math.abs(box[1] - box[3]));
4031
- var view = xxmap.map.getView();
4032
- view.setCenter(ol.proj.transform([clon, clat], 'EPSG:4326', 'EPSG:3857'));
4033
- var i = 360, j = -2;
4034
- while (i > cscale) { j++; i = i / 2; }
4035
- view.setZoom(j);
4036
- }
4037
- }
4038
-
4039
- // Called When Place a node option is clicked from context menu
4040
- function placeNode(coords) {
4041
- if (xxdialogMode) return;
4042
- var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
4043
- for (var i in nodes) {
4044
- x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
4045
- x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
4046
- }
4047
- setDialogMode(2, "Select a node to place", 3, placeNodeEx, x + '</div>', coords);
4048
- onPlaceNodeInputChange();
4049
- }
4050
-
4051
- function placeNodeEx(button, coords) {
4052
- var elements = document.getElementsByName('PlaceMapDeviceCheckbox');
4053
- for (var i in elements) {
4054
- if (elements[i].checked) {
4055
- var node = getNodeFromId(elements[i].id.substring(0, elements[i].id.length - 8));
4056
- if (node) {
4057
- var feature = xxmap.markersSource.getFeatureById(i);
4058
- var v = ol.proj.transform(coords, 'EPSG:3857', 'EPSG:4326');
4059
- var vx = [ v[1], v[0] ]; // Flip the coordinates around, lat/long
4060
- if (feature) {
4061
- feature.getGeometry().setCoordinates(coords);
4062
- var activeInteraction = getActiveInteractions(feature);
4063
- if (activeInteraction) {
4064
- saveMarkerloc(feature);
4065
- } else { // If this feature is not saved after its location is changed, then send updated coords to server.
4066
- meshserver.send({ action: 'changedevice', nodeid: node._id, userloc: vx }); // Send them to server to save changes
4067
- }
4068
- } else {
4069
- meshserver.send({ action: 'changedevice', nodeid: node._id, userloc: vx }); // This Node is not yet added to maps.
4070
- }
4071
- }
4072
- }
4073
- }
4074
- }
4075
-
4076
- // Called when the user changes the search box
4077
- function onPlaceNodeInputChange() {
4078
- updatePlaceNodeTable(Q('selectnode-search').value.trim().toLowerCase());
4079
- }
4080
-
4081
- // Update the list of devices in the "place on map" table
4082
- function updatePlaceNodeTable(inputSearch) {
4083
- var elements = document.getElementsByName('PlaceMapDeviceCheckbox'), count = 0;
4084
- for (var i in nodes) {
4085
- var visible = ((nodes[i].namel.indexOf(inputSearch) >= 0 || inputSearch == '') || (nodes[i].rnamel != null && nodes[i].rnamel.indexOf(inputSearch) >= 0));
4086
- if (visible) { count++; }
4087
- QV(nodes[i]._id + '-rowid', visible);
4088
- }
4089
- QV('noNodesMapPlace', count == 0);
4090
- /*
4091
- console.log(selected);
4092
- for (var i in nodes) {
4093
- if ((nodes[i].name.toLowerCase().indexOf(inputSearch) >= 0 || inputSearch == '') || (nodes[i].rnamel != null && nodes[i].rnamel.toLowerCase().indexOf(inputSearch) >= 0)) {
4094
- console.log(selected.indexOf(nodes[i]._id));
4095
- x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline ' + ((selected.indexOf(nodes[i]._id) >= 0)?'checked':'') + ' />';
4096
- x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
4097
- }
4098
- }
4099
- if (x == '') { x = '<div style=text-align:center;width:100%>No devices found.</div>'; }
4100
- QH('placenode', '');
4101
- */
4102
- }
4103
-
4104
- // Called when a user clicks on a device to toggle selection for placement on map.
4105
- function selectNodeToPlace(e, id) {
4106
- // Toggle checkbox if needed
4107
- if (e.target.name != 'PlaceMapDeviceCheckbox') { var inputElement = Q(id + '-checkid'); inputElement.checked = !inputElement.checked; }
4108
-
4109
- // Check button state
4110
- var elements = document.getElementsByName('PlaceMapDeviceCheckbox'), checkcount = 0;
4111
- for (var i in elements) { if (elements[i].checked) checkcount++; }
4112
- QE('idx_dlgOkButton', checkcount > 0);
4113
- }
4114
-
4115
- // Add option for available meshes in mesh Dropdown
4116
- function addMeshOptions(addMeshid, meshName) {
4117
- /*
4118
- var meshOptions = Q('select-mesh');
4119
- if (addMeshid && meshName) {
4120
- var option = document.createElement('option');
4121
- option.value =addMeshid;
4122
- option.text = meshName;
4123
- meshOptions.add(option); // Add specific option
4124
- }
4125
- else {
4126
- for (var i in meshes) { // Add all options
4127
- var option = document.createElement('option');
4128
- option.value = i;
4129
- option.text = meshes[i].name;
4130
- meshOptions.add(option);
4131
- }
4132
- }
4133
- */
4134
- }
4135
-
4136
- // Remove/Modify options in Mesh dropdown (if modMeshname is defined then Modify else Remove)
4137
- function meshOptionRmvMod(delMeshid, modMeshname){
4138
- /*
4139
- var meshOptions = Q('select-mesh');
4140
- if (delMeshid) {
4141
- var index=-1;
4142
- for (var i = 1; i < meshOptions.options.length; i++) {
4143
- if (meshOptions[i].value === delMeshid) { index=i; }
4144
- }
4145
- if (index > 0) {
4146
- if (modMeshname) {
4147
- meshOptions[index].innerHTML=modMeshname; // If Mesh name is Modified
4148
- }
4149
- else { meshOptions.remove(index); }
4150
- }
4151
- }
4152
- */
4153
- }
4154
-
4155
- //Check if there is any mesh created
4156
- function meshExists() {
4157
- for (var i in meshes) { if (meshes[i]) { return true; } }
4158
- return false;
4159
- }
4160
-
4161
- // Reset Mesh dropdown option to 'All' when a current view mesh is deleted.
4162
- function setMeshView(emeshid) {
4163
- var selectMeshElement=Q('select-mesh');
4164
- var selectedIndex = selectMeshElement.selectedIndex;
4165
- if (selectMeshElement[selectedIndex].value == emeshid) { selectMeshElement[0].selected = true; onSelectMeshChange(); }
4166
- }
4167
-
4168
- // Clear all mesh options except 'All'
4169
- function clearMeshOptions() {
4170
- /*
4171
- var meshOptions=Q('select-mesh');
4172
- for(var i = meshOptions.options.length - 1 ; i > 0 ; i--) { meshOptions.remove(i); }
4173
- */
4174
- }
4175
-
4176
- // Make a http get call- Replace this with AJAX get if jquery is used
4177
- function getSearchLocation() {
4178
- try {
4179
- var searchdata = Q('mapSearchLocation').value.trim();
4180
- if (searchdata.length > 0) {
4181
- var xmlhttp = new XMLHttpRequest(); // Compatible with Chrome, Opera, Safari, IE7+, Firefox.
4182
- xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { formatSearchData(xmlhttp.responseText); } }
4183
- xmlhttp.open('GET', 'https://nominatim.openstreetmap.org/search?q=' + searchdata + '&format=json', true); // Get request
4184
- xmlhttp.send();
4185
- }
4186
- } catch (e) {}
4187
- }
4188
-
4189
- // Format data recieved from nominatim API and display it on content window
4190
- function formatSearchData(data) {
4191
- try {
4192
- QH('xmapSearchResults','');
4193
- var dataInfo = JSON.parse(data), count = 0, x = '<div class="xmapItem">';
4194
- for (var i = 0; i < dataInfo.length; i++) {
4195
- if (dataInfo[i].display_name && dataInfo[i].boundingbox[0] && dataInfo[i].boundingbox[1] && dataInfo[i].boundingbox[2] && dataInfo[i].boundingbox[3]) {
4196
- count++;
4197
- var itemclass = (i % 2 == 0)?'xmapItemSel1':'xmapItemSel1';
4198
- x += '<div class="' + itemclass + '" onclick=mapGotoSelectedLocation(this)><div>' + dataInfo[i].display_name + '</div><div style=display:none>' + dataInfo[i].boundingbox[0] + '!#!' + dataInfo[i].boundingbox[1] + '!#!' + dataInfo[i].boundingbox[2] + '!#!' + dataInfo[i].boundingbox[3] + '</div></div>';
4199
- }
4200
- }
4201
- x += '</div>';
4202
- if (count == 1) {
4203
- // If only one result is returned then zoom to that location
4204
- var extent = [ parseFloat(dataInfo[0].boundingbox[2]), parseFloat(dataInfo[0].boundingbox[0]), parseFloat(dataInfo[0].boundingbox[3]), parseFloat(dataInfo[0].boundingbox[1]) ];
4205
- zoomToExtent(extent);
4206
- } else {
4207
- if (count == 0) { x = '<div style=width:200px>' + "No location found." + '<div>'; }
4208
- QV('xmapSearchResultsDlg', true);
4209
- }
4210
- QH('xmapSearchResults', x);
4211
- }
4212
- catch (e) {}
4213
- }
4214
-
4215
- // Zoom into the bounding box
4216
- function mapGotoSelectedLocation(obj) {
4217
- var objchildren = obj.children;
4218
- var boundingBox = objchildren[1].innerHTML.split('!#!');
4219
- var extent = [parseFloat(boundingBox[2]), parseFloat(boundingBox[0]), parseFloat(boundingBox[3]), parseFloat(boundingBox[1])];
4220
- //Q('search-location').value = objchildren[0].innerHTML;
4221
- zoomToExtent(extent);
4222
- mapCloseSearchWindow();
4223
- }
4224
-
4225
- // Close the search window
4226
- function mapCloseSearchWindow() {
4227
- QH('xmapSearchResults', '');
4228
- QV('xmapSearchResultsDlg', false);
4229
- }
4230
-
4231
- // Zoom to specific cordinates
4232
- function zoomToLocation(coordinates, zoomVal) {
4233
- var view = xxmap.map.getView();
4234
- view.setCenter(coordinates);
4235
- view.setZoom(zoomVal);
4236
- }
4237
-
4238
- function zoomToFitExtent() {
4239
- var features = xxmap.markersSource.getFeatures();
4240
- if (features.length > 0) {
4241
- var extent = xxmap.markersSource.getExtent();
4242
- xxmap.map.getView().fit(extent, xxmap.map.getSize());
4243
- }
4244
- }
4245
-
4246
- function zoomToExtent(extent){
4247
- var boundingExtent = ol.proj.transformExtent(extent, ol.proj.get('EPSG:4326'), ol.proj.get('EPSG:3857'));
4248
- xxmap.map.getView().fit(boundingExtent, xxmap.map.getSize());
4249
- }
4250
-
4251
-
4252
- //
4253
- // MY DEVICE
4254
- //
4255
- function refreshDevice(nodeid) {
4256
- if (!currentNode || currentNode._id != nodeid) return;
4257
- gotoDevice(nodeid, xxcurrentView, true);
4258
- }
4259
-
4260
- function getNodeRights(nodeid) {
4261
- var node = getNodeFromId(nodeid), mesh = meshes[node.meshid];
4262
- return mesh.links[userinfo._id].rights;
4263
- }
4264
-
4265
- var currentNode;
4266
- var powerTimelineNode = null;
4267
- var powerTimelineReq = null;
4268
- var powerTimelineUpdate = null;
4269
- var powerTimeline = null;
4270
- function getCurrentNode() { return currentNode; };
4271
- function gotoDevice(nodeid, panel, refresh, event) {
4272
- // Remind the user to verify the email address
4273
- if ((userinfo.emailVerified !== true) && (serverinfo.emailcheck == true) && (userinfo.siteadmin != 0xFFFFFFFF)) { setDialogMode(2, "Account Security", 1, null, "Unable to access a device until a email address is verified. This is required for password recovery. Go to the \"My Account\" tab to change and verify an email address."); return; }
4274
-
4275
- // Remind the user to add two factor authentication
4276
- if ((features & 0x00040000) && !((userinfo.otpsecret == 1) || (userinfo.otphkeys > 0) || (userinfo.otpkeys > 0))) { setDialogMode(2, "Account Security", 1, null, "Unable to access a device until two-factor authentication is enabled. This is required for extra security. Go to the \"My Account\" tab and look at the \"Account Security\" section."); return; }
4277
-
4278
- if (event && (event.shiftKey == true)) {
4279
- // Open the device in a different tab
4280
- window.open(window.location.origin + '?node=' + nodeid.split('/')[2] + '&viewmode=10&hide=16', 'meshcentral:' + nodeid);
4281
- return;
4282
- }
4283
-
4284
- //disconnectAllKvmFunction();
4285
- var node = getNodeFromId(nodeid);
4286
- var mesh = meshes[node.meshid];
4287
- var meshrights = mesh.links[userinfo._id].rights;
4288
- if (!currentNode || currentNode._id != node._id || refresh == true) {
4289
- currentNode = node;
4290
-
4291
- // Add node name
4292
- var nname = EscapeHtml(node.name);
4293
- if (nname.length == 0) { nname = '<i>' + "None" + '</i>'; }
4294
- if (((meshrights & 4) != 0) && ((!mesh.flags) || ((mesh.flags & 2) == 0))) { nname = '<span tabindex=0 title=\"' + "Click here to edit the server-side device name" + '\" onclick=showEditNodeValueDialog(0) onkeyup="if (event.key == \'Enter\') showEditNodeValueDialog(0)" style=cursor:pointer>' + nname + ' <img class=hoverButton src="images/link5.png" /></span>'; }
4295
- nname += '<span style=color:#AAA;font-size:small> - ' + EscapeHtml(mesh.name) + '</span>';
4296
- QH('p10deviceName', nname);
4297
- QH('p11deviceName', nname);
4298
- QH('p12deviceName', nname);
4299
- QH('p13deviceName', nname);
4300
- QH('p14deviceName', nname);
4301
- QH('p15deviceName', "Console - " + nname);
4302
- QH('p16deviceName', nname);
4303
- QH('p17deviceName', nname);
4304
- QH('p19deviceName', nname);
4305
-
4306
- // Node attributes
4307
- var x = '<table style=width:100%>';
4308
-
4309
- // Attribute: Mesh
4310
- x += addDeviceAttribute('<span title=\"' + "The name of the device group this computer belong to." + '\">' + "Group" + '</span>', '<a href=# title=\"' + "The name of the device group this computer belong to" + '\" onclick=gotoMesh("' + node.meshid + '") style=cursor:pointer>' + EscapeHtml(meshes[node.meshid].name) + '</a>');
4311
-
4312
- // Attribute: Name
4313
- if ((node.rname != null) && (node.name != node.rname)) { x += addDeviceAttribute('<span title="The name of this computer as set in the operating system">Name</span>', '<span title="The name of this computer as set in the operating system">' + EscapeHtml(node.rname) + '</span>'); }
4314
-
4315
- // Attribute: Host
4316
- if ((features & 1) == 0) { // If not WAN-only, local hostname is in use
4317
- if ((meshrights & 4) != 0) {
4318
- if (node.host) {
4319
- x += addDeviceAttribute("Hostname", '<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>' + EscapeHtml(node.host) + '</span>');
4320
- } else {
4321
- x += addDeviceAttribute("Hostname", '<span onclick=showEditNodeValueDialog(1) style=cursor:pointer><i>' + "None" + '</i></span>');
4322
- }
4323
- } else {
4324
- x += addDeviceAttribute("Hostname", EscapeHtml(node.host));
4325
- }
4326
- }
4327
-
4328
- // Attribute: Description
4329
- var description = node.desc?EscapeHtml(node.desc):('<i>' + "None" + '</i>');
4330
- if ((meshrights & 4) != 0) {
4331
- x += addDeviceAttribute("Description", '<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>' + description + ' <img class=hoverButton src="images/link5.png" /></span>');
4332
- } else {
4333
- x += addDeviceAttribute("Description", description);
4334
- }
4335
-
4336
- // Attribute: Mesh Agent
4337
- var agentsStr = ["Unknown", "Windows 32bit console", "Windows 64bit console", "Windows 32bit service", "Windows 64bit service", "Linux 32bit", "Linux 64bit", "MIPS", "XENx86", "Android ARM", "Linux ARM", "MacOS 32bit", "Android x86", "PogoPlug ARM", "Android APK", "Linux Poky x86-32bit", "MacOS 64bit", "ChromeOS", "Linux Poky x86-64bit", "Linux NoKVM x86-32bit", "Linux NoKVM x86-64bit", "Windows MinCore console", "Windows MinCore service", "NodeJS", "ARM-Linaro", "ARMv6l / ARMv7l", "ARMv8 64bit", "ARMv6l / ARMv7l / NoKVM", "Unknown", "Unknown", "FreeBSD x86-64"];
4338
- if ((node.agent != null) && (node.agent.id != null) && (node.agent.ver != null)) {
4339
- var str = '';
4340
- if (node.agent.id <= agentsStr.length) { str = agentsStr[node.agent.id]; } else { str = agentsStr[0]; }
4341
- if (node.agent.ver != 0) { str += ' v' + node.agent.ver; }
4342
- x += addDeviceAttribute("Mesh Agent", str);
4343
- }
4344
-
4345
- // Attribute: Intel AMT
4346
- if (node.intelamt != null) {
4347
- var str = '';
4348
- var provisioningStates = { 0: nobreak("Not Activated (Pre)"), 1: nobreak("Not Activated (In)"), 2: nobreak("Activated") };
4349
- if (node.intelamt.ver != null && node.intelamt.state == null) { str += '<i>' + "Unknown State" + '</i>, v' + node.intelamt.ver; } else
4350
-
4351
- if ((node.intelamt.ver == null) && (node.intelamt.state == 2)) { str += '<i>' + "Activated" + '</i>'; }
4352
- else if ((node.intelamt.ver == null) || (node.intelamt.state == null)) { str += '<i>' + "Unknown Version & State" + '</i>'; }
4353
- else {
4354
- str += provisioningStates[node.intelamt.state];
4355
- if ((node.intelamt.state == 2) && node.intelamt.flags) { if (node.intelamt.flags & 2) { str += ' <span title=\"' + "Intel AMT is activated in Client Control Mode" + '\">' + "CCM" + '</span>'; } else if (node.intelamt.flags & 4) { str += ' <span title=\"' + "Intel AMT is activated in Admin Control Mode" + '\">' + "ACM" + '</span>'; } }
4356
- str += (', v' + node.intelamt.ver);
4357
- }
4358
-
4359
- if (node.intelamt.tls == 1) { str += ', <span title=\"' + "Intel AMT is setup with TLS network security" + '\">' + "TLS" + '</span>'; }
4360
- if (node.intelamt.state == 2) {
4361
- if (node.intelamt.user == null || node.intelamt.user == '') {
4362
- if ((meshrights & 4) != 0) {
4363
- str += ', <i style=color:#FF0000;cursor:pointer title=\"' + "Edit Intel® AMT credentials" + '\" onclick=editDeviceAmtSettings("' + node._id + '")>' + "No Credentials" + '</i>';
4364
- } else {
4365
- str += ', <i style=color:#FF0000>' + "No Credentials" + '</i>';
4366
- }
4367
- }
4368
- str += ' ';
4369
- if ((meshrights & 4) != 0) {
4370
- str += '<img src=images/link4.png height=10 width=10 title=\"' + "Edit Intel® AMT credentials" + '\" style=cursor:pointer onclick=editDeviceAmtSettings("' + node._id + '")>';
4371
- }
4372
- }
4373
-
4374
- var meName = '<span title=\"Intel® Manageability Engine\">' + "Intel® ME" + '<span>';
4375
- if (typeof node.intelamt.sku == 'number') {
4376
- if ((node.intelamt.sku & 8) != 0) { meName = '<span title=\"' + "Intel® Active Management Technology" + '\">' + "Intel® AMT" + '<span>'; }
4377
- else if ((node.intelamt.sku & 16) != 0) { meName = '<span title=\"' + "Intel® Standard Manageability" + '\">' + "Intel® SM" + '<span>'; }
4378
- }
4379
- x += addDeviceAttribute(meName, str);
4380
- }
4381
-
4382
- if (mesh.mtype == 2) {
4383
- // Attribute: Mesh Agent Tag
4384
- if ((node.agent != null) && (node.agent.tag != null)) {
4385
- var tag = EscapeHtml(node.agent.tag);
4386
- if (tag.startsWith('mailto:')) { tag = '<a href="' + tag + '">' + tag.substring(7) + '</a>'; }
4387
- x += addDeviceAttribute("Agent Tag", tag);
4388
- }
4389
- } else {
4390
- // Attribute: Intel AMT Tag
4391
- if ((node.intelamt != null) && (node.intelamt.tag != null)) {
4392
- var tag = EscapeHtml(node.intelamt.tag);
4393
- if (tag.startsWith('mailto:')) { tag = '<a href="' + tag + '">' + tag.substring(7) + '</a>'; }
4394
- x += addDeviceAttribute("Intel® AMT Tag", tag);
4395
- }
4396
- }
4397
-
4398
- // Attribute: Intel AMT
4399
- //if (node.intelamt && node.intelamt.user) { x += addDeviceAttribute('Intel® AMT', node.intelamt.user); }
4400
-
4401
- // Operating system description
4402
- if (node.osdesc) { x += addDeviceAttribute("Operating System", node.osdesc); }
4403
-
4404
- // Antivirus
4405
- if (node.av && node.av.length > 0) {
4406
- var y = [];
4407
- for (var i in node.av) {
4408
- if (node.av[i].product) {
4409
- var avx = EscapeHtml(node.av[i].product);
4410
- if (node.av[i].enabled !== true) { avx += ' - <span style=color:red>' + "Disabled" + '</span>'; }
4411
- if (node.av[i].updated !== true) { avx += ' - <span style=color:red>' + "Out of date" + '</span>'; }
4412
- if ((node.av[i].enabled == true) && (node.av[i].updated == true)) { avx += ' - <span style=color:green>' + "OK" + '</span>'; }
4413
- y.push(avx);
4414
- }
4415
- }
4416
- x += addDeviceAttribute("Antivirus", y.join('<br />'));
4417
- }
4418
-
4419
- // Active Users
4420
- if (node.users && node.conn && (node.users.length > 0) && (node.conn & 1)) { x += addDeviceAttribute(format("Active User{0}", ((node.users.length > 1)?'s':'')), node.users.join(', ')); }
4421
-
4422
- // Attribute: Connectivity (Only show this if more than just the agent is connected).
4423
- var connectivity = node.conn;
4424
- if (connectivity && connectivity > 1) {
4425
- var cstate = [];
4426
- if ((node.conn & 1) != 0) cstate.push('<span title=\"' + "Mesh agent is connected and ready for use." + '\">' + "Mesh Agent" + '</span>');
4427
- if ((node.conn & 2) != 0) cstate.push('<span title=\"' + "Intel® AMT CIRA is connected and ready for use." + '\">' + "Intel® AMT CIRA" + '</span>');
4428
- else if ((node.conn & 4) != 0) cstate.push('<span title=\"' + "Intel® AMT is routable and ready for use." + '\">' + "Intel® AMT" + '</span>');
4429
- if ((node.conn & 8) != 0) cstate.push('<span title=\"' + "Mesh agent is reachable using another agent as relay." + '\">' + "Mesh Relay" + '</span>');
4430
- if ((node.conn & 16) != 0) { cstate.push('<span title=\"' + "MQTT connection to the device is active." + '\">' + "MQTT" + '</span>'); }
4431
- x += addDeviceAttribute("Connectivity", cstate.join(', '));
4432
- }
4433
-
4434
- // Node grouping tags
4435
- var groupingTags = '<i>' + "None" + '</i>';
4436
- if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '<span class="tagSpan">' + node.tags[i] + '</span>'; } }
4437
- if ((meshrights & 4) != 0) {
4438
- x += addDeviceAttribute('Tags', '<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>' + groupingTags + ' <img class=hoverButton src="images/link5.png" /></span>');
4439
- } else {
4440
- x += addDeviceAttribute('Tags', groupingTags);
4441
- }
4442
-
4443
- x += '</table><br />';
4444
- // Show action button, only show if we have permissions 4, 8, 64
4445
- if ((meshrights & 76) != 0) { x += '<input type=button value=\"' + "Actions" + '\" title=\"' + "Perform power actions on the device" + '\" onclick=deviceActionFunction() />'; }
4446
- x += '<input type=button value=\"' + "Notes" + '\" title=\"' + "View notes about this device" + '\" onclick=showNotes(' + ((meshrights & 128) == 0) + ',"' + encodeURIComponent(node._id) + '") />';
4447
- x += '<input type=button value=\"' + "Log Event" + '\" title=\"' + "Write an event for this device" + '\" onclick=writeDeviceEvent("' + encodeURIComponent(node._id) + '") />';
4448
- //if ((connectivity & 1) && (meshrights & 8) && (node.agent.id < 5)) { x += '<input type=button value=Toast title="Display a text message of the remote device" onclick=deviceToastFunction() />'; }
4449
- QH('p10html', x);
4450
-
4451
- // Show node last 7 days timeline
4452
- masterUpdate(256);
4453
-
4454
- // Show bottom buttons
4455
- x = '<div class="p10html3right">';
4456
- if ((meshrights & 4) != 0) {
4457
- // TODO: Show change group only if there is another mesh of the same type.
4458
- x += ' <a href=# onclick=p10showChangeGroupDialog(["' + node._id + '"]) title=\"' + "Move this device to a different device group" + '\">' + "Change Group" + '</a>';
4459
- x += ' <a href=# onclick=p10showDeleteNodeDialog("' + node._id + '") title=\"' + "Remove this device" + '\">' + "Delete Device" + '</a>';
4460
- }
4461
- x += '</div><div class="p10html3left">';
4462
- if (mesh.mtype == 2) x += '<a href=# onclick=p10showNodeNetInfoDialog("' + node._id + '") title=\"' + "Show device network interface information" + '\">' + "Interfaces" + '</a> ';
4463
- if (xxmap != null) x += '<a href=# onclick=p10showNodeLocationDialog("' + node._id + '") title=\"' + "Show device locations information" + '\">' + "Location" + '</a> ';
4464
- if (((meshrights & 8) != 0) && (mesh.mtype == 2)) x += '<a href=# onclick=p10showMeshCmdDialog(1,"' + node._id + '") title=\"' + "Traffic router used to connect to a device thru this server" + '.\">' + "Router" + '</a> ';
4465
-
4466
- // RDP link, show this link only of the remote machine is Windows.
4467
- if (((connectivity & 1) != 0) && (clickOnce == true) && (mesh.mtype == 2) && ((meshrights & 8) != 0)) {
4468
- if ((node.agent.id > 0) && (node.agent.id < 5)) { x += '<a href=# onclick=p10clickOnce("' + node._id + '","RDP2",3389) title=\"' + "Requires Microsoft ClickOnce support in your browser" + '.\">' + "RDP" + '</a> '; }
4469
- if (node.agent.id > 4) {
4470
- x += '<a href=# onclick=p10clickOnce("' + node._id + '","PSSH",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "Putty" + '</a> ';
4471
- x += '<a href=# onclick=p10clickOnce("' + node._id + '","WSCP",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "WinSCP" + '</a> ';
4472
- }
4473
- }
4474
-
4475
- // MQTT options
4476
- if ((meshrights == 0xFFFFFFFF) && (features & 0x00400000)) { x += '<a href=# onclick=p10showMqttLoginDialog("' + node._id + '") title=\"' + "Get MQTT login credentials for this device." + '\">' + "MQTT Login" + '</a> '; }
4477
- x += '</div><br>'
4478
-
4479
- QH('p10html3', x);
4480
-
4481
- // Set the node power state
4482
- var powerstate = PowerStateStr(node.state);
4483
- //if (node.state == 0) { powerstate = 'Unknown State'; }
4484
- if ((connectivity & 1) != 0) { if (powerstate.length > 0) { powerstate += '<br/>'; } powerstate += '<span style=font-size:12px title=\"' + "Agent connected" + '\">' + "Agent connected" + '</span>'; }
4485
- if ((connectivity & 2) != 0) { if (powerstate.length > 0) { powerstate += '<br/>'; } powerstate += '<span style=font-size:12px title=\"' + "Intel® AMT connected" + '\">' + "Intel® AMT connected" + '</span>'; }
4486
- else if ((connectivity & 4) != 0) { if (powerstate.length > 0) { powerstate += '<br/>'; } powerstate += '<span style=font-size:12px title=\"' + "Intel® AMT detected" + '\">' + "Intel® AMT detected" + '</span>'; }
4487
- if ((connectivity & 16) != 0) { if (powerstate.length > 0) { powerstate += '<br/>'; } powerstate += '<span style=font-size:12px title=\"' + "MQTT connected" + '\">' + "MQTT channel connected" + '</span>'; }
4488
- if ((powerstate == '') && node.lastconnect) { powerstate = '<span style=font-size:12px>' + "Last seen:" + '<br />' + printDateTime(new Date(node.lastconnect)) + '</span>'; }
4489
- QH('MainComputerState', powerstate);
4490
-
4491
- // Set the node icon
4492
- Q('MainComputerImage').setAttribute('src', 'images/icons256-' + node.icon + '-1.png');
4493
- Q('MainComputerImage').className = ((!node.conn) || (node.conn == 0)?'gray':'');
4494
-
4495
- // Check if we have terminal and file access
4496
- var terminalAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0));
4497
- var fileAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 1024) == 0));
4498
- var amtAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 2048) == 0));
4499
-
4500
- // Setup/Refresh the desktop tab
4501
- if (terminalAccess) { setupTerminal(); }
4502
- if (fileAccess) { setupFiles(); }
4503
- var consoleRights = ((meshrights & 16) != 0);
4504
- if (consoleRights) { setupConsole(); } else { if (panel == 15) { panel = 10; } }
4505
-
4506
- // Show or hide the tabs
4507
- // mesh.mtype: 1 = Intel AMT only, 2 = Mesh Agent
4508
- // node.agent.caps (bitmask): 1 = Desktop, 2 = Terminal, 4 = Files, 8 = Console
4509
- QV('MainDevDesktop', (((mesh.mtype == 1) && ((typeof node.intelamt.sku !== 'number') || ((node.intelamt.sku & 8) != 0)))
4510
- || ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0) || (node.intelamt && (node.intelamt.state == 2)))))
4511
- && ((meshrights & 8) || (meshrights & 256))
4512
- );
4513
- QV('MainDevTerminal', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (meshrights & 8) && terminalAccess);
4514
- QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8) && fileAccess);
4515
- QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8) && amtAccess);
4516
- QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
4517
- QV('MainDevPlugins', pluginHandler != null);
4518
- QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0));
4519
- QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:'');
4520
-
4521
- // Setup/Refresh Intel AMT tab
4522
- var amtFrameNode = Q('p14iframe').contentWindow.getCurrentMeshNode();
4523
- if ((amtFrameNode != null) && (amtFrameNode._id != currentNode._id)) { Q('p14iframe').contentWindow.disconnect(); }
4524
- var online = ((node.conn & 6) != 0)?true:false; // If CIRA (2) or AMT (4) connected, enable Commander
4525
- Q('p14iframe').contentWindow.setConnectionState(online);
4526
- Q('p14iframe').contentWindow.setFrameHeight('650px');
4527
- Q('p14iframe').contentWindow.setAuthCallback(updateAmtCredentials);
4528
-
4529
- // Display "action" button on desktop/terminal/files
4530
- QV('deskActionsBtn', (meshrights & 72) != 0); // 72 = Wake-up + Remote Control permissions
4531
- QV('termActionsBtn', (meshrights & 72) != 0);
4532
- QV('filesActionsBtn', (meshrights & 72) != 0);
4533
-
4534
- // Request the power timeline
4535
- if ((powerTimelineNode != currentNode._id) && (powerTimelineReq != currentNode._id)) {
4536
- QH('p10html2', '');
4537
- powerTimelineReq = currentNode._id;
4538
- meshserver.send({ action: 'powertimeline', nodeid: currentNode._id });
4539
- meshserver.send({ action: 'lastconnect', nodeid: currentNode._id });
4540
- meshserver.send({ action: 'getsysinfo', nodeid: currentNode._id });
4541
- QH('p17info', '');
4542
- }
4543
-
4544
- // Reset the desktop tools
4545
- QV('DeskTools', false);
4546
- showDeskToolsProcesses();
4547
-
4548
- // Ask for device events
4549
- refreshDeviceEvents();
4550
-
4551
- // Update the web page title
4552
- if ((currentNode) && (xxcurrentView >= 10) && (xxcurrentView < 20)) {
4553
- document.title = decodeURIComponent('{{{extitle}}}') + ' - ' + currentNode.name + ' - ' + mesh.name;
4554
- } else {
4555
- document.title = decodeURIComponent('{{{extitle}}}');
4556
- }
4557
-
4558
- // Clear user consent status if present
4559
- p11clearConsoleMsg();
4560
- p12clearConsoleMsg();
4561
- p13clearConsoleMsg();
4562
-
4563
- // Device refresh plugin handler
4564
- if (pluginHandler != null) { pluginHandler.callHook('onDeviceRefreshEnd', nodeid, panel, refresh, event); }
4565
- }
4566
- setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
4567
- if (!panel) panel = 10;
4568
- go(panel);
4569
- }
4570
-
4571
- function writeDeviceEvent(nodeid) {
4572
- if (xxdialogMode) return;
4573
- setDialogMode(2, "Add Device Event", 3, writeDeviceEventEx, '<textarea id=d2devEvent style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>' + "This will add an entry to this device\'s event log." + '<span>', nodeid);
4574
- }
4575
-
4576
- function writeDeviceEventEx(buttons, tag) { meshserver.send({ action: 'setDeviceEvent', nodeid: decodeURIComponent(tag), msg: encodeURIComponent(Q('d2devEvent').value) }); }
4577
-
4578
- function showNotes(readonly, noteid) {
4579
- if (xxdialogMode) return;
4580
- setDialogMode(2, "Notes", 2, showNotesEx, '<textarea id=d2devNotes ro=' + readonly + ' noteid=' + noteid + ' readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>' + "Device group notes can be viewed and changed by other device group administrators." + '<span>', noteid);
4581
- meshserver.send({ action: 'getNotes', id: decodeURIComponent(noteid) });
4582
- }
4583
-
4584
- function showNotesEx(buttons, tag) { meshserver.send({ action: 'setNotes', id: decodeURIComponent(tag), notes: encodeURIComponent(Q('d2devNotes').value) }); }
4585
-
4586
- function deviceChat(e) {
4587
- if (xxdialogMode) return;
4588
- var url = '/messenger?id=meshmessenger/' + encodeURIComponent(currentNode._id) + '/' + encodeURIComponent(userinfo._id) + '&title=' + currentNode.name;
4589
- if ((authCookie != null) && (authCookie != '')) { url += '&auth=' + authCookie; }
4590
- if (e && (e.shiftKey == true)) {
4591
- window.open(url, 'meshmessenger:' + currentNode._id);
4592
- } else {
4593
- window.open(url, 'meshmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560');
4594
- }
4595
- meshserver.send({ action: 'meshmessenger', nodeid: decodeURIComponent(currentNode._id) });
4596
- }
4597
-
4598
- function deviceUrlFunction() {
4599
- if (xxdialogMode) return;
4600
- setDialogMode(2, "Open Page on Device", 3, deviceUrlFunctionEx, '<input id=d2devurl placeholder="http://server.com" style=width:100%;overflow-y:scroll></input>');
4601
- Q('d2devurl').focus();
4602
- }
4603
-
4604
- function deviceUrlFunctionEx() {
4605
- meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: Q('d2devurl').value });
4606
- }
4607
-
4608
- function deviceToastFunction() {
4609
- if (xxdialogMode) return;
4610
- setDialogMode(2, "Device Notification", 3, deviceToastFunctionEx, '<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>');
4611
- Q('d2devToast').focus();
4612
- }
4613
-
4614
- function deviceToastFunctionEx() {
4615
- meshserver.send({ action: 'toast', nodeids: [ currentNode._id ], title: 'MeshCentral', msg: Q('d2devToast').value });
4616
- }
4617
-
4618
- function deviceActionFunction() {
4619
- if (xxdialogMode) return;
4620
- var meshrights = meshes[currentNode.meshid].links[userinfo._id].rights;
4621
- var x = "Select an operation to perform on this device." + '<br /><br />';
4622
- var y = '<select id=d2deviceop style=float:right;width:250px>';
4623
- if ((meshrights & 64) != 0) { y += '<option value=100>' + "Wake-up" + '</option>'; } // Wake-up permission
4624
- if ((meshrights & 8) != 0) { y += '<option value=4>' + "Sleep" + '</option><option value=3>' + "Reset" + '</option><option value=2>' + "Power off" + '</option>'; } // Remote control permission
4625
- if ((currentNode.conn & 16) != 0) { y += '<option value=103>' + "Send MQTT Message" + '</option>'; }
4626
- if (((currentNode.conn & 1) != 0) && ((meshrights & 32768) != 0)) { y += '<option value=104>' + "Uninstall Agent" + '</option>'; }
4627
- y += '</select>';
4628
- x += addHtmlValue("Operation", y);
4629
- setDialogMode(2, "Device Action", 3, deviceActionFunctionEx, x);
4630
- }
4631
-
4632
- function deviceActionFunctionEx() {
4633
- var op = Q('d2deviceop').value;
4634
- if (op == 100) {
4635
- // Device wake
4636
- meshserver.send({ action: 'wakedevices', nodeids: [currentNode._id] });
4637
- } else if (op == 103) {
4638
- // Send MQTT Message
4639
- p10showSendMqttMsgDialog([currentNode._id]);
4640
- } else if (op == 104) {
4641
- // Uninstall agent
4642
- p10showSendUninstallAgentDialog([currentNode._id]);
4643
- } else {
4644
- // Power operation
4645
- meshserver.send({ action: 'poweraction', nodeids: [ currentNode._id ], actiontype: parseInt(op) });
4646
- }
4647
- }
4648
-
4649
- // Called when MeshCommander needs new credentials or updated credentials.
4650
- function updateAmtCredentials(forceDialog) {
4651
- var node = getNodeFromId(currentNode._id);
4652
- if ((forceDialog == true) || (node.intelamt.user == null) || (node.intelamt.user == '')) {
4653
- editDeviceAmtSettings(currentNode._id, updateAmtCredentialsEx);
4654
- } else {
4655
- Q('p14iframe').contentWindow.connectButtonfunctionEx();
4656
- }
4657
- }
4658
-
4659
- function updateAmtCredentialsEx(button, tag) {
4660
- Q('p14iframe').contentWindow.connectButtonfunctionEx();
4661
- }
4662
-
4663
- // Look to see if we need to update the device timeline
4664
- function updateDeviceTimeline() {
4665
- if ((meshserver.State != 2) || (powerTimelineNode == null) || (powerTimelineUpdate == null) || (currentNode == null)) return;
4666
- if ((powerTimelineNode == powerTimelineReq) && (currentNode._id == powerTimelineNode) && (powerTimelineUpdate < Date.now())) {
4667
- powerTimelineUpdate = null;
4668
- meshserver.send({ action: 'powertimeline', nodeid: currentNode._id });
4669
- meshserver.send({ action: 'lastconnect', nodeid: currentNode._id });
4670
- }
4671
- }
4672
-
4673
- // Draw device power bars. The bars are 766px wide.
4674
- function drawDeviceTimeline() {
4675
- if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19)) return;
4676
- var timeline = null, now = Date.now();
4677
- if (currentNode._id == powerTimelineNode) { timeline = powerTimeline; }
4678
-
4679
- // Calculate when the timeline starts
4680
- var d = new Date();
4681
- d.setHours(0, 0, 0, 0);
4682
- d = new Date(d.getTime() - (1000 * 60 * 60 * 24 * 6));
4683
- var timelineStart = d.getTime();
4684
-
4685
- // De-compact the timeline
4686
- var timeline2 = [];
4687
- if (timeline != null && timeline.length > 1) {
4688
- timeline2.push([ 0, timeline[1], timeline[0] ]); // Start, End, Power
4689
- var ct = timeline[1];
4690
- for (var i = 2; i < timeline.length; i += 2) {
4691
- var power = timeline[i], dt = now;
4692
- if (timeline.length > (i + 1)) { dt = timeline[i + 1]; }
4693
- timeline2.push([ ct, ct + dt, power ]); // Start, End, Power
4694
- ct = ct + dt;
4695
- }
4696
- }
4697
-
4698
- // Draw the timeline
4699
- var x = '', count = 1, date = new Date();
4700
- var totalWidth = Q('masthead').offsetWidth - (160 + 9 + 9 + 14); // Compute the total width of the power bar
4701
- date.setHours(0, 0, 0, 0);
4702
- for (var i = 0; i < 7; i++) {
4703
- var datavalue = '', start = date.getTime(), end = start + (1000 * 60 * 60 * 24);
4704
- for (var j in timeline2) {
4705
- var block = timeline2[j];
4706
- if (isTimeBlockInside(start, end, block[0], block[1]) == true) {
4707
- var ts = Math.max(start, block[0]);
4708
- var te = Math.min(Math.min(end, block[1]), now);
4709
- var width = Math.round(((te - ts) * totalWidth) / 86400000);
4710
- if (width > 0) {
4711
- var title = format('{0} from {1} to {2}.', powerStateStrings2[block[2]], printTime(new Date(ts)), printTime(new Date(te)));
4712
- datavalue += '<div class="pwState ' + powerColor(block[2]) + '" title="' + title + '" style="width:' + width + 'px;"></div>';
4713
- }
4714
- }
4715
- }
4716
- x += '<tr class=' + (((count % 2) == 0)?'altBack':'') + '><td><div> ' + printDate(date) + '<div></div></div></td><td><div>' + datavalue + '</div></td></tr>';
4717
- ++count;
4718
- date = new Date(date.getTime() - (1000 * 60 * 60 * 24)); // Substract one day
4719
- }
4720
- QH('p10html2', '<table cellpadding=2 cellspacing=0><thead><tr style=><th scope=col style=text-align:center;width:150px>' + "Day" + '</th><th scope=col style=text-align:center><a download href="devicepowerevents.ashx?id=' + currentNode._id + '" onclick="setDialogMode(0)"><img title=\"' + "Download power events" + '\" src="images/link4.png" /></a>' + "7 Day Power State" + '</th></tr></thead><tbody>' + x + '</tbody></table>');
4721
- }
4722
-
4723
- // Return a color for the given power state
4724
- function powerColor(x) { if (x < powerColorTable.length) { return powerColorTable[x]; } return 'pwsYellow'; }
4725
-
4726
- // Return true if the time block is visible within the start/end period
4727
- function isTimeBlockInside(start, end, blockStart, blockEnd) {
4728
- if ((blockStart < start) && (blockEnd > end)) return true; // Block is wider than timespan
4729
- if ((blockStart > start) && (blockStart < end)) return true;
4730
- if ((blockEnd > start) && (blockEnd < end)) return true;
4731
- return false;
4732
- }
4733
-
4734
- function addDeviceAttribute(name, value) { return '<tr><td class=style7>' + name + '</td><td class=style9>' + value + '</td></tr>'; }
4735
-
4736
- function editDeviceAmtSettings(nodeid, func, arg) {
4737
- if (xxdialogMode) return;
4738
- var x = '', node = getNodeFromId(nodeid), buttons = 3, meshrights = getNodeRights(nodeid);
4739
- if ((meshrights & 4) == 0) return;
4740
- x += addHtmlValue("Username", '<input id=dp10username style=width:230px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />');
4741
- x += addHtmlValue("Password", '<input id=dp10password type=password style=width:230px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />');
4742
- x += addHtmlValue("Security", '<select id=dp10tls style=width:236px><option value=0>' + "No TLS security" + '</option><option value=1>' + "TLS security required" + '</option></select>');
4743
- if ((node.intelamt.user != null) && (node.intelamt.user != '')) { buttons = 7; }
4744
- setDialogMode(2, "Edit Intel® AMT credentials", buttons, editDeviceAmtSettingsEx, x, { node: node, func: func, arg: arg });
4745
- if ((node.intelamt.user != null) && (node.intelamt.user != '')) { Q('dp10username').value = node.intelamt.user; } else { Q('dp10username').value = 'admin'; }
4746
- Q('dp10tls').value = node.intelamt.tls;
4747
- validateDeviceAmtSettings();
4748
- }
4749
-
4750
- function validateDeviceAmtSettings() {
4751
- QE('idx_dlgOkButton', passwordcheck(Q('dp10password').value));
4752
- }
4753
-
4754
- function editDeviceAmtSettingsEx(button, tag) {
4755
- if (button == 2) {
4756
- // Delete button pressed, remove credentials
4757
- meshserver.send({ action: 'changedevice', nodeid: tag.node._id, intelamt: { user: '', pass: '' } });
4758
- } else {
4759
- // Change Intel AMT credentials
4760
- var amtuser = Q('dp10username').value;
4761
- if (amtuser == '') amtuser = 'admin';
4762
- var amtpass = Q('dp10password').value;
4763
- if (amtpass == '') amtuser = '';
4764
- meshserver.send({ action: 'changedevice', nodeid: tag.node._id, intelamt: { user: amtuser, pass: amtpass, tls: Q('dp10tls').value } });
4765
- tag.node.intelamt.user = amtuser;
4766
- tag.node.intelamt.tls = Q('dp10tls').value;
4767
- if (tag.func) { setTimeout(function () { tag.func(null, tag.arg); }, 300); }
4768
- }
4769
- }
4770
-
4771
- function p10showSendMqttMsgDialog(nodeids) {
4772
- if (xxdialogMode) return false;
4773
- var x = addHtmlValue("Topic", '<input id=dp2topic style=width:230px maxlength=64 onchange=p10validateSendMqttMsgDialog() onkeyup=p10validateSendMqttMsgDialog(event,1) />');
4774
- x += addHtmlValue("Message", '<div style=width:230px;margin:0;padding:0><textarea id=dp2msg maxlength=4096 style=width:100%;height:150px;resize:none onchange=p10validateSendMqttMsgDialog() onkeyup=p10validateSendMqttMsgDialog(event,1)></textarea></div>');
4775
- setDialogMode(2, "Send MQTT message", 3, p10showSendMqttMsgDialogEx, x, nodeids);
4776
- p10validateSendMqttMsgDialog();
4777
- Q('dp2topic').focus();
4778
- return false;
4779
- }
4780
-
4781
- function p10validateSendMqttMsgDialog() {
4782
- QE('idx_dlgOkButton', (Q('dp2topic').value.length > 0) && (Q('dp2msg').value.length > 0));
4783
- }
4784
-
4785
- function p10showSendMqttMsgDialogEx(b, nodeids) {
4786
- meshserver.send({ action: 'sendmqttmsg', nodeids: nodeids, topic: Q('dp2topic').value, msg: Q('dp2msg').value });
4787
- }
4788
-
4789
- function p10showSendUninstallAgentDialog(nodeids) {
4790
- if (xxdialogMode) return false;
4791
- var x = '';
4792
- if (nodeids.length > 1) { x = format("Are you sure you want to uninstall the selected {0} agents?", nodeids.length); } else { x = "Are you sure you want to uninstall selected agent?"; }
4793
- x += '<br /><br />';
4794
- if (nodeids.length > 1) { x += "This will not remove the devices from the server, but the devices will not longer be able to connect to the server. All remote access to the devices will be lost. The devices must be connected for this command to work."; } else { x += "This will not remove this device from the server, but the device will not longer be able to connect to the server. All remote access to the device will be lost. The device must be connect for this command to work."; }
4795
- x += '<br /><br /><label style=color:red><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />' + "Confirm" + '</label>';
4796
- setDialogMode(2, "Uninstall agent", 3, p10showSendUninstallAgentDialogEx, x, nodeids);
4797
- p10validateSendUninstallAgentDialog();
4798
- return false;
4799
- }
4800
-
4801
- function p10validateSendUninstallAgentDialog() { QE('idx_dlgOkButton', Q('p10check').checked); }
4802
- function p10showSendUninstallAgentDialogEx(b, nodeids) { meshserver.send({ action: 'uninstallagent', nodeids: nodeids }); }
4803
-
4804
- function p10showChangeGroupDialog(nodeids) {
4805
- if (xxdialogMode) return false;
4806
- var targetMeshId = null;
4807
- if (nodeids.length == 1) { try { targetMeshId = meshes[getNodeFromId(nodeids[0])]._id; } catch (ex) { } }
4808
-
4809
- // List all available alternative groups
4810
- var y = '<select id=p10newGroup style=width:236px>', count = 0;
4811
- for (var i in meshes) {
4812
- var meshrights = meshes[i].links[userinfo._id].rights;
4813
- if ((meshes[i]._id != targetMeshId) && (meshrights & 4)) { count++; y += '<option value=\'' + meshes[i]._id + '\'>' + meshes[i].name + '</option>'; }
4814
- }
4815
- y += '</select>';
4816
-
4817
- if (count > 0) {
4818
- var x = (nodeids.length == 1) ? ("Select a new group for this device" + '<br /><br />') : ("Select a new group for selected devices" + '<br /><br />');
4819
- x += addHtmlValue("New Device Group", y);
4820
- setDialogMode(2, "Change Group", 3, p10showChangeGroupDialogEx, x, nodeids);
4821
- } else {
4822
- setDialogMode(2, "Change Group", 1, null, "No other device group of same type exists.");
4823
- }
4824
- return false;
4825
- }
4826
-
4827
- function p10showChangeGroupDialogEx(b, nodeids) {
4828
- meshserver.send({ action: 'changeDeviceMesh', nodeids: nodeids, meshid: Q('p10newGroup').value });
4829
- }
4830
-
4831
- function p10showDeleteNodeDialog(nodeid) {
4832
- if (xxdialogMode) return false;
4833
- var x = format("Are you sure you want to delete node {0}?", EscapeHtml(currentNode.name)) + '<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />' + "Confirm" + '</label>';
4834
- setDialogMode(2, "Delete Node", 3, p10showDeleteNodeDialogEx, x, nodeid);
4835
- p10validateDeleteNodeDialog();
4836
- return false;
4837
- }
4838
-
4839
- function p10validateDeleteNodeDialog() {
4840
- QE('idx_dlgOkButton', Q('p10check').checked);
4841
- }
4842
-
4843
- function p10showDeleteNodeDialogEx(buttons, nodeid) {
4844
- meshserver.send({ action: 'removedevices', nodeids: [ nodeid ] });
4845
- }
4846
-
4847
- function p10clickOnce(nodeid, protocol, port) {
4848
- meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, tag: 'clickonce', protocol: protocol });
4849
- return false;
4850
- }
4851
-
4852
- // Show current location
4853
- var d2map = null;
4854
- function p10showNodeLocationDialog() {
4855
- if ((xxdialogMode != null) && (xxdialogTag == '@xxmap')) { setDialogMode(0); } else { if (xxdialogMode) return false; }
4856
- var markers = [], types = ['iploc', 'wifiloc', 'gpsloc', 'userloc'], boundingBox = null;
4857
-
4858
- for (var loctype in types) {
4859
- if (currentNode[types[loctype]] != null) {
4860
- var loc = currentNode[types[loctype]].split(','), lat = parseFloat(loc[0]), lon = parseFloat(loc[1]);
4861
- if ((lat < 90) && (lat > -90) && (lon < 180) && (lon > -180)) { // Check valid lat/lon
4862
- var deviceMark = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([lon, lat])) });
4863
- deviceMark.setStyle(markerStyle(currentNode, parseInt(loctype) + 1));
4864
- markers.push(deviceMark);
4865
-
4866
- if (boundingBox == null) { boundingBox = [ lat, lon, lat, lon, 0 ]; } else { if (lat < boundingBox[0]) { boundingBox[0] = lat; } if (lon < boundingBox[1]) { boundingBox[1] = lon; } if (lat > boundingBox[2]) { boundingBox[2] = lat; } if (lon > boundingBox[3]) { boundingBox[3] = lon; } }
4867
- }
4868
- }
4869
- }
4870
-
4871
- // Setup the device mark layer
4872
- var vectorSource = new ol.source.Vector({ features: markers });
4873
- var vectorLayer = new ol.layer.Vector({ source: vectorSource });
4874
-
4875
- //var x = '<div><a href="https://www.google.com/maps/preview/@' + lat + ',' + lng + ',12z" rel="noreferrer noopener" target=_blank>Open in Google maps</a></div>';
4876
- var x = '<div id=d2map style=width:100%;height:300px></div>';
4877
- setDialogMode(2, "Device Location", 1, null, x, '@xxmap');
4878
-
4879
- var clng = 0, clat = 0, zoom = 8;
4880
- if (boundingBox != null) {
4881
- var clat = (boundingBox[0] + boundingBox[2]) / 2;
4882
- var clng = (boundingBox[1] + boundingBox[3]) / 2;
4883
- var cscale = Math.max(Math.abs(boundingBox[0] - boundingBox[2]), Math.abs(boundingBox[1] - boundingBox[3]));
4884
- var i = 360, zoom = -2;
4885
- while (i > cscale) { zoom++; i = i / 2; }
4886
- }
4887
-
4888
- if (markers.length == 1) { zoom = 8; }
4889
-
4890
- // Setup the map
4891
- d2map = new ol.Map({
4892
- target: 'd2map',
4893
- interactions: ol.interaction.defaults({dragPan:false, mouseWheelZoom:false}),
4894
- layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }), vectorLayer ],
4895
- view: new ol.View({ center: ol.proj.fromLonLat([clng, clat]), zoom: zoom })
4896
- });
4897
- return false;
4898
- }
4899
-
4900
- // Show network interfaces
4901
- function p10showNodeNetInfoDialog() {
4902
- if (xxdialogMode) return false;
4903
- setDialogMode(2, "Network Interfaces", 1, null, '<div id=d2netinfo>' + "Loading..." + '</div>', 'if' + currentNode._id );
4904
- meshserver.send({ action: 'getnetworkinfo', nodeid: currentNode._id });
4905
- return false;
4906
- }
4907
-
4908
- // Show MeshCentral Router dialog
4909
- function p10showMeshRouterDialog() {
4910
- if (xxdialogMode) return;
4911
- var x = '<div>' + "MeshCentral Router is a Windows tool for TCP port mapping. You can, for example, RDP into a remote device thru this server." + '</div><br />';
4912
- x += addHtmlValue('Win32 Executable', '<a style=cursor:pointer download href="meshagents?meshaction=winrouter" onclick="setDialogMode(0)">MeshCentralRouter.exe</a>');
4913
- setDialogMode(2, "MeshCentral Router", 1, null, x, 'fileDownload');
4914
- }
4915
-
4916
- // Request MQTT login credentials
4917
- function p10showMqttLoginDialog(nodeid) { meshserver.send({ action: 'getmqttlogin', nodeid: nodeid }); }
4918
-
4919
- // Show MeshCmd dialog
4920
- function p10showMeshCmdDialog(mode, nodeid) {
4921
- if (xxdialogMode) return;
4922
- var y = '<select id=aginsSelect onclick=meshCmdOsClick() style=width:236px>';
4923
- y += '<option value=3>' + "Windows (32bit)" + '</option>';
4924
- y += '<option value=4>' + "Windows (64bit)" + '</option>';
4925
- y += '<option value=5>' + "Linux x86 (32bit)" + '</option>';
4926
- y += '<option value=6>' + "Linux x86 (64bit)" + '</option>';
4927
- y += '<option value=16>' + "MacOS (64bit)" + '</option>';
4928
- y += '<option value=25>' + "Linux ARM, Raspberry Pi (32bit)" + '</option>';
4929
- y += '</select>';
4930
-
4931
- var x = '';
4932
- if (mode == 0) { x += '<div>MeshCmd is a command line tool that performs lots of different operations. The action file can optionally be downloaded and edited to provide server information and credentials.<br /><br />'; }
4933
- if (mode == 1) { x += '<div>Download "meshcmd" with an action file to route traffic thru this server to this device. Make sure to edit meshaction.txt and add your account password or make any changes needed.<br /><br />'; }
4934
- x += addHtmlValue('Operating System', y);
4935
- x += addHtmlValue('MeshCmd', '<a id=meshcmddownloadid href="meshagents?meshcmd=3" download></a>');
4936
- if (mode == 0) { x += addHtmlValue('Action File', '<a href="meshagents?meshaction=generic" download>MeshAction (.txt)</a>'); }
4937
- if (mode == 1) { x += addHtmlValue('Action File', '<a href="meshagents?meshaction=route&nodeid=' + nodeid + '" download>MeshAction (.txt)</a>'); }
4938
- x += '</div>';
4939
- setDialogMode(2, [ "Download MeshCmd", "Network Router" ][mode], 9, null, x, 'fileDownload');
4940
- meshCmdOsClick();
4941
- }
4942
-
4943
- function meshCmdOsClick() {
4944
- var os = Q('aginsSelect').value, osn = '', osurl = '';
4945
- //Q('meshcmddownloadid').href = 'meshagents?meshcmd=' + os;
4946
- if (os == 3) { osn = 'MeshCmd (Win32 executable)'; }
4947
- if (os == 4) { osn = 'MeshCmd (Win64 executable)'; }
4948
- if (os == 5) { osn = 'MeshCmd (Linux x86, 32bit)'; }
4949
- if (os == 6) { osn = 'MeshCmd (Linux x86, 64bit)'; }
4950
- if (os == 16) { osn = 'MeshCmd (MacOS, 64bit)'; }
4951
- if (os == 25) { osn = 'MeshCmd (Linux ARM, 32bit)'; }
4952
- QH('meshcmddownloadid', osn);
4953
- Q('meshcmddownloadid').setAttribute('href', 'meshagents?meshcmd=' + os);
4954
- }
4955
-
4956
- function p10showiconselector() {
4957
- if (xxdialogMode) return;
4958
- var mesh = meshes[currentNode.meshid];
4959
- var meshrights = mesh.links[userinfo._id].rights;
4960
- if ((meshrights & 4) == 0) return;
4961
-
4962
- var x = '<br><div style=display:inline-block;width:40px></div>';
4963
- x += '<div tabindex=0 style=display:inline-block class=i1 onclick=p10setIcon(1) onkeypress="if (event.key==\'Enter\') p10setIcon(1)"></div>';
4964
- x += '<div tabindex=0 style=display:inline-block class=i2 onclick=p10setIcon(2) onkeypress="if (event.key==\'Enter\') p10setIcon(2)"></div>';
4965
- x += '<div tabindex=0 style=display:inline-block class=i3 onclick=p10setIcon(3) onkeypress="if (event.key==\'Enter\') p10setIcon(3)"></div>';
4966
- x += '<div tabindex=0 style=display:inline-block class=i4 onclick=p10setIcon(4) onkeypress="if (event.key==\'Enter\') p10setIcon(4)"></div>';
4967
- x += '<div tabindex=0 style=display:inline-block class=i5 onclick=p10setIcon(5) onkeypress="if (event.key==\'Enter\') p10setIcon(5)"></div>';
4968
- x += '<div tabindex=0 style=display:inline-block class=i6 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(6)"></div><br><br>';
4969
- setDialogMode(2, "Icon Selection", 0, null, x);
4970
- QV('id_dialogclose', true);
4971
- }
4972
-
4973
- function p10setIcon(icon) {
4974
- setDialogMode(0);
4975
- meshserver.send({ action: 'changedevice', nodeid: currentNode._id, icon: icon });
4976
- }
4977
-
4978
- var showEditNodeValueDialog_modes = ["Device Name", "Hostname", "Description", "Tags"];
4979
- var showEditNodeValueDialog_modes2 = ['name', 'host', 'desc', 'tags'];
4980
- var showEditNodeValueDialog_modes3 = ['', '', '', "Tag1, Tag2, Tag3"];
4981
- function showEditNodeValueDialog(mode) {
4982
- if (xxdialogMode) return;
4983
- var x = addHtmlValue(showEditNodeValueDialog_modes[mode], '<input id=dp10devicevalue maxlength=64 placeholder="' + showEditNodeValueDialog_modes3[mode] + '" onchange=p10editdevicevalueValidate(' + mode + ',event) onkeyup=p10editdevicevalueValidate(' + mode + ',event) />');
4984
- setDialogMode(2, "Edit Device", 3, showEditNodeValueDialogEx, x, mode);
4985
- var v = currentNode[showEditNodeValueDialog_modes2[mode]];
4986
- if (v == null) v = '';
4987
- if (Array.isArray(v)) { v = v.join(', '); }
4988
- Q('dp10devicevalue').value = v;
4989
- p10editdevicevalueValidate();
4990
- Q('dp10devicevalue').focus();
4991
- }
4992
-
4993
- function showEditNodeValueDialogEx(button, mode) {
4994
- var x = { action: 'changedevice', nodeid: currentNode._id };
4995
- x[showEditNodeValueDialog_modes2[mode]] = Q('dp10devicevalue').value;
4996
- meshserver.send(x);
4997
- }
4998
-
4999
- function p10editdevicevalueValidate(mode, e) {
This file is too large to show in full.