<!doctypehtml><html lang=de dir=ltr xmlns=http://www.w3.org/1999/xhtml><meta http-equiv=X-UA-Compatible content="IE=edge"><meta http-equiv=Content-Type content="text/html;charset=utf-8"><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 type=image/x-icon href={{{domainurl}}}favicon.ico rel="shortcut icon"><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><link type=text/css href=styles/xterm.css media=screen rel=stylesheet title=CSS><script src=scripts/common-0.0.1{{{min}}}.js></script><script src=scripts/meshcentral{{{min}}}.js></script><script src=scripts/amt-0.2.0{{{min}}}.js></script><script src=scripts/amt-wsman-0.2.0{{{min}}}.js></script><script src=scripts/amt-desktop-0.0.2{{{min}}}.js></script><script src=scripts/amt-terminal-0.0.2{{{min}}}.js></script><script src=scripts/zlib{{{min}}}.js></script><script src=scripts/zlib-inflate{{{min}}}.js></script><script src=scripts/zlib-adler32{{{min}}}.js></script><script src=scripts/zlib-crc32{{{min}}}.js></script><script src=scripts/amt-redir-ws-0.1.0{{{min}}}.js></script><script src=scripts/amt-wsman-ws-0.2.0{{{min}}}.js></script><script src=scripts/agent-redir-ws-0.1.1{{{min}}}.js></script><script src=scripts/agent-redir-rtc-0.1.0{{{min}}}.js></script><script src=scripts/agent-desktop-0.0.2{{{min}}}.js></script><script src=scripts/qrcode.min.js></script><script src=scripts/xterm{{{min}}}.js></script><script src=scripts/xterm-addon-fit{{{min}}}.js></script><script keeplink=1 src=scripts/u2f-api{{{min}}}.js></script><script keeplink=1 src=scripts/charts{{{min}}}.js></script><script keeplink=1 src=scripts/filesaver.min.js></script><script keeplink=1 src=scripts/ol{{{min}}}.js></script><script keeplink=1 src=scripts/ol3-contextmenu{{{min}}}.js></script><title>{{{title}}}</title><body id=body oncontextmenu=handleContextMenu(event) style=display:none;min-width:495px onload='"undefined"!=typeof startup&&startup()'><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)>Dateien</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>Ereignisse</div><div id=cxdetails class=cmtext onclick=cmaction(6,event)>Details</div><div id=cxconsole class=cmtext onclick=cmaction(7,event)>Konsole</div><div id=cxplugins class=cmtext onclick=cmaction(8,event) style=display:none>Plugins</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(9,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)>Alle auswählen</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>Auswahl aufheben</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmtermaction(1,event)><b>Admin-Shell</b></div><div class=cmtext onclick=cmtermaction(6,event)>Admin-PowerShell</div><div class=cmtext onclick=cmtermaction(8,event)>Benutzer-Shell</div><div class=cmtext onclick=cmtermaction(9,event)>Benutzer-PowerShell</div></div><div id=termShellContextMenuLinux class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmtermaction(1,event)><b>Root-Shell</b></div><div class=cmtext onclick=cmtermaction(8,event)>Benutzer-Shell</div><div class=cmtext onclick=cmtermaction(100,event)>Login Shell</div></div><div id=deskConnectContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmdeskaction(1,event)>Einwilligung anfordern + Balken</div><div class=cmtext onclick=cmdeskaction(2,event)>Einwilligung anfordern</div><div class=cmtext onclick=cmdeskaction(3,event)>Privacy Bar</div></div><div id=altPortContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmaltportaction(1,event)>Alternativer Port</div></div><div id=rfbPortContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmrfbportaction(1,event)>Alternativer Port</div></div><div id=filesContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmfilesaction(1,event)>Umbenennen</div><div class=cmtext onclick=cmfilesaction(2,event)>Bearbeiten</div><div class=cmtext onclick=cmfilesaction(3,event)>Löschen</div></div><div id=deskPlayerContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmdeskplayeraction(1,event)>Open Player...</div></div><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=masthead class=noselect><div style=float:left>{{{titlehtml}}}</div><div class=title>{{{title1}}}</div><div class=title2>{{{title2}}}</div><div style=float:right><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=display:none title="Hier klicken, um aktuelle Benachrichtigungen anzuzeigen">0</div></div><p id=logoutControl><span id=logoutControlSpan style=color:#fff></span><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="Meine Geräte"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="Mein Konto"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="Meine Ereignisse"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="Meine Dateien"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="Meine Benutzer"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="Mein 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><span id=logoutControlSpan2 style=color:#fff></span><div tabindex=0 id=uiMenuButton title=Benutzerinterface-Auswahl onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Oberfläche mit Leiste links"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Oberfläche mit Leiste oben"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Oberfläche mit fester Breite"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Nachtmodus ein-/ausschalten"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div><div tabindex=0 id=uiViewButton5 class=uiSelector onclick=toggleFooterBarMode() title="Fußzeile ein-/ausschalten"onkeypress='"Enter"==event.key&&toggleFooterBarMode()'><div class=uiSelector5></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)'>Meine Geräte<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>Mein Konto<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>Meine Ereignisse<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>Meine Dateien<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>Meine Benutzer<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>Mein Server<td class="topbar_td_end style3">&nbsp;</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)'>Allgemein<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)'>Dateien<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>Ereignisse<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)'>Konsole<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">&nbsp;</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)'>Allgemein<td tabindex=0 id=MeshSummary class="topbar_td style3x"onclick=go(21,event) onkeypress='"Enter"==event.key&&go(21)'>Zusammenfassung<td class="topbar_td_end style3">&nbsp;</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)'>Allgemein<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>Ereignisse<td class="topbar_td_end style3">&nbsp;</table></div><div id=UsersSubMenuSpan style=display:none><table id=UsersSubMenu cellpadding=0 cellspacing=0 class=style1><tr><td tabindex=0 id=UsersGeneral class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>Benutzer<td tabindex=0 id=UsersGroups class="topbar_td style3x"onclick=go(50,event) onkeypress='"Enter"==event.key&&go(50)'>Gruppen<td tabindex=0 id=UsersRecordings class="topbar_td style3x"onclick=go(52,event) onkeypress='"Enter"==event.key&&go(52)'>Recordings<td class="topbar_td_end style3">&nbsp;</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)'>Allgemein<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>Statistiken<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>Konsole<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">&nbsp;</table></div><div id=UserDummyMenuSpan><table id=UserDummyMenu cellpadding=0 cellspacing=0 class=style1><tr><td class=style3>&nbsp;</table></div></div></div></div><div id=column_l><div id=p0 style=display:none><div id=p0message><span id=p0span>Server getrennt</span>,<href onclick=reload() style=cursor:pointer><u>zum Wiederverbinden klicken</u></href>.</div></div><div id=p1 style=display:none><div id=p1title><div style=display:none id=devListToolbarViewIcons><div tabindex=0 id=devViewButton1 class=viewSelector onclick=onDeviceViewChange(1) onkeypress='"Enter"==event.key&&onDeviceViewChange(1)'title=Spalten><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=Liste><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=Karte style=display:none><div class=viewSelector4></div></div></div><div><h1>Meine Geräte</h1></div></div><table id=devListToolbarSpan class=noselect><tr><td class=h1><td id=devListToolbar class=style14 style=display:none>&nbsp;&nbsp;<input type=button id=SelectAllButton onclick=selectallButtonFunction() value="Alle auswählen">&nbsp; <input type=button id=GroupActionButton disabled value=Gruppenaktion onclick=groupActionFunction()>&nbsp; <input id=SearchInput placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)>&nbsp; <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()><span title="Geräte-Betriebssystemname anzeigen">Name im Betriebssystem</span></label> <label><input type=checkbox id=OnlineCheckBox onclick=onOnlineCheckBox(event)><span title="Only show devices that are online">Online</span></label> <span id=devCustomUIBar></span><td id=kvmListToolbar class=style14 style=display:none>&nbsp;&nbsp;<input type=button onclick=connectAllKvmFunction() value="Alle verbinden">&nbsp; <input type=button onclick=disconnectAllKvmFunction() value="Alle trennen">&nbsp; <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="Automatische Verbindung">Auto&nbsp;</label> <input type=button onclick=showMultiDesktopSettings() value=Einstellungen>&nbsp; <input id=KvmSearchInput placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0)>&nbsp;<td id=devMapToolbar class=style14 style=display:none>&nbsp;&nbsp;<input id=mapSearchLocation placeholder=Standortsuche onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=Suche title="Suche nach Standort"onclick=getSearchLocation()> <input type=button id=refreshmap title="Kartenansicht zurücksetzen"value=Zurücksetzen onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>Ansicht <select id=viewselect onchange=onDeviceViewChange()><option value=1>Spalten<option value=2>Liste<option value=3>Desktops<option id=viewselectmapoption value=4 style=display:none>Karte</select></div><div style=display:none id=devListToolbarSort>Sortieren <select id=sortselect onchange=masterUpdate(6)><option>Gruppe<option>Energiezustand<option>Gerät<option>Tags</select> &nbsp;</div><div style=display:none id=devListToolbarSize>Größe <select id=sizeselect onchange=onDeviceViewChange()><option value=0>Klein<option value=1>Mittel<option value=2>Groß</select> &nbsp;</div><td class=h2></table><div id=NoMeshesPanel style=display:none><table><tr><td valign=top style=width:50px><img src=images/info.png loading=lazy width=47 height=48><td><div id=getStarted1>Um loszulegen, <a href=# onclick="return account_createMesh()"><strong>hier klicken, um eine Gerätegruppe zu erstellen</strong></a>.</div><div id=getStarted2>Keine Gerätegruppen.</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>Standortergebnis</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><div id=p2title><h1>Mein Konto</h1></div><div id=p2info style=overflow-y:auto><img id=p2AccountImage alt=""loading=lazy width=128 height=128 src=images/clipboard-128.png><div id=p2AccountSecurity style=display:none><p><strong>Konto-Sicherheit</strong><div style=margin-left:25px><div id=managePhoneNumber1><div class=p2AccountActions><span id=authPhoneNumberCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_managePhone()">Manage phone number</a><br></span></div><div id=manageEmail2FA><div class=p2AccountActions><span id=authEmailSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthEmail()">E-Mail-Authentifizierung verwalten</a><br></span></div><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">Authentifikator-App verwalten</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)">Sicherheitsschlüssel verwalten</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)">Sicherungscodes verwalten</a><br></span></div></div></div><div id=p2AccountActions><p><strong>Konto-Aktionen</strong><p class=mL><span id=managePhoneNumber2 style=display:none><a href=# onclick="return account_managePhone()">Manage phone number</a><br></span><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">E-Mail verifizieren</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">Web-Benachrichtigungen aktivieren</a><br></span><a href=# onclick="return account_showLocalizationSettings()">Lokalisierungseinstellungen</a><br><a href=# onclick="return account_showAccountNotifySettings()">Benachrichtungseinstellungen</a><br><span id=p2AccountPassActions><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">E-Mail-Adresse ändern</a><br></span><a href=# onclick="return account_showChangePassword()">Passwort ändern</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">Konto löschen</a><br></span></p><br style=clear:both></div><strong>Gerätegruppen</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>Neu</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>Keine Gerätegruppen.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>Fang hier an!</strong></a></span></div><br style=clear:both></div></div><div id=p3 style=display:none><div id=p3title><h1>Meine Ereignisse</h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Anzeigen <select id=p3limitdropdown onchange=refreshEvents()><option value=60>Letzte 60<option value=120>Letzte 120<option value=250>Letzte 250<option value=500>Letzte 500<option value=1000>Letzte 1000</select>&nbsp; <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="Ereignisse herunterladen"style=cursor:pointer></a>&nbsp;<td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><div id=p4title><h1>Meine Benutzer</h1></div><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=showUserBroadcastDialog() style=margin-right:6px value=Rundruf> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="Benutzerinformationen herunterladen"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="Stapel-Erzeugung vieler Benutzerkonten"src=images/link6.png></a></div><div><input type=button id=UsersSelectAllButton onclick=p3usersSelectallButtonFunction() value="Alle auswählen"> <input type=button id=UsersGroupActionButton disabled value=Gruppenaktion onclick=p3usersGroupActionFunction()> <input id=UserNewAccountButton type=button onclick=showCreateNewAccountDialog() value="Neues Konto..."> <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><div id=p5title><h1>Meine Dateien</h1></div><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=Hoch>&nbsp; <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="Alle auswählen">&nbsp; <input type=button id=p5RenameFileButton disabled value=Umbenennen onclick=p5renamefile()>&nbsp; <input type=button id=p5DeleteFileButton disabled value=Löschen onclick=p5deletefile()>&nbsp; <input type=button id=p5NewFolderButton disabled value="Neuer Ordner"onclick=p5createfolder()>&nbsp; <input type=button id=p5UploadButton disabled value=Hochladen onclick=p5uploadFile()>&nbsp; <input type=button id=p5CutButton disabled value=Ausschneiden onclick=p5copyFile(1)>&nbsp; <input type=button id=p5CopyButton disabled value=Kopie onclick=p5copyFile(0)>&nbsp; <input type=button id=p5PasteButton disabled value=Einfügen onclick=p5pasteFile()>&nbsp;</div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>Nach Name sortieren<option value=2>Nach Größe sortieren<option value=3>Nach Datum sortieren<option value=4>Nach Name absteigend<option value=5>Nach Größe absteigend<option value=6>Nach Datum absteigend</select></div><div>&nbsp;&nbsp;<span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>Diese Dateien werden öffentlich geteilt, klicken Sie auf "Link", um die öffentliche URL zu erhalten.</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>&nbsp;<span id=p5bottomstatus></span></table></div><div id=p6 style=display:none><div id=p6info style=overflow-y:auto><div id=p6title><img id=MainMeshImage src=serverpic.ashx><h1>Mein Server</h1></div><div id=p2ServerActions><p><strong>Server-Aktionen</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>Server-Datensicherung herunterladen</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">Server aus Datensicherung wiederherstellen</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">Server auf Aktualisierung überprüfen</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">Server-Fehlerprotokoll anzeigen</a></div></div></div><br><strong>Server-Statistiken</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 id=serverWarningsDiv style=display:none><br><strong>Server-Warnmeldungen</strong><br><br><div id=serverWarnings></div></div></div></div><div id=p10 style=display:none><div id=p10title><div id=p10BackButton><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Allgemein - <span id=p10deviceName></span></h1></div><div id=p10info style=overflow-y:auto><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p10html></div><td style=width:20px><td style=width:200px;vertical-align:top;position:relative valign=top><img id=p10deviceNotify onclick=showDeviceSessions(null,null,event) class=deviceNotifyLargeDot src=images/icon-relay-notify-40.png width=40 height=40><div id=p10deviceBattery class="deviceBatteryLarge deviceBatteryLarge1"></div><a href=# onclick=p10showiconselector()><img id=MainComputerImage></a><div id=MainComputerState></div></table><br><div id=p10html2></div><div id=p10html3></div><div id=p10html4></div></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=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Vollbild. Halten Sie die Umschalttaste gedrückt, um das Browserfenster im Vollbild anzuzeigen."><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 Umleitungsport oder KVM-Eigenschaft ist deaktiviert<span id=p11warninga>, zum Einschalten hier klicken.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Entfernter Rechner ist nicht eingeschaltet, klicken Sie hier um einen Stromversorgungsbefehl abzusetzen.</div></div><div id=deskarea0 cellpadding=0 cellspacing=0><div id=deskarea1 class=areaHead><div class=toright2><span id=p11power></span>&nbsp;<div class=deskareaicon title="Ansichtsmodus umschalten"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="Nach links drehen"onclick=drotate(-1)>↺</div><div class=deskareaicon title="Nach rechts drehen"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="Server zeichnet diese Sitzung auf"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="Fokusmodus ein-/ausschalten; wenn aktiv, wird nur die Region um die Maus aktualisiert"onkeypress=return!1 onkeydown=return!1 value="Alles fokussieren"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskActionsBtn type=button title="Energiezustandsaktionen auf dem Gerät ausführen"onkeypress=return!1 onkeydown=return!1 value=Aktionen onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=Einstellungen... title="Einstellungen für entfernten Desktop bearbeiten"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="Den Energiezustand der entfernten Maschine ändern"onkeypress=return!1 onkeydown=return!1 value=Energiezustandsaktionen onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)>&nbsp;✖</div><input type=button id=autoconnectbutton1 value=Auto-Verbindung onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 cmenu=deskConnectButton value=Verbinden onclick=connectDesktop(event,3) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan>&nbsp;<input type=button id=connectbutton1h value=HW-Verbindung title="Verbinden per Intel-AMT-Hardware-KVM"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span>&nbsp;<input type=button id=disconnectbutton1 value=Trennen onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span>&nbsp;<span id=deskstatus>Getrennt</span><span id=deskmetadata></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()>Aktualisieren</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>Prozesse</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>Dienste</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="Nach Prozess-ID sortieren"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="Nach Name sortieren"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="Nach Status sortieren"onclick=sortService(0)>Zustand</a> <a class=colmn2 title="Nach Name sortieren"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;text-align:left onclick=p11clearConsoleMsg()></div><div id=p11DeskSessionSelector style=display:none;position:absolute;left:30px;top:17px;right:30px;bottom:17px;overflow-y:auto></div></div><div id=deskarea4 class=areaFoot><div class=toright2><span id=DeskLatency title=Desktop-Sitzungslatenz></span> <span id=DeskTimer title=Sitzungszeit></span>&nbsp; <select id=termdisplays style=display:none onchange=deskSetDisplay(event) onkeypress=return!1 onkeydown=return!1></select>&nbsp; <input id=DeskToolsButton type=button value=Werkzeuge title="Werkzeug-Ansicht ein-/ausschalten"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()>&nbsp; <span id=DeskChatButton class=deskarea title="Chat-Fenster mit diesem Computer öffnen"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="Eine Benachrichtigung auf dem entfernten Rechner anzeigen"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="Eine Web-Adresse auf dem entfernten Rechner öffnen"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskBackgroundButton title="Hintergrundbild des entfernten Desktops ein-/ausschalten"><img src=images/icon-background.png onclick=deviceToggleBackground(event) height=16 width=16 style=padding-top:2px></span><span id=DeskSaveImageButton title="Ein Bildschirmfoto des entfernten Desktops speichern"><img src=images/icon-camera.png onclick=deskSaveImage() height=16 width=16 style=padding-top:2px></span><span id=DeskRecordButton cmenu=deskPlayerContextMenu title="Record remote desktop session to file"style=display:none><img id=DeskRecordButtonImage src=images/icon-film.png onclick=deskRecordSession() height=16 width=16 style=padding-top:2px></span></div><div><select id=deskkeys><option value=10>Strg+Alt+Entf<option value=5>Win<option value=0>Win+Runter<option value=1>Win+Hoch<option value=2>Win+L<option value=3>Win+M<option value=4>Umschalten+Win+M<option value=6>Win+R<option value=7>Alt+F4<option value=8>Strg+W<option value=9>Alt+Tab<option value=11>Win+Links<option value=12>Win+Rechts</select> <input id=DeskWD type=button value=Senden onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=Zwischenablage onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=Tippen onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="Maus- und Tastatureingaben ein-/ausschalten"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>Eingabe</span></label>&nbsp;</div></div></div></div><div id=p12 style=display:none><div id=p12title><div id=p12BackButton><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons2 style=float:right><div class=viewSelector onclick=deskToggleFull(event) title="Vollbild. Halten Sie die Umschalttaste gedrückt, um das Browserfenster im Vollbild anzuzeigen."><div class=viewSelector5></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 Umleitungsport oder KVM-Eigenschaft ist deaktiviert<span id=p12warninga>, zum Einschalten hier klicken.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>Entfernter Rechner ist nicht eingeschaltet, klicken Sie hier um einen Stromversorgungsbefehl abzusetzen.</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 zeichnet diese Sitzung auf"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="Energiezustandsaktionen auf dem Gerät ausführen"onkeypress=return!1 onkeydown=return!1 value=Aktionen onclick=deviceActionFunction()></div><div><div id=idx_termFullBtn2 onclick=deskToggleFull(event)>&nbsp;✖</div><input type=button id=autoconnectbutton2 value=Auto-Verbindung onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 cmenu=termConnectButton value=Verbinden onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan>&nbsp;<input type=button id=connectbutton2h value=HW-Verbindung title="Verbinden per Intel-AMT-Hardware-KVM"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span>&nbsp;<input type=button id=disconnectbutton2 value=Trennen onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span>&nbsp;<span id=termstatus>Getrennt</span><span id=termtitle></span></div><tr><td><div class=areaProgress><div id=termprogressbar></div></div><tr><td id=termarea3x><div id=termarea3xdiv style=width:100%;height:100%></div><pre id=Term></pre><tr><td class=areaFoot><div class=toright2><span id=TermTimer title=Sitzungszeit></span>&nbsp; <span id=terminalSettingsButtons style=display:none><input id=id_tcrbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value=CR+LF title="Umschalten, was Return-Taste sendet"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Intel (F10 = ESC+[OM)"title="Emulationstyp für F1 bis F10 umschalten"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="Erweitertes ASCII"title="Terminal-Emulationstyp umschalten"onclick=termToggleType()> </span><span id=terminalSizeDropDown style=display:none><select id=termSizeList onkeypress=return!1><option value=1>80x25<option value=2>100x30</select> </span><span id=specialKeyDropDown><select id=specialkeylist onkeypress=return!1></select> <input id=specialkeylistinput type=button onkeypress=return!1 class=bottombutton value=Senden title="Sende den ausgewählten Spezialschlüssel"onclick=sendSpecialKey()></span></div><div>&nbsp; <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Strg+C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Strg+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=Rücktaste onclick='termSendKey(8,"bsbutton")'style=display:none> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=Einfügen title="Text ins Terminal einfügen"onclick=showTermPasteDialog() style=display:none></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=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Dateien - <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="Energiezustandsaktionen auf dem Gerät ausführen"value=Aktionen onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="Server zeichnet diese Sitzung auf"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=Auto-Verbindung onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=Verbinden onclick=connectFiles(event) type=button> <span id=p13Status>Getrennt</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value=Hoch>&nbsp; <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="Alle auswählen">&nbsp; <input type=button id=p13RenameFileButton disabled value=Umbenennen onclick=p13renamefile()>&nbsp; <input type=button id=p13DeleteFileButton disabled value=Löschen onclick=p13deletefile()>&nbsp; <input type=button id=p13ViewFileButton disabled value=Bearbeiten onclick=p13viewfile()>&nbsp; <input type=button id=p13NewFolderButton disabled value="Neuer Ordner"onclick=p13createfolder()>&nbsp; <input type=button id=p13UploadButton disabled value=Hochladen onclick=p13uploadFile()>&nbsp; <input type=button id=p13CutButton disabled value=Ausschneiden onclick=p13copyFile(1)>&nbsp; <input type=button id=p13CopyButton disabled value=Kopie onclick=p13copyFile(0)>&nbsp; <input type=button id=p13PasteButton disabled value=Einfügen onclick=p13pasteFile()>&nbsp; <input type=button id=p13RefreshButton disabled value=Aktualisieren onclick=p13folderup(9999)>&nbsp;</div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>Nach Name sortieren<option value=2>Nach Größe sortieren<option value=3>Nach Datum sortieren<option value=4>Nach Name absteigend<option value=5>Nach Größe absteigend<option value=6>Nach Datum absteigend</select></div><div>&nbsp;&nbsp;<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>&nbsp;<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=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="Vollbild. Halten Sie die Umschalttaste gedrückt, um das Browserfenster im Vollbild anzuzeigen."><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=Zurück 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="Informationen zum derzeit auf diesem Agenten ausgeführten Kern"></div><input type=button id=p15uploadCore value=Agent-Aktion onclick=p15uploadCore(event) title="Das JavaScript-Codemodul des Agenten wechseln"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="Konsolentext herunterladen"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>&nbsp;<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=Leeren 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=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Ereignisse - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Anzeigen <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>Letzte 60<option value=120>Letzte 120<option value=250>Letzte 250<option value=500>Letzte 500<option value=1000>Letzte 1000</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="Ereignisse herunterladen"style=cursor:pointer></a>&nbsp;<td class=h2></table><div id=p16events></div></div><div id=p17 style=display:none;margin-left:-18px><div id=p17title style=margin-left:18px><div id=p17BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Details - <span id=p17deviceName></span></h1></div><div id=p17info style=overflow-y:auto></div></div><div id=p19 style=display:none><div id=p19title><div id=p19BackButton style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Plugins - <span id=p19deviceName></span></h1></div><div id=p19headers></div><div id=p19pages></div></div><div id=p20 style=display:none><div id=p20title><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=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Allgemein - <span id=p20meshName></span></h1></div><p id=p20info></div><div id=p21 style=display:none><div id=p21title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Zusammenfassung - <span id=p21meshName></span></h1></div><div style=width:100%><div style=display:table;width:93%><div id=meshPowerChartDiv style=width:31%;display:inline-block;text-align:center;max-width:250px><div style=margin:10px;font-size:16px>Energiezustände</div><canvas id=meshPowerChart style=width:250px;height:250px></canvas></div><div id=meshOsChartDiv style=width:31%;display:inline-block;text-align:center;max-width:250px><div style=margin:10px;font-size:16px>Agent-Typen</div><canvas id=meshOsChart style=width:250px;height:250px></canvas></div><div id=meshConnChartDiv style=width:31%;display:inline-block;text-align:center;max-width:250px><div style=margin:10px;font-size:16px>Konnektivität</div><canvas id=meshConnChart style=width:250px;height:250px></canvas></div></div></div><p id=p21info></div><div id=p30 style=display:none><div id=p30title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Allgemein - <span id=p30userName></span></h1></div><div id=p30info style=overflow-y:auto><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p30html></div><td style=width:20px><td style=width:200px;position:relative valign=top><img id=p30userAuthServiceLogo loading=lazy style=display:none class=userAuthStrategyLogo width=64 height=64><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><div id=p31 style=display:none><div id=p31title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Ereignisse - <span id=p31userName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>Anzeigen <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>Letzte 60<option value=120>Letzte 120<option value=250>Letzte 250<option value=500>Letzte 500<option value=1000>Letzte 1000</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="Ereignisse herunterladen"style=cursor:pointer></a>&nbsp;<td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><div id=p40title><h1>Meine Server-Statistiken</h1></div><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>Verbindungen<option value=1>Speicher</select>&nbsp; <select id=p40time onchange=updateServerTimelineHours()><option value=3>Letzte 3 Stunden<option value=8>Letzte 8 Stunden<option value=24>Letzter Tag<option value=168>Letzte Woche<option value=720>Letzte 30 Tage</select>&nbsp; <img src=images/link4.png height=10 width=10 title="Datenpunkte herunterladen (.csv)"style=cursor:pointer onclick=p40downloadEvents()>&nbsp;</div><div><input value=Aktualisieren type=button onclick=refreshServerTimelineStats()> &nbsp;<label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>Logarithmische Skala</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><div id=p41title><h1>Mein Server-Tracing</h1></div><div class=areaHead><div class=toright2>Anzeigen <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>Letzte 100<option value=250>Letzte 250<option value=500>Letzte 500<option value=1000>Letzte 1000</select> <input value=Leeren type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="Trace herunterladen (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()>&nbsp;</div><div><input value=Tracing type=button onclick=setServerTracing()> <span id=p41traceStatus>Kein(e)</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>Meine Server-Plugins</h1><div class=areaHead><div class=toright2></div><div><input value="Plugin herunterladen"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="Agentenkerne aktualisieren"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>Hinweis:</b> Plugins wurden geändert. Dies erfordert möglicherweise eine Aktualisierung der Agentenkerne.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>Name<th class=chDescription>Beschreibung<th class=chSite style=text-align:center>Link<th class=chVersion style=text-align:center>Version<th class=chUpgradeAvail style=text-align:center>Neueste<th class=chStatus style=text-align:center>Status<th class=chAction style=text-align:center>Aktion<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>Keine Plugins auf dem Server.</i></div></div><div id=p43 style=display:none><div id=p43BackButton><div class=backButton tabindex=0 onclick=go(42) title=Zurück onkeypress='"Enter"==event.key&&go(42)'><div class=backButtonEx></div></div></div><h1>Meine Server-Plugins - <span id=p43title></span></h1><iframe id=p43iframe frameborder=0 style="width:100%;height:calc(100vh - 245px);max-height:calc(100vh - 245px)"></iframe></div><div id=p50 style=display:none><div id=p50title><h1>Meine Benutzergruppen</h1></div><table class=pTable><tr><td class=h1><td class=style14><div style=float:right></div><div><input type=button id=UsersGroupsSelectAllButton onclick=p50usersSelectallButtonFunction() value="Alle auswählen"> <input type=button id=UsersGroupsGroupActionButton disabled value=Gruppenaktion onclick=p50usersGroupActionFunction()> <input id=NewUserGroupButton type=button onclick=showCreateUserGroupDialog(1) value="Neue Gruppe..."> <input id=DuplicateUserGroupButton type=button style=display:none onclick=showCreateUserGroupDialog(2) value="Dupliziere Gruppe..."></div><td class=h2></table><div id=p50groups></div></div><div id=p51 style=display:none><div id=p51title><div style=float:left><div class=backButton tabindex=0 onclick=goBack() title=Zurück onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>Benutzergruppe - <span id=p51groupName></span></h1></div><div id=p51info style=overflow-y:auto><table style=width:100% cellpadding=0 cellspacing=0><tr><td style=width:auto valign=top><div id=p51group></div><td style=width:20px><td style=width:200px valign=top><picture id=MainUserImage style=border-width:0;height:200px;width:200px;float:right><source type=image/webp width=200 height=200 srcset=images/webp/group-256.webp><img alt=""width=200 height=200 src=images/group-256.png></picture><div style=width:100%;text-align:center><strong><span id=MainUserState></span></strong></div></table><div id=p51group2></div><br></div></div><div id=p52 style=display:none><div id=p52title><h1>My User Recordings</h1></div><table class=pTable><tr><td class=h1><td class=style14><div style=float:right><input type=button onclick=openRecodringPlayer() value="Open Player..."></div><div><input type=button onclick=refreshRecodings() value=Aktualisieren></div><td class=h2></table><div id=p52recordings style=overflow-y:auto></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()>E-Mail verifizieren</a> &nbsp;<a id=termsLinkFooter href=terms>Nutzungsbedingungen &amp; Datenschutz</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>Dateiauswahl</div><select id=d3uploadMode onchange=d3modechange()><option value=1>Lokale Datei hochladen<option value=2>Server-Dateiauswahl</select></div><div id=d3localmode style=display:none><div>Datei hochladen</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=Hoch>&nbsp;</div><div id=d3serverfiles></div></div></div><div id=dialog4><input id=d4WrapButton type=button value="Umbruch an"onclick=d4ToggleWrap()> <input id=d4SizeButton type=button value=Klein onclick=d4ToggleSize()> <textarea id=d4editorarea autocomplete=off style="height:calc(100vh - 286px);width:100%;overflow:scroll;resize:none;white-space:pre"></textarea></div><div id=dialog7><div id=d7meshkvm><h4>Entfernter Desktop via Agent</h4><div><div>Qualität</div><select id=d7bitmapquality dir=rtl></select></div><div><div>Skalierung</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>Bildrate</div><select id=d7framelimiter dir=rtl><option selected value=50>Schnell<option value=100>Mittel<option value=400>Langsam<option value=1000>Sehr langsam</select></div></div><div id=d7amtkvm><h4>Intel® AMT Hardware-KVM</h4><div><div>Bildkodierung</div><select id=d7desktopmode><option value=1>RLE8, am schnellsten<option value=2>RLE16, empfohlen<option value=3>RAW8, langsam<option value=4>RAW16, sehr langsam</select></div><div><div>Weitere Einstellungen</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>Fokus-Werkzeug anzeigen</label> <label style=display:block><input type=checkbox id=d7showcursor>Lokalen Mauszeiger anzeigen</label> <label style=display:block><input type=checkbox id=d7localKeyMap>Lokale Tastaturbelegung</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=Abbrechen onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=OK onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=Löschen 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 nonce=abc>"use strict";var args,urlargs,webState="{{{webstate}}}";for(var i in""!=webState&&(webState=JSON.parse(decodeURIComponent(webState))),webState)"desktopsettings"!=i&&localStorage.setItem(i,webState[i]);if(!webState.loctag)try{localStorage.removeItem("loctag")}catch(e){}var desktop,terminal,files,autoReconnect=!0,powerStatetable=["","eingeschaltet","Schlafen","Schlafen","Schlafen","Ruhezustand","Ausschalten","präsent"],StatusStrs=["Getrennt","Verbinden...","Aufbau...","Verbunden","Intel&reg; AMT verbunden"],agentsStr=["Unbekannt","Windows 32bit Konsole","Windows 64bit Konsole","Windows 32bit Dienst","Windows 64bit Dienst","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 Konsole","Windows MinCore Dienst","NodeJS","ARM-Linaro","ARMv6l / ARMv7l","ARMv8 64bit","ARMv6l / ARMv7l / NoKVM","Unbekannt","Unbekannt","FreeBSD x86-64"],sort=0,searchFocus=0,mapSearchFocus=0,userSearchFocus=0,consoleFocus=0,showRealNames=!1,meshserver=null,meshes={},meshcount=0,nodes=null,usergroups=null,filetree={},userinfo=null,serverinfo=null,events=[],users=null,wssessions=null,nodeShortIdent=0,desktopsettings={encoding:2,showfocus:!1,showmouse:!0,showcad:!0,quality:40,scaling:1024,framerate:50,localkeymap:!1},multidesktopsettings={quality:20,scaling:128,framerate:1e3},debugLevel=parseInt("{{{debuglevel}}}"),features=parseInt("{{{features}}}"),sessionTime=parseInt("{{{sessiontime}}}"),sessionRefreshTimer=null,domain="{{{domain}}}",domainUrl="{{{domainurl}}}",authCookie="{{{authCookie}}}",authRelayCookie="{{{authRelayCookie}}}",logoutControls=JSON.parse(decodeURIComponent("{{{logoutControls}}}")),authCookieRenewTimer=null,multiDesktop={},multiDesktopFilter=null,serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}",amtScanResults=null,debugmode=0,clickOnce=0!=(256&features)&&detectClickOnce(),attemptWebRTC=0!=(128&features),passRequirements="{{{passRequirements}}}";""!=passRequirements&&(passRequirements=JSON.parse(decodeURIComponent(passRequirements)));var customui="{{{customui}}}";customui=""!=customui?JSON.parse(decodeURIComponent(customui)):null;var deskAspectRatio=0;try{deskAspectRatio=parseInt(getstore("deskAspectRatio","0"))}catch(e){}var uiMode=parseInt(getstore("uiMode",1)),webPageStackMenu=!1,webPageFullScreen=!0,nightMode="1"==getstore("nightMode","0"),footerBar="1"==getstore("footerBar","1"),sessionActivity=Date.now(),updateSessionTimer=null,pluginHandlerBuilder={{{pluginHandler}}},pluginHandler=null;null!=pluginHandlerBuilder&&(pluginHandler=new pluginHandlerBuilder);var installedPluginList=null,goBackStack=[],CollapsedGroups={};try{CollapsedGroups=JSON.parse(getstore("_collapse","{}"))}catch(e){}var xterm=null,xtermfit=null,xtermResizeTimer=null,p11DeskConsoleMsgTimer=null,p12TermConsoleMsgTimer=null,p13FilesConsoleMsgTimer=null;function startup(){if(0==(32&features)){var e=null;try{e=top.location.toString().toLowerCase()}catch(e){}if(top!=self&&(null==e||0==top.active))return void(top.location=self.location)}delete(urlargs=parseUriArgs()).viewmode,delete urlargs.gotonode,delete urlargs.gotomesh,delete urlargs.gotouser,delete urlargs.gotougrp,urlargs.key&&(Q("termsLinkFooter").href+="?key="+urlargs.key),(args=parseUriArgs()).locale||null!=(a=getstore("loctag",0))&&"*"!=a&&(args.locale=a);debugmode=args.debug,attemptWebRTC=0,null!=args.webrtc&&(attemptWebRTC=1==args.webrtc),QV("p13AutoConnect",debugmode),QV("autoconnectbutton2",debugmode),QV("autoconnectbutton1",debugmode),nightMode&&(QC("body").add("night"),QS("body")["background-color"]="#000"),toggleFullScreen();var t=0,n=parseInt("{{{hide}}}");(n||args.hide)&&(args.hide&&(t=parseInt(args.hide)),n&&(t|=n)),args.hide=t,QV("uiViewButton5",!(4&args.hide)),adjustPanels();var i="";logoutControls&&null!=logoutControls.name&&(i=format("Willkommen {0}.",logoutControls.name)),null!=logoutControls.logoutUrl&&(i+=format(' <a href="'+logoutControls.logoutUrl+'" style="color:white">Abmelden</a>')),1&args.hide?QH("logoutControlSpan2",i):QH("logoutControlSpan",i),document.onclick=function(e){hideContextMenu()},document.onkeypress=ondockeypress,document.onkeydown=ondockeydown,document.onkeyup=ondockeyup,window.addEventListener("blur",ondocblur,!1),window.onresize=function(){hideContextMenu(),masterUpdate(512),null!=xtermfit&&12==xxcurrentView&&xtermfit.fit()},setTimeout(function(){masterUpdate(512)},200),(meshserver=MeshServerCreateControl(domainUrl,authCookie)).onStateChanged=onStateChanged,meshserver.onMessage=onMessage,meshserver.trace=1==args.trace,meshserver.Start(),Q("sortselect").selectedIndex=sort=getstore("sort",0),Q("sizeselect").selectedIndex=getstore("viewsize",1),Q("KvmSearchInput").value=Q("SearchInput").value=getstore("_search",""),showRealNames=1==getstore("showRealNames",0),Q("RealNameCheckBox").checked=showRealNames,Q("OnlineCheckBox").checked=1==getstore("onlineOnly",0),Q("viewselect").value=getstore("deviceView",1),Q("DeskControl").checked=1==getstore("DeskControl",1),QV("accountChangeEmailAddressSpan",0==(2097152&features)),masterUpdate(3);for(var o=1;o<5;o++)Q("devViewButton"+o).classList.remove("viewSelectorSel");Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel"),Q("p5filetable").addEventListener("drop",p5fileDragDrop,!1),Q("p5filetable").addEventListener("dragover",p5fileDragOver,!1),Q("p5filetable").addEventListener("dragleave",p5fileDragLeave,!1),Q("p13filetable").addEventListener("drop",p13fileDragDrop,!1),Q("p13filetable").addEventListener("dragover",p13fileDragOver,!1),Q("p13filetable").addEventListener("dragleave",p13fileDragLeave,!1),setInterval(updateDeviceTimeline,12e4);var r=null;try{r=localStorage.getItem("desktopsettings")}catch(e){}null!=r&&(desktopsettings=JSON.parse(r)),r=null;try{r=localStorage.getItem("multidesktopsettings")}catch(e){}null!=r&&(multidesktopsettings=JSON.parse(r)),applyDesktopSettings();for(var a="",s=1;s<27;s++)a+="<option value='"+s+"'>Strg-"+String.fromCharCode(64+s)+" ("+s+")</option>";QH("specialkeylist",a),setupGeneralServerStats(),setupServerTimelineStats(),userInterfaceSelectMenu(),setupMeshSummaryStats(),QV("p4UserBatchCreate",0==(524288&features)),d4EditWrapVal=getstore("editorWrap",0),d4EditSizeVal=getstore("editorSize",0),d4ToggleWrap(!0),d4ToggleSize(!0),null!=pluginHandler&&pluginHandler.callHook("onWebUIStartupEnd"),-1==["en","ko","ja","zh-chs"].indexOf("{{{lang}}}")&&""!="{{{lang}}}".toLowerCase()&&QC("body").add("nonenglish");var l=document.getElementsByClassName("topbar_td");for(var d in l)l[d].innerHTML&&(l[d].innerHTML=l[d].innerHTML.split(" ").join("&nbsp;"));if(null!=customui&&customui.devicesbarbuttons){a="";for(var d in customui.devicesbarbuttons){var c="one"==customui.devicesbarbuttons[d].selection||"many"==customui.devicesbarbuttons[d].selection?"disabled":"";a+='<input id="cui:'+d+'" type="button" value="'+customui.devicesbarbuttons[d].name+'" '+c+' onclick=customUIAction(event,"devicesbarbuttons") />'}QH("devCustomUIBar",a)}10<=sessionTime&&(sessionRefreshTimer=setTimeout(refreshCookieSession,Math.round(6e4*sessionTime*.8)))}function refreshCookieSession(){var e=null;try{e=new XDomainRequest}catch(e){}(e=e||new XMLHttpRequest).open("GET",window.location.origin+domainUrl+"refresh.ashx"),e.timeout=15e3,e.onload=function(){sessionRefreshTimer=setTimeout(refreshCookieSession,Math.round(6e4*sessionTime*.8))},e.onerror=e.ontimeout=function(){sessionRefreshTimer=null},e.send()}function customUIAction(e,t){var n=e.srcElement.id;if(0!=n.startsWith("cui:")){var i=customui[t][n.substring(4)];if(null!=i&&"devicesbarbuttons"==t){for(var o=document.getElementsByClassName("DeviceCheckbox"),r=[],a=0;a<o.length;a++)!0===o[a].checked&&r.push(o[a].defaultValue.substring(6));"string"==typeof i.action&&("event"==i.action&&meshserver.send({action:"uicustomevent",section:t,element:n.substring(4),selectedDevices:r}),i.action.startsWith("dialog:")&&showCustomUiDialog(i.action.substring(7),{section:t,element:n.substring(4),selectedDevices:r}))}}}function showCustomUiDialog(e,t){if(null!=customui&&null!=customui.dialogs&&"object"==typeof customui.dialogs[e]){var n="",i=customui.dialogs[e],o=3;if("string"==typeof i.text&&(n+="<div style=margin-bottom:8px>"+i.text+"</div>"),"number"==typeof i.buttons&&(o=i.buttons),"object"==typeof i.elements)for(var r in i.elements){var a=i.elements[r];if("text"==a.type&&(n+=addHtmlValue(a.name,"<input id=cui:"+r+" style=width:230px autocomplete=off />")),"droplist"==a.type){var s="";for(var l in a.options)s+='<option value="'+l+'">'+EscapeHtml(a.options[l])+"</option>";n+=addHtmlValue(a.name,'<select id="cui:'+r+'" style=width:230px autocomplete=off />'+s+"</select>")}}setDialogMode(2,i.title,o,showCustomUiDialogEx,n,{action:"uicustomevent",section:"dialogs",element:e,src:t,values:{}})}}function showCustomUiDialogEx(e,t){if(1==e){var n=customui.dialogs[t.element];if("object"==typeof n.elements)for(var i in n.elements){var o=n.elements[i];"text"==o.type&&(t.values[i]=Q("cui:"+i).value),"droplist"==o.type&&(t.values[i]=Q("cui:"+i).value)}meshserver.send(t)}}function adjustPanels(){var e=args.hide;0==footerBar&&(e|=4),QV("masthead",!(1&e)),QV("topbar",!(2&e)),QV("footer",!(4&e)),QV("p1title",!(8&e)),QV("p2title",!(8&e)),QV("p3title",!(8&e)),QV("p4title",!(8&e)),QV("p5title",!(8&e)),QV("p6title",!(8&e)),QV("p10title",!(8&e)),QV("p11title",!(8&e)),QV("p12title",!(8&e)),QV("p13title",!(8&e)),QV("p14title",!(8&e)),QV("p15title",!(8&e)),QV("p16title",!(8&e)),QV("p17title",!(8&e)),QV("p20title",!(8&e)),QV("p21title",!(8&e)),QV("p30title",!(8&e)),QV("p31title",!(8&e)),QV("p40title",!(8&e)),QV("p41title",!(8&e)),QV("p50title",!(8&e)),QV("p51title",!(8&e)),footerBar?QC("body").remove("nofooter"):QC("body").add("nofooter"),0!=args.hide&&(2==uiMode?(QS("container")["grid-template-rows"]=(1&e?"0":"66")+"px fit-content(48px) auto "+(4&e?"0":"45")+"px",QS("container")["-ms-grid-rows"]=(1&e?"0":"66")+"px fit-content(48px) auto "+(4&e?"0":"45")+"px"):(QS("container")["grid-template-rows"]=(1&e?"0":"66")+"px "+(2&e?"0":"24")+"px auto "+(4&e?"0":"45")+"px",QS("container")["-ms-grid-rows"]=(1&e?"0":"66")+"px "+(2&e?"0":"24")+"px auto "+(4&e?"0":"45")+"px"));var t=(1&e?0:66)+(2&e?0:24)+(4&e?0:45)+(8&e?0:60),n=1<uiMode?24:0;QS("p2info").height="calc(100vh - "+(20+t+n)+"px)",QS("p2info")["max-height"]="calc(100vh - "+(20+t+n)+"px)",QS("p3users")["max-height"]="calc(100vh - "+(50+t)+"px)",QS("p3events").height="calc(100vh - "+(50+t)+"px)",QS("p5filetable").height="calc(100vh - "+(99+t)+"px)",QS("p13filetable").height="calc(100vh - "+(127+t+n)+"px)",QS("serverMainStats").height="calc(100vh - "+(50+t+n)+"px)",QS("serverMainStats")["max-height"]="calc(100vh - "+(50+t+n)+"px)",QS("xdevices")["max-height"]="calc(100vh - "+(46+t)+"px)",QS("xdevicesmap")["max-height"]="calc(100vh - "+(46+t)+"px)",QS("p15agentConsole").height="calc(100vh - "+(84+t+n)+"px)",QS("p15agentConsole")["max-height"]="calc(100vh - "+(84+t+n)+"px)",QS("p15agentConsoleText").height="calc(100vh - "+(81+t+n)+"px)",QS("p15agentConsoleText")["max-height"]="calc(100vh - "+(81+t+n)+"px)";var i=!(0===args.xterm||null!=terminal&&null==xterm);fullscreen?(QS("deskarea3x").height=null,QS("deskarea3x")["max-height"]=null,QS("p14iframe").height=null,QS("p14iframe")["max-height"]=null,i&&(QS("termarea3x").height="calc(100vh - 55px)",QS("termarea3xdiv").height="calc(100vh - 55px)",QS("termarea3x")["max-width"]="calc(1px)")):(QS("deskarea3x").height="calc(100vh - "+(74+t+n)+"px)",QS("deskarea3x")["max-height"]="calc(100vh - "+(74+t+n)+"px)",QS("p14iframe").height="calc(100vh - "+(23+t+n)+"px)",QS("p14iframe")["max-height"]="calc(100vh - "+(23+t+n)+"px)",i&&(QS("termarea3x").height="calc(100vh - "+(74+t+n)+"px)",QS("termarea3xdiv").height="calc(100vh - "+(74+t+n)+"px)",QS("termarea3x")["max-width"]="calc(1px)")),QS("p43iframe").height="calc(100vh - "+(84+t)+"px)",QS("p43iframe")["max-height"]="calc(100vh - "+(84+t)+"px)",QS("p6info").height="calc(100vh - "+(t-50+n)+"px)",QS("p6info")["max-height"]="calc(100vh - "+(t-50+n)+"px)",QS("p10info").height="calc(100vh - "+(20+t+n)+"px)",QS("p10info")["max-height"]="calc(100vh - "+(20+t+n)+"px)",QS("p17info").height="calc(100vh - "+(20+t+n)+"px)",QS("p17info")["max-height"]="calc(100vh - "+(20+t+n)+"px)",QS("p30info").height="calc(100vh - "+(20+t+n)+"px)",QS("p30info")["max-height"]="calc(100vh - "+(20+t+n)+"px)",QS("p51info").height="calc(100vh - "+(20+t+n)+"px)",QS("p51info")["max-height"]="calc(100vh - "+(20+t+n)+"px)",QS("p16events").height="calc(100vh - "+(50+t+n)+"px)",QS("p16events")["max-height"]="calc(100vh - "+(50+t+n)+"px)",QS("p31events").height="calc(100vh - "+(50+t+n)+"px)",QS("p31events")["max-height"]="calc(100vh - "+(50+t+n)+"px)",QS("p41events").height="calc(100vh - "+(48+t+n)+"px)",QS("p41events")["max-height"]="calc(100vh - "+(48+t+n)+"px)",QS("p52recordings").height="calc(100vh - "+(48+t+n)+"px)",QS("p52recordings")["max-height"]="calc(100vh - "+(48+t+n)+"px)",""!="{{currentNode}}".toLowerCase()&&(QV("p10BackButton",!1),QV("p11BackButton",!1),QV("p12BackButton",!1),QV("p13BackButton",!1),QV("p14BackButton",!1),QV("p15BackButton",!1),QV("p16BackButton",!1)),p1updateInfo()}function toggleAspectRatio(e){1===e&&putstore("deskAspectRatio",deskAspectRatio=(deskAspectRatio+1)%3),deskAdjust()}function toggleStackMenu(e){1==webPageFullScreen&&(1===e&&putstore("webPageStackMenu",webPageStackMenu=!webPageStackMenu),0==webPageStackMenu?QC("body").remove("menu_stack"):(QC("body").add("menu_stack"),10<=xxcurrentView&&QC("column_l").remove("room4submenu")),deskAdjust())}function showUserInterfaceSelectMenu(){Q("uiViewButton1").classList.remove("uiSelectorSel"),Q("uiViewButton2").classList.remove("uiSelectorSel"),Q("uiViewButton3").classList.remove("uiSelectorSel"),Q("uiViewButton4").classList.remove("uiSelectorSel"),Q("uiViewButton5").classList.remove("uiSelectorSel");try{Q("uiViewButton"+uiMode).classList.add("uiSelectorSel")}catch(e){}QV("uiMenu","none"==QS("uiMenu").display),nightMode&&Q("uiViewButton4").classList.add("uiSelectorSel"),footerBar&&Q("uiViewButton5").classList.add("uiSelectorSel")}function userInterfaceSelectMenu(e){e&&putstore("uiMode",uiMode=e),webPageFullScreen=uiMode<3,webPageStackMenu=1<uiMode,toggleFullScreen(0),toggleStackMenu(0),webPageStackMenu&&10<=xxcurrentView?QC("column_l").add("room4submenu"):QC("column_l").remove("room4submenu"),adjustPanels()}function toggleNightMode(){(nightMode=!nightMode)?(QC("body").add("night"),QS("body")["background-color"]="#000"):(QC("body").remove("night"),QS("body")["background-color"]="#d3d9d6"),putstore("nightMode",nightMode?"1":"0")}function toggleFooterBarMode(){putstore("footerBar",(footerBar=!footerBar)?"1":"0"),QS("container")["grid-template-rows"]=null,QS("container")["-ms-grid-rows"]=null,adjustPanels()}function toggleFullScreen(e){1===e&&putstore("webPageFullScreen",webPageFullScreen=!webPageFullScreen),0==webPageFullScreen?(QC("body").remove("menu_stack"),QC("body").remove("fullscreen"),QC("body").remove("arg_hide"),10<=xxcurrentView&&QC("column_l").add("room4submenu"),QV("UserDummyMenuSpan",!1)):(QC("body").add("fullscreen"),16&args.hide&&QC("body").add("arg_hide"),QV("page_leftbar",!(16&args.hide)),QV("MainMenuSpan",!(16&args.hide)),10<=xxcurrentView&&QC("column_l").remove("room4submenu"),QV("UserDummyMenuSpan",xxcurrentView<10&&webPageFullScreen)),masterUpdate(512),QV("body",!0)}function getNodeFromId(e){if(null!=nodes)for(var t in nodes)if(nodes[t]._id==e)return nodes[t];return null}function reload(){var e=window.location.href;e.endsWith("/#")&&(e=e.substring(0,e.length-2)),window.location.href=e}function onStateChanged(e,t,n,i){if(0==t){if(setDialogMode(0),go(0),powerTimelineUpdate=powerTimelineNode=powerTimelineReq=powerTimeline=null,deleteAllNotifications(),hideContextMenu(),QV("verifyEmailId2",!1),QV("logoutControl",!1),"noauth"==i)return void QH("p0span","Authentifizierung kann nicht durchgeführt werden");2==n?autoReconnect&&setTimeout(serverPoll,5e3):QH("p0span","Web-Socket kann nicht verbunden werden"),null!=authCookieRenewTimer&&(clearInterval(authCookieRenewTimer),authCookieRenewTimer=null)}else 2==t&&(meshserver.send({action:"usergroups"}),meshserver.send({action:"meshes"}),meshserver.send({action:"nodes",id:"{{currentNode}}"}),null!=pluginHandler&&meshserver.send({action:"plugins"}),""=="{{currentNode}}".toLowerCase()&&meshserver.send({action:"files"}),""=="{{viewmode}}".toLowerCase()&&go(1),authCookieRenewTimer=setInterval(function(){meshserver.send({action:"authcookie"})},18e5))}function serverPoll(){var e=null;try{e=new XDomainRequest}catch(e){}(e=e||new XMLHttpRequest).open("HEAD",window.location.href),e.timeout=15e3,e.onload=function(){reload()},e.onerror=e.ontimeout=function(){setTimeout(serverPoll,1e4)},e.send()}function detectClickOnce(){for(var e in window.navigator.mimeTypes)if("application/x-ms-application"==window.navigator.mimeTypes[e].type)return!0;var t=window.navigator.userAgent.toUpperCase();return 0<=t.indexOf(".NET CLR 3.5")||0<=t.indexOf("(WINDOWS NT ")}function updateSiteAdmin(){var e=userinfo.siteadmin;QV("p2AccountSecurity",0==(4&features)&&0==serverinfo.domainauth&&0!=(4096&features)),QV("managePhoneNumber1",33554432&features&&67108864&features),QV("managePhoneNumber2",33554432&features&&!(67108864&features)),QV("manageEmail2FA",8388608&features),QV("p2AccountPassActions",0==(4&features)&&0==serverinfo.domainauth&&null!=userinfo&&0==userinfo._id.split("/")[2].startsWith("~")),QV("p2ServerActions",21&e),QV("LeftMenuMyServer",21&e),QV("MainMenuMyServer",21&e),QV("p2ServerActionsBackup",1&e),QV("p2ServerActionsRestore",4&e),QV("p2ServerActionsVersion",16&e),QV("MainMenuMyFiles",8&e),QV("LeftMenuMyFiles",8&e),0==(8&e)&&5==xxcurrentView&&(setDialogMode(0),go(1)),null!=currentNode&&gotoDevice(currentNode._id,xxcurrentView,!0),0!=(2&userinfo.siteadmin)?(null==users&&meshserver.send({action:"users"}),null==wssessions&&meshserver.send({action:"wssessioncount"})):(wssessions=users=null,masterUpdate(16384),(4==xxcurrentView||30<=xxcurrentView&&xxcurrentView<40)&&(setDialogMode(0),go(1),currentUser=null)),meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)}),QV("ServerConsole",4294967295===userinfo.siteadmin),QV("ServerTrace",4294967295===userinfo.siteadmin),115==xxcurrentView&&4294967295!=userinfo.siteadmin&&go(6),6==xxcurrentView&&0==(21&userinfo.siteadmin)&&go(1),0!=(21&e)&&meshserver.send({action:"serverstats",interval:1e4})}var updateNaggleTimer=null,updateNaggleFlags=0;function masterUpdate(e){updateNaggleFlags|=e,null==updateNaggleTimer&&(updateNaggleTimer=setTimeout(function(){512&updateNaggleFlags&&center(),1&updateNaggleFlags&&onSearchInputChanged(),2&updateNaggleFlags&&onSortSelectChange(!1),128&updateNaggleFlags&&updateMeshes(),4&updateNaggleFlags&&(updateDevices(),updateDeviceDetails(),21==xxcurrentView&&p21updateMesh()),8&updateNaggleFlags&&drawNotifications(),16&updateNaggleFlags&&32768&features&&updateMapMarkers(),32&updateNaggleFlags&&eventsUpdate(),64&updateNaggleFlags&&32768&features&&refreshMap(!1,!0),256&updateNaggleFlags&&drawDeviceTimeline(),1024&updateNaggleFlags&&deviceEventsUpdate(),2048&updateNaggleFlags&&userEventsUpdate(),4096&updateNaggleFlags&&p20updateMesh(),8192&updateNaggleFlags&&updateUserGroups(),16384&updateNaggleFlags&&updateUsers(),32768&updateNaggleFlags&&updateRecordings(),updateNaggleTimer=null,updateNaggleFlags=0,gotoStartViewPage()},150))}function count2factoraAuths(){var e=0;return 1==userinfo.otpsecret&&e++,8388608&features&&1==userinfo.otpekey&&e++,67108864&features&&null!=userinfo.phone&&e++,null!=userinfo.otphkeys&&(e+=userinfo.otphkeys),0<e&&1==userinfo.otpkeys&&e++,e}var backupCodesWarningDone=!1;function updateSelf(){var e=count2factoraAuths();if(QV("verifyEmailId",!0!==userinfo.emailVerified&&null!=userinfo.email&&1==serverinfo.emailcheck),QV("verifyEmailId2",!0!==userinfo.emailVerified&&null!=userinfo.email&&1==serverinfo.emailcheck),QV("manageOtp",0<e),QV("authPhoneNumberCheck",null!=userinfo.phone),QV("authEmailSetupCheck",1==userinfo.otpekey&&null!=userinfo.email&&1==userinfo.emailVerified),QV("authAppSetupCheck",1==userinfo.otpsecret),QV("authKeySetupCheck",0<userinfo.otphkeys),QV("authCodesSetupCheck",0<userinfo.otpkeys),masterUpdate(4228),0==backupCodesWarningDone&&1==e){addNotification({text:"Bitte fügen Sie Zweifaktor-Sicherungscodes hinzu. Falls der aktuelle Faktor verloren geht, kann dieses Konto nicht wiederhergestellt werden.",title:"Zweifaktor-Authentifizierung"}),backupCodesWarningDone=!0}var t=4294967295==userinfo.siteadmin||0==(64&userinfo.siteadmin);if(QV("p2createMeshLink1",t),QV("p2createMeshLink2",t),QV("getStarted1",t),QV("getStarted2",!t),"number"==typeof userinfo.passchange)if(-1==userinfo.passchange)QH("p2nextPasswordUpdateTime"," - Beim nächsten Anmelden zurücksetzen.");else if(null!=passRequirements&&"number"==typeof passRequirements.reset){var n=userinfo.passchange+86400*passRequirements.reset-Math.floor(Date.now()/1e3);if(n<0)QH("p2nextPasswordUpdateTime"," - Beim nächsten Anmelden zurücksetzen.");else if(n<3600){var i=Math.floor(n/60);QH("p2nextPasswordUpdateTime",format(1==i?" - Zurücksetzen in 1 Minute.":" - Zurücksetzen in {0} Minuten.",i))}else if(n<86400){var o=Math.floor(n/3600);QH("p2nextPasswordUpdateTime",format(1==o?" - Zurücksetzen in 1 Stunde.":" - Zurücksetzen in {0} Stunden.",o))}else{var r=Math.floor(n/86400);QH("p2nextPasswordUpdateTime",format(1==o?" - Zurücksetzen in 1 Tag.":" - Zurücksetzen in {0} Tagen.",r))}}QV("MainMenuMyUsers",null!=users&&0==(4&features)||0!=(512&userinfo.siteadmin)&&0!=(134217728&features)),QV("LeftMenuMyUsers",null!=users&&0==(4&features)||0!=(512&userinfo.siteadmin)&&0!=(134217728&features)),QV("UsersGeneral",null!=users&&0==(4&features)),QV("UsersGroups",null!=users&&0==(4&features)),QV("UsersRecordings",0!=(512&userinfo.siteadmin)&&0!=(134217728&features))}function setSessionActivity(){sessionActivity=Date.now(),QH("idleTimeoutNotify","")}function checkIdleSessionTimeout(){var e=Date.now()-sessionActivity;if(e>serverinfo.timeout)window.location.href="logout";else{var t=Math.round((serverinfo.timeout-e)/1e3);t<=60?QH("idleTimeoutNotify","<br />"+format(1==t?"1 Sekunde bis zur Trennung":"{0} Sekunden bis zur Trennung",t)):(t=Math.round(t/60))<=5&&QH("idleTimeoutNotify","<br />"+format(1==t?"1 Minute bis zur Trennung":"{0} Minuten bis zur Trennung",t))}}function onMessage(e,t){switch(t.action){case"trace":serverTrace.unshift(t),displayServerTrace();break;case"intersession":"removeNotify"==t.subaction&&notificationDelete(t.id);break;case"traceinfo":"object"==typeof t.traceSources&&(null!=t.traceSources&&0<t.traceSources.length?(serverTraceSources=t.traceSources,QH("p41traceStatus",EscapeHtml(t.traceSources.join(", ")))):(serverTraceSources=[],QH("p41traceStatus","Kein(e)")));break;case"serverstats":updateGeneralServerStats(t);break;case"serverwarnings":if(null!=t.warnings&&0<t.warnings.length){var n="";for(var i in t.warnings)n+="<div style=color:red;padding-bottom:6px><b>WARNUNG: "+t.warnings[i]+"</b></div>";QH("serverWarnings",n),QV("serverWarningsDiv",!0)}break;case"servertimelinestats":setServerTimelineStats(t.events);break;case"authcookie":authCookie=t.cookie,authRelayCookie=t.rcookie;break;case"serverinfo":(serverinfo=t.serverinfo).timeout&&(setInterval(checkIdleSessionTimeout,1e4),checkIdleSessionTimeout()),1==debugmode&&console.log("Server time: ",printDateTime(new Date(serverinfo.serverTime)));break;case"userinfo":userinfo=t.userinfo,updateSiteAdmin(),updateSelf();break;case"users":for(var o in users={},t.users)users[t.users[o]._id]=t.users[o];null!=currentUser&&(currentUser=users[currentUser._id]),masterUpdate(16384),updateSelf();break;case"wssessioncount":wssessions=t.wssessions,masterUpdate(16384);break;case"meshes":for(var o in meshes={},t.meshes)meshes[t.meshes[o]._id]=t.meshes[o];null!=currentMesh&&(currentMesh=meshes[currentMesh._id]),masterUpdate(132);break;case"usergroups":var r=0;if(Array.isArray(t.ugroups)){for(var i in usergroups={},t.ugroups)r++,usergroups[t.ugroups[i]._id]=t.ugroups[i];0==r&&(usergroups=null)}else{for(var i in usergroups=t.ugroups,t.ugroups)r++,t.ugroups[i]._id=i;0==r&&(usergroups=null)}masterUpdate(8192);break;case"files":filetree=setupBackPointers(t.filetree),updateFiles(),d3updatefiles();break;case"nodes":for(var o in nodes=[],t.nodes)for(var a in t.nodes[o])null!=t.nodes[o][a]._id?(t.nodes[o][a].namel=t.nodes[o][a].name.toLowerCase(),t.nodes[o][a].rname?t.nodes[o][a].rnamel=t.nodes[o][a].rname.toLowerCase():t.nodes[o][a].rnamel=t.nodes[o][a].namel,t.nodes[o][a].meshnamel=meshes[o]?meshes[o].name.toLowerCase():"*",t.nodes[o][a].meshid=o,t.nodes[o][a].state=t.nodes[o][a].state?t.nodes[o][a].state:0,t.nodes[o][a].icon||(t.nodes[o][a].icon=1),t.nodes[o][a].ident=++nodeShortIdent,nodes.push(t.nodes[o][a])):console.log("Invalid node ("+a+"): "+JSON.stringify(t.nodes));null!=currentNode&&0==IsNodeViewable(currentNode)&&(currentNode=null,go(1)),null!=currentNode&&(null!=(currentNode=getNodeFromId(currentNode._id))?gotoDevice(currentNode._id,xxcurrentView,!0):go(1)),masterUpdate(71);break;case"powertimeline":if(t.nodeid!=powerTimelineReq)break;for(var i in powerTimelineNode=t.nodeid,powerTimeline=t.timeline,powerTimelineUpdate=Date.now()+3e5,powerTimeline)i%2==1&&(powerTimeline[i]=1e3*powerTimeline[i]);currentNode._id==t.nodeid&&masterUpdate(256);break;case"getsysinfo":if(t.nodeid!=powerTimelineReq)break;!0===t.noinfo?updateDeviceDetails(getNodeFromId(t.nodeid)):updateDeviceDetails(getNodeFromId(t.nodeid),t.hardware);break;case"lastconnect":null!=(F=getNodeFromId(t.nodeid))&&(F.lastconnect=t.time,F.lastaddr=t.addr,currentNode._id==F._id&&""==Q("MainComputerState").innerHTML&&QH("MainComputerState","<span>Zuletzt gesehen:<br />"+printDateTime(new Date(F.lastconnect))+"</span>"));break;case"msg":if(null!=t.nodeid){var s=-1;if(null!=nodes)for(var i in nodes)if(nodes[i]._id==t.nodeid){s=i;break}if(-1!=s)if("console"==t.type)p15consoleReceive(nodes[s],t.value,t.source);else if("notify"==t.type){if(0==(8&(a=getstore("notifications",0)))&&null!=t.amtMessage)break;a={text:t.value,title:t.title,icon:t.icon};null!=t.id&&(a.id=t.id),null!=t.nodeid&&(a.nodeid=t.nodeid),null!=t.tag&&(a.tag=t.tag),null!=t.username&&(a.username=t.username),addNotification(a)}else if("ps"==t.type)showDeskToolsProcesses(t);else if("services"==t.type)showDeskToolsServices(t);else if("getclip"==t.type&&"clipboard"==xxdialogTag&&null!=currentNode&&currentNode._id==t.nodeid)Q("d2clipText").value=t.data;else if("setclip"==t.type&&"clipboard"==xxdialogTag&&null!=currentNode&&currentNode._id==t.nodeid)QH("dlgClipStatus",t.success?"<span style=color:green>Erfolg</span>":"<span style=color:red>Fehlgeschlagen</span>"),setTimeout(function(){try{QH("dlgClipStatus","")}catch(e){}},2e3);else if("userSessions"==t.type&&null!=currentNode&&currentNode._id==t.nodeid&&null==desktop){var l=[];if(null!=t.data)for(var i in t.data)"Active"!=t.data[i].State&&"Console"!=t.data[i].StationName&&3!=debugmode||l.push(t.data[i]);if(0==l.length)connectDesktop(null,1,null,t.tag);else if(1==l.length)connectDesktop(null,1,l[0].SessionId,t.tag);else{n="";for(var i in l)n+='<div style="text-align:left;cursor:pointer;background-color:gray;margin:5px;padding:5px;border-radius:5px" onclick=connectDesktop(event,1,'+l[i].SessionId+","+t.tag+")>"+l[i].State+", "+l[i].StationName,l[i].Username&&(l[i].Domain?n+=" - "+l[i].Domain+"/"+l[i].Username:n+=" - "+l[i].Username),n+="</div>";QH("p11DeskSessionSelector",n),QV("p11DeskSessionSelector",!0)}}}else if("notify"==t.type){a={text:t.value,title:t.title,icon:t.icon};null!=t.id&&(a.id=t.id),null!=t.tag&&(a.tag=t.tag),null!=t.username&&(a.username=t.username),addNotification(a)}break;case"getnetworkinfo":if(currentNode._id!=t.nodeid)return;if(updateDeviceDetails(getNodeFromId(t.nodeid),null,t),2==xxdialogMode&&xxdialogTag=="if"+t.nodeid)if(null==t.netif)QH("d2netinfo","Keine Netzwerkschnittstelleninformationen für dieses Gerät verfügbar.");else{n="<div class=dialogText>";if(currentNode.lastconnect&&(n+=addHtmlValue2("Letzte Agenten-Verbindung",printDateTime(new Date(currentNode.lastconnect)))),currentNode.lastaddr){var d=currentNode.lastaddr.split(":");2<d.length?n+=addHtmlValue2("Letzte Agenten-Adresse",currentNode.lastaddr+' <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(currentNode.lastaddr)+'") width=10 height=10>'):isPrivateIP(currentNode.lastaddr)?n+=addHtmlValue2("Letzte Agenten-Adresse",d[0]+' <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(d[0])+'") width=10 height=10>'):n+=addHtmlValue2("Letzte Agenten-Adresse",'<a href="https://iplocation.com/?ip='+d[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+d[0]+'</a> <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(d[0])+'") width=10 height=10>')}for(var i in n+=addHtmlValue2("Letzte Interface-Aktualisierung",printDateTime(new Date(t.updateTime))),t.netif){var c=t.netif[i];n+="<hr />",c.name&&(n+=addHtmlValue2("Name","<b>"+EscapeHtml(c.name)+"</b>")),c.desc&&(n+=addHtmlValue2("Beschreibung",EscapeHtml(c.desc).replace("(R)","&reg;").replace("(r)","&reg;"))),c.dnssuffix&&(n+=addHtmlValue2("DNS-Suffix",EscapeHtml(c.dnssuffix)+' <img src="images/link4.png" title="Name in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.dnssuffix)+'") width=10 height=10>')),c.mac&&(n+=addHtmlValue2("MAC-Adresse",'<a href="https://dnslytics.com/mac-address-lookup/'+c.mac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(c.mac.toLowerCase())+'</a> <img src="images/link4.png" title="MAC-Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.mac.toLowerCase())+'") width=10 height=10>')),c.v4addr&&(n+=addHtmlValue2("IPv4-Adresse",EscapeHtml(c.v4addr)+' <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4addr)+'") width=10 height=10>')),c.v4mask&&(n+=addHtmlValue2("IPv4-Netzmaske",EscapeHtml(c.v4mask)+' <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4mask)+'") width=10 height=10>')),c.v4gateway&&(n+=addHtmlValue2("IPv4-Gateway",EscapeHtml(c.v4gateway)+' <img src="images/link4.png" title="Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4gateway)+'") width=10 height=10>')),c.gatewaymac&&(n+=addHtmlValue2("Gateway-MAC",'<a href="https://dnslytics.com/mac-address-lookup/'+c.gatewaymac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(c.gatewaymac.toLowerCase())+'</a> <img src="images/link4.png" title="MAC-Adresse in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.gatewaymac.toLowerCase())+'") width=10 height=10>'))}n+="</div>",QH("d2netinfo",n)}break;case"serverversion":if(2==xxdialogMode&&"MeshCentralServerUpdate"==xxdialogTag){n="<div class=dialogText>";t.tags.current||(t.tags.current="Unbekannt"),t.tags.stable||(t.tags.stable="Unbekannt"),t.tags.latest||(t.tags.latest="Unbekannt"),n+=addHtmlValue2("Aktuelle Version","<b>"+EscapeHtml(t.tags.current)+"</b>"),n+="<hr />",n+=addHtmlValue2("<label><input id=d2updateCheck1 type=checkbox onclick=server_showVersionDlgUpdate()"+("Unbekannt"==t.tags.stable||t.tags.current==t.tags.stable?" disabled":"")+" /> Stabile Version</label>","<b>"+EscapeHtml(t.tags.stable)+"</b>"),n+=addHtmlValue2("<label><input id=d2updateCheck2 type=checkbox onclick=server_showVersionDlgUpdate()"+("Unbekannt"==t.tags.latest||t.tags.current==t.tags.latest?" disabled":"")+" /> Neueste Version</label>","<b>"+EscapeHtml(t.tags.latest)+"</b>"),n+="</div>",t.tags.current==t.tags.latest&&t.tags.current==t.tags.stable||0==(2048&features)?setDialogMode(2,"MeshCentral-Version",1,null,n):(setDialogMode(2,"MeshCentral-Version",3,server_showVersionDlgEx,n+="<hr />Haken setzen und OK klicken, um die Server-Selbstaktualisierung zu starten.",t.tags),server_showVersionDlgUpdate())}break;case"servererrors":if(2==xxdialogMode&&"MeshCentralServerErrors"==xxdialogTag)if(null==t.data)setDialogMode(2,"MeshCentral-Serverfehler",1,null,"Server besitzt kein Fehlerprotokoll.");else{n='<div class="dialogText dialogTextLog"><pre id=d2ServerErrorsLogPre>'+EscapeHtml(t.data)+"</pre></div>";n+='<br /><div style=float:right><img src=images/link4.png height=10 width=10 title="Fehlerprotokoll herunterladen" style=cursor:pointer onclick=d2CopyServerErrorsToClip()></div>',setDialogMode(2,"MeshCentral-Serverfehler",3,server_showErrorsDlgEx,n+="<div><label><input id=d2clearErrorsCheck type=checkbox onclick=server_showErrorsDlgUpdate() /> Haken setzen und OK klicken, um das Fehlerprotokoll zu löschen.</label></div>"),server_showErrorsDlgUpdate()}break;case"serverconsole":p15consoleReceive("serverconsole",t.value);break;case"events":null!=t.nodeid&&null!=currentNode&&t.nodeid==currentNode._id?(currentDeviceEvents=t.events,masterUpdate(1024)):null!=t.user&&t.user==currentUser.name?(currentUserEvents=t.events,masterUpdate(2048)):(events=t.events,masterUpdate(32));break;case"recordings":p52recordings=t.events,updateRecordings();break;case"getcookie":if("clickonce"==t.tag)if(1==t.trustedCert){var u=window.location.origin+domainUrl+"clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F"+window.location.hostname+"%2Fmeshrelay.ashx%3Fauth="+t.cookie+"&CH={{{webcerthash}}}&AP="+t.protocol+(1==debugmode?"":"&HOL=1");window.open(u,"_blank").opener=null}else{var p=""=="{{{serverRedirPort}}}".toLowerCase()?"{{{serverPublicPort}}}":"{{{serverRedirPort}}}";u="http://"+window.location.hostname+":"+p+domainUrl+"clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F"+window.location.hostname+"%2Fmeshrelay.ashx%3Fauth="+t.cookie+"&CH={{{webcerthash}}}&AP="+t.protocol+(1==debugmode?"":"&HOL=1");window.open(u,"_blank").opener=null}else if("novnc"==t.tag){var m=window.location.origin+domainUrl+"novnc/vnc.html?ws=wss%3A%2F%2F"+window.location.host+"%2Fmeshrelay.ashx%3Fauth%3D"+t.cookie+"&show_dot=1"+(urlargs.key?"&key="+urlargs.key:"");null!=(F=getNodeFromId(t.nodeid))&&(m+="&name="+encodeURIComponentEx(F.name)),window.open(m,"mcnovnc/"+t.nodeid).opener=null}else if("mstsc"==t.tag){u=window.location.origin+domainUrl+"mstsc.html?ws="+t.cookie+(urlargs.key?"&key="+urlargs.key:"");null!=(F=getNodeFromId(t.nodeid))&&(u+="&name="+encodeURIComponentEx(F.name)),window.open(u,"mcmstsc/"+t.nodeid).opener=null}break;case"getNotes":if((a=Q("d2devNotes"))&&t.id==decodeURIComponent(a.attributes.noteid.value))t.notes?QH("d2devNotes",decodeURIComponent(t.notes)):QH("d2devNotes",""),0==("true"==a.attributes.ro.value)&&(a.removeAttribute("readonly"),QE("idx_dlgOkButton",!0),QV("idx_dlgOkButton",!0),focusTextBox("d2devNotes"));break;case"otpauth-request":if(2==xxdialogMode&&"otpauth-request"==xxdialogTag){var g=t.secret;52==g.length?g=g.split(/(.............)/).filter(Boolean).join(" "):32==g.length&&(g=(g=g.split(/(....)/).filter(Boolean).join(" ")).substring(0,20)+"<br/>"+g.substring(20)),QH("d2optinfo","<table style=width:380px><tr><td style=vertical-align:top>"+format('Installiere <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" rel="noreferrer noopener" target=_blank>Google Authenticator</a> oder eine kompatible Applikation und scanne den Barcode, verwende <a href="{0}" rel="noreferrer noopener" target=_blank>diesen Link</a> oder gebe das Geheimnis manuell unten ein. Anschließend gebe den aktuellen 6-stelligen Token nachfolgend ein, um die Zweifaktor-Anmeldung zu aktivieren.',t.url)+'<br /><br />Secret<br /><tt id=d2optsecret secret="'+t.secret+'" style=font-size:12px>'+g+'</tt><br /><br /></td><td style=width:1px;vertical-align:top><a href="'+t.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 />Geben Sie hier den Token für Zweifaktor-Anmeldung ein: <input type=text autocomplete="one-time-code" inputmode="numeric" pattern="[0-9]*" 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>'),new QRCode(Q("qrcode"),{text:t.url,width:128,height:128,colorDark:"#000000",colorLight:"#EEE",correctLevel:QRCode.CorrectLevel.H}),QV("idx_dlgOkButton",!0),QE("idx_dlgOkButton",!1),Q("d2otpauthinput").focus()}break;case"otpauth-setup":if(xxdialogMode)return;setDialogMode(2,"Authentifikator-Anwendung",1,null,t.success?"<b style=color:green>Aktivierung der Authentifikator-Anwendung erfolgreich.</b> Sie benötigen jetzt ein gültiges Token, um sich erneut anzumelden.":"<b style=color:red>Aktivierung der Zweifaktor-Anmeldung fehlgeschlagen.</b> Löschen Sie das Geheimnis aus der Anwendung und versuchen Sie es erneut.Sie haben nur wenige Minuten Zeit, um den richtigen Code einzugeben.");break;case"otpauth-clear":if(xxdialogMode)return;setDialogMode(2,"Authentifikator-Anwendung",1,null,t.success?"<b>Authentifikator-Anwendung entfernt.</b> Sie können diese Funktion jederzeit wieder aktivieren.":"<b style=color:red>Entfernung der Aktivierung der Zweifaktor-Anmeldung fehlgeschlagen.</b> Versuchen Sie es erneut.");break;case"otpauth-getpasswords":if(xxdialogMode)return;n="Einmal-Token können als sekundäre Authentifizierung verwendet werden. Erstellen Sie ein Set, drucken Sie es aus und bewahren Sie es an einem sicheren Ort auf.";if(n+='<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>',t.passwords){var h=0,v="";for(var i in t.passwords){++h%2&&(n+="<tr>");for(var f=""+t.passwords[i].p;f.length<8;)f="0"+f;!0===t.passwords[i].u?(n+="<td>"+f.substring(0,4)+"&nbsp;"+f.substring(4),""!=v&&(v+=" "),v+=f):n+="<td><strike style=color:#BBB>"+f.substring(0,4)+"&nbsp;"+f.substring(4)}}else n+="<tr><td>Keine aktiven Token";n+="</table></div></div><br />",n+="<div><input type=button value=Schließen onclick=setDialogMode(0) style=float:right></input>",n+='<input type=button value="Neue Token generieren" onclick="account_manageOtp(1);"></input>',null!=t.passwords&&(n+='<input type=button value="Token löschen" onclick="account_manageOtp(2);"></input>',n+='&nbsp;<img src=images/link4.png height=10 width=10 title="Gültige Codes in Zwischenablage kopieren" style=cursor:pointer onclick=copyTextToClip2("'+encodeURIComponentEx(v)+'")>'),setDialogMode(2,"Sicherungscodes verwalten",8,null,n+="</div><br />","otpauth-manage");break;case"otp-hkey-get":if(xxdialogMode&&"otpauth-hardware-manage"!=xxdialogTag)return;var k='<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>',b="</table></div></div>";n='<a href="https://www.yubico.com/" rel="noreferrer noopener" target="_blank">Hardware-Schlüssel</a> werden für Zweifaktor-Anmeldung verwendet.';if(n+='<div style="max-height:150px;overflow-y:auto;overflow-x:hidden;margin-top:6px;margin-bottom:6px">',t.keys&&0<t.keys.length)for(var i in t.keys){var x=t.keys[i];n+=k+'<tr style=margin:5px><td style=width:30px><img width=24 height=18 src="images/hardware-key-'+(2==x.type?"OTP":"WebAuthn")+'-24.png" style=margin-top:4px><td style=width:250px>'+x.name+'<td><input type=button value="Entfernen" onclick=account_removehkey('+x.i+")></input>"+b}else n+=k+"<tr style=text-align:center><td>Keine Schlüssel konfiguriert"+b;n+="</div>",n+='<div><input type=button value="Schließen" onclick=setDialogMode(0) style=float:right></input>',0!=(131072&features)&&(n+='<input id=d2addkey3 type=button value="Schlüssel hinzufügen" onclick="account_addhkey(3);"></input>'),0!=(16384&features)&&(n+='<input id=d2addkey2 type=button value="YubiKey&reg; OTP hinzufügen" onclick="account_addhkey(2);"></input>'),setDialogMode(2,"Sicherheitsschlüssel verwalten",8,null,n+="</div><br />","otpauth-hardware-manage"),0==u2fSupported()&&QE("d2addkey1",!1);break;case"otp-hkey-yubikey-add":t.result?meshserver.send({action:"otp-hkey-get"}):setDialogMode(2,"Sicherheitsschlüssel hinzufügen",1,null,"<br />Fehler, Schlüssel kann nicht hinzugefügt werden.<br /><br />");break;case"otp-hkey-setup-response":if(xxdialogMode&&"otpauth-hardware-manage"!=xxdialogTag)return;1==t.result?meshserver.send({action:"otp-hkey-get"}):setDialogMode(2,"Sicherheitsschlüssel hinzufügen",1,null,"<br />FEHLER: Schlüssel kann nicht hinzugefügt werden.<br /><br />","otpauth-hardware-manage");break;case"webauthn-startregister":if(xxdialogMode&&"otpauth-hardware-manage"!=xxdialogTag)return;setDialogMode(2,"Sicherheitsschlüssel hinzufügen",2,null,n='Drücken Sie jetzt die Schlüsseltaste.<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='+t.name+" />");var y=t.request;t.request.challenge=Uint8Array.from(atob(t.request.challenge),function(e){return e.charCodeAt(0)}),t.request.user.id=Uint8Array.from(atob(t.request.user.id),function(e){return e.charCodeAt(0)}),setTimeout(function(){navigator.credentials.create({publicKey:y}).then(function(e){var t={rawId:btoa(String.fromCharCode.apply(null,new Uint8Array(e.rawId))),response:{attestationObject:btoa(String.fromCharCode.apply(null,new Uint8Array(e.response.attestationObject))),clientDataJSON:btoa(String.fromCharCode.apply(null,new Uint8Array(e.response.clientDataJSON)))},type:e.type};meshserver.send({action:"webauthn-endregister",response:t}),setDialogMode(0)},function(e){setDialogMode(2,"Sicherheitsschlüssel hinzufügen",1,null,"FEHLER:"+e)})},100);break;case"verifyPhone":if(xxdialogMode&&"verifyPhone"!=xxdialogTag)return;n='<table><tr><td><img src="images/phone80.png" style=padding:8px>';n+="<td>Check your phone and enter the verification code.",setDialogMode(2,"Phone Notifications",3,account_managePhoneConfirm,n+='<br /><br /><div style=width:100%;text-align:center>Verification code: <input type=tel pattern="[0-9]" inputmode="number" maxlength=6 id=d2phoneCodeInput onKeyUp=account_managePhoneCodeValidate() onkeypress="if (event.key==\'Enter\') account_managePhoneCodeValidate(1)"></div></table>',t.cookie),Q("d2phoneCodeInput").focus(),account_managePhoneCodeValidate();break;case"event":if(!t.event.nolog){if(currentNode&&t.event.nodeid==currentNode._id){currentDeviceEvents.unshift(t.event);for(var w=parseInt(p16limitdropdown.value);currentDeviceEvents.length>w;)currentDeviceEvents.pop();masterUpdate(1024)}if(currentUser&&t.event.userid==currentUser._id){currentUserEvents.unshift(t.event);for(w=parseInt(p31limitdropdown.value);currentUserEvents.length>w;)currentUserEvents.pop();masterUpdate(2048)}events.unshift(t.event);for(w=parseInt(p3limitdropdown.value);events.length>w;)events.pop();masterUpdate(32)}if(t.event.noact)break;switch(t.event.action){case"recording":null!=p52recordings&&(p52recordings.unshift(t.event),t.event.present=1,updateRecordings());break;case"userWebState":try{if(null!=localStorage){var S=localStorage.getItem("showRealNames"),D=localStorage.getItem("uiMode"),C=localStorage.getItem("sort"),M=localStorage.getItem("loctag"),E=localStorage.getItem("nightMode"),A=localStorage.getItem("footerBar"),T=JSON.parse(t.event.state);for(var i in T)localStorage.setItem(i,T[i]);null!=T.deskAspectRatio&&T.deskAspectRatio!=deskAspectRatio&&(deskAspectRatio=T.deskAspectRatio,deskAdjust()),null!=T.showRealNames&&T.showRealNames!=S&&(showRealNames=Q("RealNameCheckBox").checked="1"==T.showRealNames,masterUpdate(6)),null!=T.uiMode&&T.uiMode!=D&&userInterfaceSelectMenu(parseInt(T.uiMode)),null!=T.sort&&T.sort!=C&&(document.getElementById("sortselect").selectedIndex=sort=parseInt(T.sort),masterUpdate(6)),null!=T.loctag&&T.loctag!=M&&(null!=T.loctag?args.locale=T.loctag:delete args.locale,masterUpdate(4294967295)),null!=T.nightMode&&T.nightMode!=E&&((nightMode="1"==T.nightMode)?(QC("body").add("night"),QS("body")["background-color"]="#000"):(QC("body").remove("night"),QS("body")["background-color"]="#d3d9d6")),null!=T.footerBar&&T.footerBar!=A&&(footerBar="1"==T.footerBar,QS("container")["grid-template-rows"]=null,QS("container")["-ms-grid-rows"]=null,adjustPanels())}}catch(e){}break;case"servertimelinestats":addServerTimelineStats(t.event.data);break;case"accountcreate":case"accountchange":if(userinfo._id==t.event.account._id){var N=t.event.account.siteadmin?t.event.account.siteadmin:0,U=userinfo.siteadmin?userinfo.siteadmin:0;(t.event.account.quota!=userinfo.quota||0==(8&userinfo.siteadmin)&&0!=(8&t.event.account.siteadmin))&&meshserver.send({action:"files"});var _=userinfo.groups;if(userinfo=t.event.account,U!=N&&updateSiteAdmin(),updateSelf(),0!=(2&userinfo.siteadmin)){var I=_||[],V=userinfo.groups?userinfo.groups:[];I.join(",")!=V.join(",")&&(users=wssessions=null,meshserver.send({action:"users"}),meshserver.send({action:"wssessioncount"}))}t.event.nodeListChange==userinfo._id&&meshserver.send({action:"nodes"})}if(null==users)break;null==userinfo.groups||0==userinfo.groups.length||1==findOne(t.event.account.groups,userinfo.groups)?users[t.event.account._id]=t.event.account:delete users[t.event.account._id],masterUpdate(16388);break;case"accountremove":if(null==users)break;delete users[t.event.userid],masterUpdate(16384);break;case"createusergroup":case"usergroupchange":null==usergroups&&(usergroups={});var z=usergroups[t.event.ugrpid];null==z?usergroups[t.event.ugrpid]={_id:t.event.ugrpid,name:t.event.name,desc:t.event.desc,domain:t.event.domain,links:t.event.links}:(z.name=t.event.name,t.event.desc?z.desc=t.event.desc:delete z.desc,t.event.links?z.links=t.event.links:delete z.links),masterUpdate(28672),meshserver.send({action:"meshes"}),meshserver.send({action:"nodes"});break;case"deleteusergroup":if(null!=usergroups&&null!=usergroups[t.event.ugrpid]){delete usergroups[t.event.ugrpid];var R=0;for(var i in usergroups)R++;0==R&&(usergroups=null),masterUpdate(24576)}break;case"createmesh":null!=meshes[t.event.meshid]||!serverinfo.manageAllDeviceGroups&&null==t.event.links[userinfo._id]||(meshes[t.event.meshid]={_id:t.event.meshid,name:t.event.name,mtype:t.event.mtype,desc:t.event.desc,links:t.event.links},masterUpdate(24708),meshserver.send({action:"files"}));break;case"meshchange":if(null==meshes[t.event.meshid]){var B=!1;for(var i in null!=t.event.links[userinfo._id]&&(B=!0),null!=userinfo.links[t.event.meshid]&&(B=!0),userinfo.links)i.startsWith("ugrp/")&&null!=t.event.links[i]&&(B=!0);B&&(meshes[t.event.meshid]={_id:t.event.meshid,name:t.event.name,mtype:t.event.mtype,desc:t.event.desc,links:t.event.links},meshserver.send({action:"nodes"}))}else{if(null!=t.event.name)for(var i in meshes[t.event.meshid].name=t.event.name,nodes)nodes[i].meshid==t.event.meshid&&(nodes[i].meshnamel=t.event.name.toLowerCase());if(null!=t.event.desc&&(meshes[t.event.meshid].desc=t.event.desc),null!=t.event.flags&&(meshes[t.event.meshid].flags=t.event.flags),null!=t.event.consent&&(meshes[t.event.meshid].consent=t.event.consent),t.event.links&&(meshes[t.event.meshid].links=t.event.links),t.event.amt&&(meshes[t.event.meshid].amt=t.event.amt),null!=t.event.invite?meshes[t.event.meshid].invite=t.event.invite:delete meshes[t.event.meshid].invite,0==IsMeshViewable(t.event.meshid)){20==xxcurrentView&&currentMesh==meshes[t.event.meshid]&&go(2),delete meshes[t.event.meshid];var H=[];for(var i in nodes)(nodes[i].meshid!=t.event.meshid||null!=userinfo.links&&null!=userinfo.links[nodes[i]._id])&&H.push(nodes[i]);nodes=H,10<=xxcurrentView&&xxcurrentView<20&&currentNode&&!IsNodeViewable(currentNode)&&(setDialogMode(0),go(1))}}masterUpdate(24708),currentNode&&!IsNodeViewable(currentNode)&&(currentNode=null,10<=xxcurrentView&&xxcurrentView<20&&go(1)),20==xxcurrentView&&currentMesh._id==t.event.meshid&&masterUpdate(4096);break;case"deletemesh":meshes[t.event.meshid]&&(delete meshes[t.event.meshid],masterUpdate(128),meshserver.send({action:"files"}));H=[];if(null!=nodes)for(var i in nodes)nodes[i].meshid!=t.event.meshid&&H.push(nodes[i]);nodes=H,masterUpdate(24580),20<=xxcurrentView&&xxcurrentView<30&&currentMesh._id==t.event.meshid&&(setDialogMode(0),go(2)),10<=xxcurrentView&&xxcurrentView<20&&currentNode&&!IsNodeViewable(currentNode)&&(setDialogMode(0),go(1));break;case"addnode":var F=t.event.node;if(!meshes[F.meshid])break;if(null!=getNodeFromId(F._id))break;F.namel=F.name.toLowerCase(),F.rname?F.rnamel=F.rname.toLowerCase():F.rnamel=F.namel,F.meshnamel=meshes[F.meshid]?meshes[F.meshid].name.toLowerCase():"*",F.state=0,F.icon||(F.icon=1),F.ident=++nodeShortIdent,nodes.push(F),masterUpdate(23);break;case"removenode":s=-1;for(var i in nodes)if(nodes[i]._id==t.event.nodeid){s=i;break}if(-1!=s){F=nodes[s];currentNode==F&&(10<=xxcurrentView&&xxcurrentView<20&&(setDialogMode(0),go(1)),currentNode=null),nodes.splice(s,1),masterUpdate(20)}break;case"changenode":s=-1;for(var i in nodes)if(nodes[i]._id==t.event.nodeid){s=i;break}if(-1!=s)(F=nodes[s]).name=t.event.node.name,F.rname=t.event.node.rname,F.users=t.event.node.users,F.host=t.event.node.host,F.desc=t.event.node.desc,F.ip=t.event.node.ip,F.osdesc=t.event.node.osdesc,F.publicip=t.event.node.publicip,F.iploc=t.event.node.iploc,F.wifiloc=t.event.node.wifiloc,F.gpsloc=t.event.node.gpsloc,F.tags=t.event.node.tags,F.userloc=t.event.node.userloc,F.rdpport=t.event.node.rdpport,F.rfbport=t.event.node.rfbport,F.consent=t.event.node.consent,null!=t.event.node.links?F.links=t.event.node.links:delete F.links,null!=t.event.node.agent&&(null==F.agent&&(F.agent={}),null!=t.event.node.agent.ver&&(F.agent.ver=t.event.node.agent.ver),null!=t.event.node.agent.id&&(F.agent.id=t.event.node.agent.id),null!=t.event.node.agent.caps&&(F.agent.caps=t.event.node.agent.caps),null!=t.event.node.agent.core?F.agent.core=t.event.node.agent.core:F.agent.core&&delete F.agent.core,F.agent.tag=t.event.node.agent.tag),null!=t.event.node.intelamt&&(null==F.intelamt&&(F.intelamt={}),null!=t.event.node.intelamt.state&&(F.intelamt.state=t.event.node.intelamt.state),null!=t.event.node.intelamt.host&&(F.intelamt.user=t.event.node.intelamt.host),null!=t.event.node.intelamt.user&&(F.intelamt.user=t.event.node.intelamt.user),null!=t.event.node.intelamt.tls&&(F.intelamt.tls=t.event.node.intelamt.tls),null!=t.event.node.intelamt.ver&&(F.intelamt.ver=t.event.node.intelamt.ver),null!=t.event.node.intelamt.tag&&(F.intelamt.tag=t.event.node.intelamt.tag),null!=t.event.node.intelamt.uuid&&(F.intelamt.uuid=t.event.node.intelamt.uuid),null!=t.event.node.intelamt.realm&&(F.intelamt.realm=t.event.node.intelamt.realm)),null!=t.event.node.av&&(F.av=t.event.node.av),F.namel=F.name.toLowerCase(),F.rname?F.rnamel=F.rname.toLowerCase():F.rnamel=F.namel,t.event.node.icon&&(F.icon=t.event.node.icon),masterUpdate(30),refreshDevice(F._id),currentNode==F&&null!=xxdialogMode&&"@xxmap"==xxdialogTag&&p10showNodeLocationDialog();break;case"nodemeshchange":s=-1;for(var i in nodes)if(nodes[i]._id==t.event.nodeid){s=i;break}if(-1!=s){F=nodes[s];null!=meshes[t.event.newMeshId]||null!=userinfo.links&&null!=userinfo.links[F._id]?(F.meshid=t.event.newMeshId,F.meshnamel=meshes[t.event.newMeshId]?meshes[t.event.newMeshId].name.toLowerCase():"*",masterUpdate(7)):(10<=xxcurrentView&&xxcurrentView<20&&!IsNodeViewable(currentNode)&&(currentNode=null,setDialogMode(0),go(1)),nodes.splice(s,1),masterUpdate(20)),refreshDevice(t.event.nodeid)}else{F=t.event.node;if(!meshes[F.meshid])break;F.namel=F.name.toLowerCase(),F.rname?F.rnamel=F.rname.toLowerCase():F.rnamel=F.namel,F.meshnamel=meshes[F.meshid]?meshes[F.meshid].name.toLowerCase():"*",F.state=0,F.icon||(F.icon=1),F.ident=++nodeShortIdent,nodes.push(F),masterUpdate(23)}break;case"nodeconnect":s=-1;for(var i in nodes)if(nodes[i]._id==t.event.nodeid){s=i;break}if(-1!=s){F=nodes[s],a=getstore("notifications",0);t.event.meshid&&userinfo.links&&userinfo.links[t.event.meshid]&&userinfo.links[t.event.meshid].notify?a&=userinfo.links[t.event.meshid].notify:a=0,2&a&&(0==(1&F.conn)&&0!=(1&t.event.conn)&&addNotification({text:"Agent verbunden",title:F.name,icon:F.icon,nodeid:F._id}),0==(2&F.conn)&&0!=(2&t.event.conn)&&addNotification({text:"Intel AMT erkannt",title:F.name,icon:F.icon,nodeid:F._id}),0==(4&F.conn)&&0!=(4&t.event.conn)&&addNotification({text:"Intel AMT CIRA verbunden",title:F.name,icon:F.icon,nodeid:F._id}),0==(16&F.conn)&&0!=(16&t.event.conn)&&addNotification({text:"MQTT verbunden",title:F.name,icon:F.icon,nodeid:F._id})),4&a&&(0!=(1&F.conn)&&0==(1&t.event.conn)&&addNotification({text:"Agent getrennt",title:F.name,icon:F.icon,nodeid:F._id}),0!=(2&F.conn)&&0==(2&t.event.conn)&&addNotification({text:"Intel AMT nicht erkannt",title:F.name,icon:F.icon,nodeid:F._id}),0!=(4&F.conn)&&0==(4&t.event.conn)&&addNotification({text:"Intel AMT CIRA getrennt",title:F.name,icon:F.icon,nodeid:F._id}),0!=(16&F.conn)&&0==(16&t.event.conn)&&addNotification({text:"MQTT getrennt",title:F.name,icon:F.icon,nodeid:F._id})),F.conn=t.event.conn,F.pwr=t.event.pwr,F.lastconnect=Date.now(),0==(1&F.conn)&&delete F.sessions,masterUpdate(21),refreshDevice(F._id)}break;case"wssessioncount":null!=wssessions&&(0==t.event.count&&wssessions[t.event.userid]?delete wssessions[t.event.userid]:wssessions[t.event.userid]=t.event.count,masterUpdate(16384));break;case"login":null!=users&&users[t.event.userid]&&(users[t.event.userid].login=Math.floor(new Date(t.event.time).getTime()/1e3));break;case"scanamtdevice":if(null==xxdialogMode||!Q("dp1range")||Q("dp1range").value!=t.event.range)return;n="";if(null==t.event.results)n="<div style=width:100%;text-align:center;margin-top:12px>Dieser Adressbereich kann nicht gescannt werden.</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>";else{for(var i in amtScanResults=t.event.results,t.event.results){var G=t.event.results[i],P=G.hostname;"host"==G.hosttype&&(P=capitalizeFirstLetter(P.split(".")[0])),20<P.length&&(P=P.substring(0,20)+"...");var L='<b title="'+EscapeHtml(G.hostname)+'">'+EscapeHtml(P)+"</b> - v"+G.ver;2==G.state?1==G.tls?L+=" mit TLS.":L+=" ohne TLS.":L+=" not activated.",n+='<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>'+L+"</div></div></div>"}""==n&&(n="<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>")}QH("dp1results",n),QE("dp1range",!0),QE("dp1rangebutton",!0);break;case"notify":a={text:t.event.value,title:t.event.title,icon:t.event.icon};null!=t.id&&(a.id=t.id),null!=t.event.tag&&(a.tag=t.event.tag),addNotification(a);break;case"traceinfo":"object"==typeof t.event.traceSources&&(null!=t.event.traceSources&&0<t.event.traceSources.length?(serverTraceSources=t.event.traceSources,QH("p41traceStatus",EscapeHtml(t.event.traceSources.join(", ")))):(serverTraceSources=[],QH("p41traceStatus","Kein(e)")));break;case"sysinfohash":null!=currentNode&&t.event.nodeid==powerTimelineReq&&meshserver.send({action:"getsysinfo",nodeid:t.event.nodeid});break;case"devicesessions":if(null==(F=getNodeFromId(t.event.nodeid)))break;if(F.sessions=t.event.sessions,null!=F.sessions){for(var i in F.sessions)0==Object.keys(F.sessions[i]).length&&delete F.sessions[i];0==Object.keys(F.sessions).length&&delete F.sessions}masterUpdate(4),null!=currentNode&&currentNode._id==t.event.nodeid&&gotoDevice(currentNode._id,xxcurrentView,!0),xxdialogTag=="SESSIONS-"+t.event.nodeid&&showDeviceSessions(t.event.nodeid,!0);break;case"stopped":break;case"updatePluginList":installedPluginList=t.event.list,updatePluginList();break;case"pluginStateChange":if(null==pluginHandler)break;pluginHandler.refreshPluginHandler();break;case"plugin":if(null==pluginHandler)break;try{pluginHandler[t.event.plugin][t.event.pluginaction](t)}catch(e){console.log("PluginHandler konnte keine Ereignismeldung anzeigen:",e)}}break;case"createInviteLink":if(xxdialogTag!=t.meshid)break;var O=serverinfo.name;-1!=O.indexOf(".")&&0==(2&features)||(O=window.location.hostname);var K;domainUrl.substring(0,domainUrl.length-1);if(1==serverinfo.https)K="https://"+O+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"agentinvite?c="+t.cookie+(urlargs.key?"&key="+urlargs.key:"");else K="http://"+O+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"agentinvite?c="+t.cookie+(urlargs.key?"&key="+urlargs.key:"");Q("agentInvitationLink").href=K;var W=format(1==t.expire?"1 Stunde":"{0} Stunden",t.expire);24==t.expire&&(W="1 Tag"),168==t.expire&&(W="1 Woche"),5040==t.expire&&(W="1 Monat"),0==t.expire&&(W="Unbegrenzt"),QH("agentInvitationLink",format("Einladungslink ({0})",W)),QV("agentInvitationLinkDiv",!0);break;case"getmqttlogin":if(null==currentNode||currentNode._id!=t.nodeid||null!=xxdialogMode)return;n="Diese Einstellungen können verwendet werden, um MQTT für dieses Gerät zu verbinden.<br /><br />";delete t.action,delete t.nodeid,setDialogMode(2,"MQTT-Zugangsdaten",1,null,n+="<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>"+JSON.stringify(t)+"</textarea>");break;case"stopped":autoReconnect=!1,QH("p0span",t.msg);break;case"updatePluginList":installedPluginList=t.list,updatePluginList();break;case"pluginVersionsAvailable":if(null==pluginHandler)break;updatePluginList(t.list);break;case"downgradePluginVersions":var j='<select id="lastPluginVersion">';t.info.versionList.forEach(function(e){j+='<option value="'+e.zipball_url+'">'+e.name+"</option>"}),j+="</select>",setDialogMode(2,"Plugin-Aktion",3,pluginActionEx,format("Select the version to downgrade the plugin: {0}",t.info.name)+"<hr />"+j+"<hr />Bitte beachten Sie, dass ein Downgrade nicht empfohlen wird. Bitte tun Sie dies nur für den Fall, dass ein kürzlich durchgeführtes Upgrade einen Defekt aufweist.NaN"+t.info.id+'" />');break;case"pluginError":setDialogMode(2,"Plugin-Fehler",1,null,t.msg);break;case"plugin":if(null==pluginHandler||"string"!=typeof t.plugin)break;try{pluginHandler[t.plugin][t.method](e,t)}catch(e){console.log("Error loading plugin handler ("+e+")")}}}function gotoStartViewPage(){var e=parseInt("{{viewmode}}");if(-1==xxcurrentView){if(""!="{{currentNode}}".toLowerCase()){if(null==getNodeFromId("{{currentNode}}"))return;gotoDevice("{{currentNode}}",e)}else if(null!=args.gotonode){if(null==getNodeFromId("node/"+domain+"/"+args.gotonode))return;gotoDevice("node/"+domain+"/"+args.gotonode,e),goBackStack.push(1)}else if(null!=args.gotomesh){if(null==meshes["mesh/"+domain+"/"+args.gotomesh])return;gotoMesh("mesh/"+domain+"/"+args.gotomesh),go(e),goBackStack.push(2)}else if(null!=args.gotouser){var t=args.gotouser;if(args.gotouser.indexOf("/")<0&&(t="user/"+domain+"/"+args.gotouser),null==users||null==users[t])return;gotoUser(t),go(e),goBackStack.push(4)}else if(null!=args.gotougrp){var n=args.gotougrp;if(args.gotougrp.indexOf("/")<0&&(n="ugrp/"+domain+"/"+args.gotougrp),null==usergroups||null==usergroups[n])return;gotoUserGroup(n),go(e),goBackStack.push(50)}else isNaN(e)?(setDialogMode(0),go(1)):go(e);delete args.gotonode,delete args.gotomesh,delete args.gotouser,delete args.gotougrp}}function onRealNameCheckBox(){putstore("showRealNames",(showRealNames=Q("RealNameCheckBox").checked)?1:0),masterUpdate(6)}function onOnlineCheckBox(e){putstore("onlineOnly",Q("OnlineCheckBox").checked?1:0),onDeviceSearchChanged(e)}function onDeviceViewChange(e){null!=e&&(Q("viewselect").value=e);for(var t=1;t<5;t++)Q("devViewButton"+t).classList.remove("viewSelectorSel");Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel"),putstore("deviceView",Q("viewselect").value),putstore("viewsize",Q("sizeselect").value),masterUpdate(4),setTimeout(function(){masterUpdate(512)},200)}function ondockeypress(e){if(setSessionActivity(),!xxdialogMode&&11==xxcurrentView&&desktop&&Q("DeskControl").checked){if(null!=currentNode){var t=GetNodeRights(currentNode);if(0==(4294967295==t||0!=(8&t)&&0==(256&t)))return!1;if(1==(4294967295!=t&&0!=(8&t)&&0==(256&t)&&0!=(4096&t))&&(1==e.altKey||1==e.ctrlKey||e.keyCode<32&&8!=e.keyCode&&13!=e.keyCode||90<e.keyCode))return!1}return desktop.m.handleKeys(e)}if(!xxdialogMode&&12==xxcurrentView&&terminal&&3==terminal.State&&null==xterm)return terminal.m.TermHandleKeys(e);if(!xxdialogMode&&(15==xxcurrentView||115==xxcurrentView))return agentConsoleHandleKeys(e);if(!xxdialogMode&&4==xxcurrentView){if(1==e.ctrlKey||1==e.altKey||1==e.metaKey)return;var n=0;if(e.key){if(1===e.key.length&&0==userSearchFocus&&(Q("UserSearchInput").value=Q("UserSearchInput").value+e.key,n=1),8==e.keyCode&&0==userSearchFocus){var i=Q("UserSearchInput").value;Q("UserSearchInput").value=i.substring(0,i.length-1),n=1}27==e.keyCode&&(Q("UserSearchInput").value="",n=1)}else 0!=e.charCode&&0==userSearchFocus&&(Q("UserSearchInput").value=Q("UserSearchInput").value+String.fromCharCode(e.charCode),n=1);if(0<n)return 1==n&&onUserSearchInputChanged(),haltEvent(e)}if(!xxdialogMode&&1==xxcurrentView){if(1==e.ctrlKey&&96==e.charCode)return showRealNames=!showRealNames,putstore("showRealNames",(Q("RealNameCheckBox").value=showRealNames)?1:0),void masterUpdate(6);if(1!=e.ctrlKey&&1!=e.altKey&&1!=e.metaKey){if(Q("viewselect").value<4){n=0;if(e.key){if(1===e.key.length&&0==searchFocus&&(Q("KvmSearchInput").value=Q("SearchInput").value=Q("SearchInput").value+e.key,n=1),8==e.keyCode&&0==searchFocus){i=Q("SearchInput").value;Q("KvmSearchInput").value=Q("SearchInput").value=i.substring(0,i.length-1),n=1}27==e.keyCode&&(Q("KvmSearchInput").value=Q("SearchInput").value="",n=1)}else 0!=e.charCode&&0==searchFocus&&(Q("KvmSearchInput").value=Q("SearchInput").value=Q("SearchInput").value+String.fromCharCode(e.charCode),n=1);if(0<n)return 1==n&&masterUpdate(5),haltEvent(e)}4==Q("viewselect").value&&(e.key?(1===e.key.length&&0==mapSearchFocus&&(Q("mapSearchLocation").value=Q("mapSearchLocation").value+e.key,n=1),27==e.keyCode&&(Q("mapSearchLocation").value="",mapCloseSearchWindow(),n=1),13==e.keyCode&&getSearchLocation()):0!=e.charCode&&0==mapSearchFocus&&(Q("mapSearchLocation").value=Q("mapSearchLocation").value+String.fromCharCode(e.charCode),n=1))}}}function ondockeydown(e){if(setSessionActivity(),!xxdialogMode&&11==xxcurrentView&&desktop&&Q("DeskControl").checked){if(null!=currentNode){var t=GetNodeRights(currentNode);if(0==(4294967295==t||0!=(8&t)&&0==(256&t)))return!1;if(1==(4294967295!=t&&0!=(8&t)&&0==(256&t)&&0!=(4096&t))&&(1==e.altKey||1==e.ctrlKey||e.keyCode<32&&8!=e.keyCode&&13!=e.keyCode||90<e.keyCode))return!1}return desktop.m.handleKeyDown(e)}if(!xxdialogMode&&12==xxcurrentView&&terminal&&3==terminal.State&&null==xterm&&(terminal.m.TermHandleKeyDown(e),37<=e.keyCode&&e.keyCode<=40&&haltEvent(e)),!xxdialogMode&&13==xxcurrentView&&116==e.keyCode&&null!=p13filetree)return haltEvent(e),!1;if(!xxdialogMode&&(15==xxcurrentView||115==xxcurrentView))return agentConsoleHandleKeys(e);if(!xxdialogMode&&4==xxcurrentView){if(8===e.keyCode&&0==userSearchFocus){var n=Q("UserSearchInput").value;Q("UserSearchInput").value=n.substring(0,n.length-1),i=1}if(27===e.keyCode&&(Q("UserSearchInput").value="",i=1),0<i)return 1==i&&masterUpdate(5),haltEvent(e)}if(!xxdialogMode&&1==xxcurrentView&&1!=e.ctrlKey&&1!=e.altKey&&1!=e.metaKey){var i=0;if(Q("viewselect").value<4){if(8===e.keyCode&&0==searchFocus){n=Q("SearchInput").value;Q("KvmSearchInput").value=Q("SearchInput").value=n.substring(0,n.length-1),i=1}if(27===e.keyCode&&(Q("KvmSearchInput").value=Q("SearchInput").value="",i=1),0<i)return 1==i&&masterUpdate(5),haltEvent(e)}if(4==Q("viewselect").value){if(8===e.keyCode&&0==mapSearchFocus){n=Q("mapSearchLocation").value;Q("mapSearchLocation").value=n.substring(0,n.length-1),i=1}27===e.keyCode&&(Q("mapSearchLocation").value="",mapCloseSearchWindow(),i=1)}}}function ondockeyup(e){if(setSessionActivity(),!xxdialogMode&&11==xxcurrentView&&desktop&&Q("DeskControl").checked){if(null!=currentNode){var t=GetNodeRights(currentNode);if(0==(4294967295==t||0!=(8&t)&&0==(256&t)))return!1;if(1==(4294967295!=t&&0!=(8&t)&&0==(256&t)&&0!=(4096&t))&&(1==e.altKey||1==e.ctrlKey||e.keyCode<32&&8!=e.keyCode&&13!=e.keyCode||90<e.keyCode))return!1}return desktop.m.handleKeyUp(e)}return!xxdialogMode&&12==xxcurrentView&&terminal&&3==terminal.State&&null==xterm?terminal.m.TermHandleKeyUp(e):xxdialogMode||13!=xxcurrentView||116!=e.keyCode||null==p13filetree?xxdialogMode||4!=xxcurrentView||(8!==e.keyCode||0!=searchFocus)&&27!==e.keyCode?(xxdialogMode&&27==e.keyCode&&dialogclose(0),xxdialogMode||0!=xxcurrentView||1==e.ctrlKey||1==e.altKey||1==e.metaKey?void 0:Q("viewselect").value<4&&(8===e.keyCode&&0==searchFocus||27===e.keyCode)?haltEvent(e):4==Q("viewselect").value&&(8===e.keyCode&&0==mapSearchFocus||27===e.keyCode)?haltEvent(e):void 0):haltEvent(e):(p13folderup(9999),haltEvent(e),!1)}function ondocblur(){if(!xxdialogMode&&11==xxcurrentView&&desktop&&Q("DeskControl").checked&&desktop.m.handleReleaseKeys)return desktop.m.handleReleaseKeys()}function devMouseHover(e,t){setSessionActivity();var n=Q("viewselect").value;if(1==n)(i=e.children[1].children[1]).children[0].classList.remove("g1s"),i.children[1].classList.remove("e2s"),i.children[2].classList.remove("g2s"),1==t&&(i.children[0].classList.add("g1s"),i.children[1].classList.add("e2s"),i.children[2].classList.add("g2s"));else if(2==n){var i;(i=e).children[2].classList.remove("g1s"),i.children[4].classList.remove("e2s"),i.children[3].classList.remove("g2s"),1==t&&(i.children[2].classList.add("g1s"),i.children[4].classList.add("e2s"),i.children[3].classList.add("g2s"))}}var deviceHeaderCount,deviceHeaderId=0,deviceHeaderTotal=0,deviceHeadersTitles={},deviceHeaders={},oldviewmode=0;function updateDevices(){if(null!=nodes&&1==xxcurrentView){var e="",t=0,n=null,i={},o=Q("viewselect").value,r={},a={};if(QV("xdevices",o<4),QV("xdevicesmap",4==o),QV("devListToolbar",o<3),QV("kvmListToolbar",3==o),QV("devMapToolbar",4==o),QV("devListToolbarSize",3==o),QV("NoMeshesPanel",0==nodes.length&&0==meshcount),QV("devListToolbarViewIcons",0<nodes.length),QV("devListToolbarSort",0<nodes.length&&o<4),0==nodes.length&&(o=1,sort=0),4==o)setTimeout(function(){null!=xxmap.map&&xxmap.map.updateSize()},200);else{deviceHeaderCount={},deviceHeaders={},deviceHeadersTitles={};var s=[];(deviceHeaderTotal=deviceHeaderId=0)==sort?nodes.sort(meshSort):1==sort?nodes.sort(powerSort):2==sort&&(1==showRealNames?nodes.sort(deviceHostSort):nodes.sort(deviceSort));for(var l=[],d=document.getElementsByClassName("DeviceCheckbox"),c=0;c<d.length;c++)d[c].checked&&l.push(d[c].value);oldviewmode<3&&3==o?multiDesktopFilter=l:3==oldviewmode&&o<3&&(l=multiDesktopFilter);var u=Q("column_l").clientWidth-60,p=Math.floor(u/301);for(var c in p=301+Math.floor((u-301*p)/p),nodes){if(0!=(K=nodes[c]).v){var m=meshes[K.meshid],g=GetNodeRights(K);if(0==sort){if((meshes[K.meshid]?K.meshid:"*")!=n){1!=o&&3!=o||null==n||(e+="</div>"),deviceHeaderSet();var h="";if(2==o&&(e+="<tr><td colspan=5>"),meshes[K.meshid]&&1==meshes[K.meshid].mtype&&(h="<span class=devHeaderx>, nur Intel&reg; AMT</span>"),1==o&&null!=n&&(2==t&&(e+="<td><div style=width:301px></div></td>"),""!=e&&(e+="</tr></table>")),2==o&&(e+="<div>"),e+="<div class=DevSt style=width:100%;padding-top:4px><span style=float:right>",e+="<span id=DevxHeader"+deviceHeaderId+" class=devHeaderx></span>"+h,e+="</span>",1==o||2==o||3==o){var v=CollapsedGroups[K.meshid];e+='<img class=collapseImage id="DevxColImg'+deviceHeaderId+'" src=images/c'+(!0===v?"1":"2")+'.png height=8 width=8 style=margin-left:2px;margin-right:2px;cursor:pointer onclick=toggleCollapseGroup("'+deviceHeaderId+'","'+K.meshid+'",'+o+")></img>"}n=meshes[K.meshid]?(e+='<span id=MxMESH cmenu=meshContextMenu tabindex=0 style=cursor:pointer onclick=gotoMesh("'+K.meshid+"\") onkeypress=\"if (event.key=='Enter') gotoMesh('"+K.meshid+"')\">"+EscapeHtml(meshes[K.meshid].name)+"</span>"+getMeshActions(m,g)+"</div>",K.meshid):(e+="<span id=MxMESH><i>Einzelne Geräte</i></span></div>","*"),2==o&&(e+="</div>"),t=0,(i[n]=1)!=o&&3!=o||(e+="<div id=DevxCol"+deviceHeaderId+(!0===v?" style=display:none":"")+">")}}else if(1==sort){var f=K.pwr?K.pwr:0;if(f!==n){if(1!=o&&3!=o||null==n||(e+="</div>"),deviceHeaderSet(),1==o&&null!==n&&(2==t&&(e+="<td><div style=width:301px></div></td>"),""!=e&&(e+="</tr></table>")),2==o&&(e+="<tr><td>"),e+="<div class=DevSt style=width:100%;padding-top:4px><span id=DevxHeader"+deviceHeaderId+" class=devHeaderx style=float:right></span>",1==o||2==o||3==o){v=CollapsedGroups["pwr:"+f];e+='<img class=collapseImage id="DevxColImg'+deviceHeaderId+'" src=images/c'+(!0===v?"1":"2")+'.png height=8 width=8 style=margin-left:2px;margin-right:2px;cursor:pointer onclick=toggleCollapseGroup("'+deviceHeaderId+'","pwr:'+f+'",'+o+")></img>"}e+="<span>"+PowerStateStr2(K.pwr)+"</span></div>",n=f,t=0,1!=o&&3!=o||(e+="<div id=DevxCol"+deviceHeaderId+(!0===v?" style=display:none":"")+">")}}else 2==sort&&null==n&&(n="1");0;var k=EscapeHtml(K.name);0==k.length&&(k="<i>Kein(e)</i>"),null!=K.rname&&0<K.rname.length&&(k+=" / "+EscapeHtml(K.rname));var b=EscapeHtml(K.name);1==showRealNames&&null!=K.rname&&(b=EscapeHtml(K.rname)),0==b.length&&(b="<i>Kein(e)</i>");var x="";if(null!=K.sessions&&(null==K.sessions.kvm&&null==K.sessions.terminal&&null==K.sessions.files||(x=2==o?"<img onclick=showDeviceSessions('"+K._id+"',null,event) class=deviceNotifySmallDot src=images/icon-relay-notify10.png width=10 height=10>":"<img onclick=showDeviceSessions('"+K._id+"',null,event) class=deviceNotifyDot src=images/icon-relay-notify.png width=16 height=16>"),null!=K.sessions.battery&&1==o)){var y=K.sessions.battery,w="";"ac"==y.state&&(w="Device is plugged-in"),"dc"==y.state&&(w="Device is battery powered");var S="",D=-1;"number"==typeof y.level&&0<=y.level&&y.level<=100&&(S=y.level+"%",5<(D=Math.floor((y.level+10)/25)+1)&&(lvl=5),"ac"==y.state&&(100==y.level?D=11:D+=5)),0<D&&(x+='<div class="deviceBatterySmall deviceBatterySmall'+D+'" title="'+(null!=w?w+", "+S:S)+'"></div>')}var C=K.icon;if(K.conn&&0!=K.conn||(C+=" gray"),1==o)e+="<div id=devs cmenu=devsContentMenu onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;position:relative;width:"+p+'px;height:50px;padding-top:1px;padding-bottom:1px><div style=width:22px;height:50%;float:left;padding-top:12px><input class="'+K.meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+K._id+" type=checkbox></div><div style=height:100%;cursor:pointer tabindex=0 onclick=gotoDevice('"+K._id+"',null,null,event) onkeypress=\"if (event.key=='Enter') gotoDevice('"+K._id+'\',null,null,event)"><div class="i'+C+'" style=width:50px;float:left></div><div style=height:100%><div class=g1></div><div class=e2><div class=e1 style=width:'+(p-100)+'px title="'+k+'">'+b+"</div><div>"+NodeStateStr(K)+"</div></div><div class=g2></div></div></div>"+x+"</div>";else if(2==o){var M=[];K.conn&&(0!=(1&K.conn)&&M.push('<span title="Mesh-Agent ist verbunden und bereit.">Agent</span>'),0!=(2&K.conn)?M.push('<span title="Intel&reg; AMT CIRA ist verbunden und einsatzbereit.">CIRA</span>'):0!=(4&K.conn)&&M.push('<span title="Intel&reg; AMT ist routebar.">AMT</span>'),0!=(8&K.conn)&&M.push('<span title="Mesh-Agent ist erreichbar mittels eines anderen Agenten als Vermittler.">Weiterleitung</span>'),0!=(16&K.conn)&&M.push('<span title="MQTT-Verbindung zum Gerät ist aktiv.">MQTT</span>'));var E=K.meshid;1==sort?E="pwr:"+(K.pwr?K.pwr:0):3==sort&&(E="tag:**xx**xx*TaG*xx**xx**"),e+="<tr name=DevxCol"+E+((v=3!=sort&CollapsedGroups[E])?" style=display:none":"")+"><td style=position:relative><div id=devs cmenu=devsContentMenu 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('"+K._id+"',null,null,event)\">",e+='<div class=deviceBarCheckbox><input class="'+K.meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+K._id+" type=checkbox></div>",e+="<div class=deviceBarIcon onclick=gotoDevice('"+K._id+"',null,null,event)><div class=\"j"+C+'" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>',e+="<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>",e+='<div class=style10 style=cursor:pointer;font-size:14px title="'+k+"\" onclick=gotoDevice('"+K._id+"',null,null,event)><span style=width:300px>"+b+"</span></div></div>"+x+"</td>",e+="<td style=text-align:center>"+getUserShortStr(K),e+="<td style=text-align:center>"+(null!=K.ip?K.ip:""),e+="<td style=text-align:center>"+M.join("&nbsp;+&nbsp;"),e+="</tr>"}else 3==o&&1&K.conn&&0!=(8&g||256&g)&&0!=(1&K.agent.caps)&&multiDesktopFilter&&(0==multiDesktopFilter.length||0<=multiDesktopFilter.indexOf("devid_"+K._id))&&(e+="<div id=devs cmenu=devsContentMenu style=display:inline-block;position:relative;margin:1px;background-color:lightgray;border-radius:5px;position:relative><div tabindex=0 style=padding:3px;cursor:pointer onclick=gotoDevice('"+K._id+"',11,null,event) onkeypress=\"if (event.key=='Enter') gotoDevice('"+K._id+"',11,null,event)\">"+x,e+='<div class="j'+C+'" style=width:16px;float:left></div>&nbsp;'+b+"</div>",e+="<span onclick=gotoDevice('"+K._id+"',null,null,event)></span><div id=xkvmid_"+K._id.split("/")[2]+"><div id=skvmid_"+K._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(\''+K._id+"') onkeypress=\"if (event.key=='Enter') toggleKvmDevice('"+K._id+"')\">Getrennt</div></div>",e+="</div>",s.push(K._id));if(3==sort&&""!=e){if(K.tags)for(var A in K.tags){var T=K.tags[A],N=(v=CollapsedGroups["tag:"+T],e.replace("**xx**xx*TaG*xx**xx**",encodeURIComponentEx(T)+(v?" style=display:none":"")));if(null==r[T]?(r[T]=N,a[T]=1):(r[T]+=N,a[T]+=1),3==o)break}e=""}deviceHeaderTotal++,void 0===deviceHeaderCount[K.state]?deviceHeaderCount[K.state]=1:deviceHeaderCount[K.state]++}}if(1==o&&null!=n&&(e+="</div>"),32<=s.length&&(Q("autoConnectDesktopCheckbox").checked=!1),QE("autoConnectDesktopCheckbox",s.length<32),3==sort){var U=[],_=0;for(var c in r)U.push(c);for(var A in U.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),U){c=U[A];if(2==o)e+="<tr><td colspan=4><div class=DevSt style=width:100%;padding-top:4px>",e+='<img class=collapseImage id="DevxColImg'+_+'" src=images/c'+(!0===(v=CollapsedGroups["tag:"+encodeURIComponentEx(c)])?"1":"2")+'.png height=8 width=8 style=margin-left:2px;margin-right:2px;cursor:pointer onclick=toggleCollapseGroup("'+_+'","tag:'+encodeURIComponentEx(c)+'",2)></img>',e+="<span class=devHeaderx style=float:right>"+a[c]+" node"+(1<a[c]?"s":"")+"</span><span>"+c+"</span></div>"+r[c];else e+="<div class=DevSt style=width:100%;padding-top:4px><span class=devHeaderx style=float:right>"+a[c]+" node"+(1<a[c]?"s":"")+"</span>",e+='<img class=collapseImage id="DevxColImg'+_+'" src=images/c'+(!0===(v=CollapsedGroups["tag:"+encodeURIComponentEx(c)])?"1":"2")+'.png height=8 width=8 style=margin-left:2px;margin-right:2px;cursor:pointer onclick=toggleCollapseGroup("'+_+'","tag:'+encodeURIComponentEx(c)+'")></img>',e+="<span>"+c+"</span></div>",e+="<div id=DevxCol"+_+(!0===v?" style=display:none":"")+">",e+=r[c],e+="</div>";_++}}var I=!1;if(""==e&&0<nodes.length&&""!=Q("SearchInput").value&&(I=!0,e=3==sort?'<div style="margin:30px">No devices are included in any groups, click on a device\'s "Groups" to add to a group.</div>':'<div style="margin:30px">Keine Geräte, die auf diese Suche passen.</div>'),1==o&&2==t&&(e+="<td><div style=width:301px></div></td>"),0==sort&&""==Q("SearchInput").value&&o<3){var V=deviceHeaderId,z=[];for(var c in meshes)z.push(meshes[c]);for(var c in z.sort(nameSort),z){var R=z[c];g=GetMeshRights(R);if(null==i[R._id])""!=n&&""!=e&&(e+="</tr></table>"),e+="<table style=width:100%;padding-top:4px cellpadding=0 cellspacing=0><tr><td colspan=3 class=DevSt>",e+='<img class=collapseImage id="DevxColImg'+ ++V+'" src=images/c'+(!0===(v=CollapsedGroups[R._id])?"1":"2")+'.png height=8 width=8 style=margin-left:2px;margin-right:2px;cursor:pointer onclick=toggleCollapseGroup("'+V+'","'+R._id+'")></img>',e+='<span id=MxMESH style=cursor:pointer onclick=gotoMesh("'+R._id+'")>'+EscapeHtml(R.name)+"</span><span>",e+=getMeshActions(R,g),e+="</span></td></tr><tr>",1==R.mtype?(e+="<td><div style=padding:10px><i>Keine Intel&reg;-AMT-Geräte in diesem Mesh",0!=(4&g)&&(e+=", <a href=# style=cursor:pointer onclick='return addDeviceToMesh(\""+R._id+"\")'>eines hinzufügen</a>")):2==R.mtype&&(e+="<td>",e+="<div id=DevxCol"+V+(!0===v?" style=display:none":"")+">",e+="<div style=padding:10px><i>Keine Geräte in dieser Gruppe",0!=(4&g)&&(e+=", <a href=# style=cursor:pointer onclick='return addAgentToMesh(\""+R._id+"\")'>eines hinzufügen</a>")),e+=".</i></div></td>",e+="</div>",n=R._id,0}}""!=e&&0==I?(e+="</table>",2==o&&(e="<table style=width:100%;margin-top:4px cellpadding=0 cellspacing=0><th style=color:gray><th style=color:gray;width:120px>Benutzer<th style=color:gray;width:120px>Adresse<th style=color:gray;width:100px>Konnektivität"+e+"</tr></table><div style=height:1px></div>")):(e+="</table>",3==sort&&(e='<div style="margin:10px"><i>Keine Geräte mit Tags gefunden.</i></div>')),e+="<div style=border-top-style:solid;border-top-width:1px;border-top-color:#DDDDDD;cursor:pointer;font-size:10px>",o<3&&0==sort&&0<nodes.length&&(4294967295==userinfo.siteadmin||0==(64&userinfo.siteadmin))&&(e+='<a href=# onclick="return account_createMesh()" title="Eine neue Gerätegruppe erstellen." style=cursor:pointer>Gerätegruppe hinzufügen</a>&nbsp'),4294967295!=userinfo.siteadmin&&0!=(128&userinfo.siteadmin)||(e+="<a href=# onclick='return p10showMeshCmdDialog(0)' style=cursor:pointer title=\"MeshCmd herunterladen, ein Befehlszeilenprogramm, das viele Aufgaben ausführt.\">MeshCmd</a>&nbsp","win32"==navigator.platform.toLowerCase()&&(e+="<a href=# onclick='return p10showMeshRouterDialog()' style=cursor:pointer title=\"MeshCentral Router herunterladen, ein TCP-Port-Mapping-Tool.\">Router</a>&nbsp")),e+="</div><br/>",QH("xdevices",e),deviceHeaderSet();d=document.getElementsByClassName("DeviceCheckbox");if(l)for(c=0;c<d.length;c++)d[c].checked=0<=l.indexOf(d[c].value);for(var c in deviceHeaders)QH(c,deviceHeaders[c]);for(var c in deviceHeadersTitles)Q(c).title=deviceHeadersTitles[c];if(p1updateInfo(),3==o&&1==xxcurrentView){var B=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex],H=B.x+2,F=u-5,G=Math.floor(F/H);for(var c in G=H+Math.floor((F-G*H)/G),B.y=B.y*(G/B.x),B.x=G,multiDesktop)multiDesktop[c].xxdelete=!0;for(var c in s){var P=s[c],L=P.split("/")[2],O=multiDesktop[P];if(null!=O)O.m.CanvasId.setAttribute("style","background-color:black;width:"+B.x+"px;height:"+B.y+"px"),Q("xkvmid_"+L).appendChild(O.m.CanvasId),delete O.xxdelete,QH("skvmid_"+L,["Getrennt","Verbinden...","Aufbau...","",""][null==O.m.State?O.m.state:O.m.State]);else{var K=getNodeFromId(P);if(desktopNode==K&&null!=desktop){(t=desktop.m.CanvasId).setAttribute("id","kvmid_"+L),t.setAttribute("style","background-color:black;width:"+B.x+"px;height:"+B.y+"px"),t.setAttribute("onclick","toggleKvmDevice('"+P+"')"),t.removeAttribute("onmousedown"),t.removeAttribute("onmouseup"),t.removeAttribute("onmousemove"),Q("xkvmid_"+L).appendChild(t),QH("skvmid_"+L,["Getrennt","Verbinden...","Aufbau...","",""][null==desktop.m.State?desktop.m.state:desktop.m.State]),desktop.m.SendCompressionLevel&&desktop.m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate),desktop.shortid=L,desktop.onStateChanged=onMultiDesktopStateChange,multiDesktop[P]=desktop,desktop=desktopNode=currentNode=null,QH("DeskParent",'<canvas id="Desk" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>')}else{(t=document.createElement("canvas")).setAttribute("id","kvmid_"+L),t.setAttribute("width",640),t.setAttribute("height",480),t.setAttribute("oncontextmenu","return false"),t.setAttribute("style","background-color:black;width:"+B.x+"px;height:"+B.y+"px"),t.setAttribute("onclick","toggleKvmDevice('"+P+"')");try{Q("xkvmid_"+L).appendChild(t)}catch(e){}1==Q("autoConnectDesktopCheckbox").checked&&setTimeout(function(){connectMultiDesktop(K,1)},100)}}}for(var c in multiDesktop)1==multiDesktop[c].xxdelete?(multiDesktop[c].Stop(),delete multiDesktop[c]):debugmode&&multiDesktop[c].m&&multiDesktop[c].m.onScreenSizeChange&&mdeskAdjust(multiDesktop[c].m,multiDesktop[c].m.ScreenWidth,multiDesktop[c].m.ScreenHeight,multiDesktop[c].m.CanvasId);deskAdjust()}else disconnectAllKvmFunction(),Q("autoConnectDesktopCheckbox").checked=!1}oldviewmode=o}}function showDeviceSessions(e,t,n){if(n&&haltEvent(n),xxdialogMode&&!t)return!1;var i=null,o="";if(null==(i=null==e?currentNode:getNodeFromId(e))||null==i.sessions)return setDialogMode(0),!1;for(var r in i.sessions)if("kvm"==r&&null==i.sessions.multidesk)for(var a in o+="<u>Remote Desktop</u>",i.sessions.kvm)o+=addHtmlValue4(getUserName(a),1==i.sessions.kvm[a]?"1 Sitzung":nobreak(format("{0} Sitzungen",i.sessions.kvm[a])));else if("multidesk"==r)for(var a in o+="<u>Remote Desktop</u>",i.sessions.multidesk)o+=addHtmlValue4(getUserName(a),1==i.sessions.multidesk[a]?"1 Sitzung":nobreak(format("{0} Sitzungen",i.sessions.multidesk[a])));else if("terminal"==r)for(var a in o+="<u>Terminal</u>",i.sessions.terminal)o+=addHtmlValue4(getUserName(a),1==i.sessions.terminal[a]?"1 Sitzung":nobreak(format("{0} Sitzungen",i.sessions.terminal[a])));else if("files"==r)for(var a in o+="<u>Dateien</u>",i.sessions.files)o+=addHtmlValue4(getUserName(a),1==i.sessions.files[a]?"1 Sitzung":nobreak(format("{0} Sitzungen",i.sessions.files[a])));return""!=o&&setDialogMode(2,"Sessions - "+EscapeHtml(i.name),1,null,o,"SESSIONS-"+i._id),!1}function toggleCollapseGroup(e,t,n){var i;if(2==n){var o=document.getElementsByName("DevxCol"+t);if(0==o.length)return;(i="none"==o[0].style.display)?delete CollapsedGroups[t]:CollapsedGroups[t]=!0;for(var r=0;r<o.length;r++)o[r].style.display=i?"":"none"}else(i="none"==QS("DevxCol"+e).display)?delete CollapsedGroups[t]:CollapsedGroups[t]=!0,QV("DevxCol"+e,i);Q("DevxColImg"+e).src=i?"images/c2.png":"images/c1.png",putstore("_collapse",JSON.stringify(CollapsedGroups))}function toggleKvmDevice(e){"string"==typeof e&&(e=getNodeFromId(e));var t=GetNodeRights(e);(8&t||256&t)&&1&e.conn&&connectMultiDesktop(e,1)}function getUserShortStr(e){if(null==e||null==e.users||0==e.users.length)return"";if(1<e.users.length)return'<span title="'+EscapeHtml(e.users.join(", "))+'">'+nobreak(format("{0} Benutzer",e.users.length))+"</span>";var t=e.users[0],n=t,i=t.indexOf("\\");return 0<i&&(n=t.substring(i+1)),15<(n=EscapeHtml(n)).length&&(n=n.substring(0,14)+"&#8230;"),'<span title="'+EscapeHtml(t)+'">'+n+"</span>"}function autoConnectDesktops(){1==Q("autoConnectDesktopCheckbox").checked&&connectAllKvmFunction()}function connectAllKvmFunction(e){if(xxdialogMode)return!1;if(!0!==e){var t=0;for(var n in nodes){var i=nodes[n],o=nodes[n]._id;if(null==multiDesktop[o]&&(0==multiDesktopFilter.length||0<=multiDesktopFilter.indexOf("devid_"+o))){var r=GetNodeRights(i);(8&r||256&r)&&1&i.conn&&1==i.v&&t++}}if(8<t)return void setDialogMode(2,"Alle verbinden",3,function(){connectAllKvmFunction(!0)},format("Möchten Sie wirklich eine Verbindung zu {0} Geräten herstellen?",t))}for(var n in nodes)1==nodes[n].v&&null==multiDesktop[nodes[n]._id]&&(0==multiDesktopFilter.length||0<=multiDesktopFilter.indexOf("devid_"+nodes[n]._id))&&toggleKvmDevice(nodes[n]._id)}function disconnectAllKvmFunction(){if(xxdialogMode)return!1;for(var e in multiDesktop)multiDesktop[e].Stop();multiDesktop={}}function onMultiDesktopStateChange(e,t){try{QH("skvmid_"+e.shortid,["Getrennt","Verbinden...","Aufbau...","",""][t])}catch(e){}}function onDeviceSearchChanged(e){"SearchInput"==e.target.id?Q("KvmSearchInput").value=Q("SearchInput").value:Q("SearchInput").value=Q("KvmSearchInput").value,masterUpdate(5)}function showMultiDesktopSettings(){QV("d7amtkvm",!1),QV("d7meshkvm",!0),d7bitmapquality.value=multidesktopsettings.quality,d7bitmapscaling.value=multidesktopsettings.scaling,multidesktopsettings.framerate?d7framelimiter.value=multidesktopsettings.framerate:d7framelimiter.value=100,setDialogMode(7,"Einstellungen des entfernten Desktops",3,showMultiDesktopSettingsChanged)}function showMultiDesktopSettingsChanged(){for(var e in multidesktopsettings.quality=d7bitmapquality.value,multidesktopsettings.scaling=d7bitmapscaling.value,multidesktopsettings.framerate=d7framelimiter.value,localStorage.setItem("multidesktopsettings",JSON.stringify(multidesktopsettings)),multiDesktop)multiDesktop[e].m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate)}function connectMultiDesktop(e,t){var n=e._id,i=n.split("/")[2],o=multiDesktop[n];if(null==o){if(null==Q("kvmid_"+i))return;if(2==t){if(null==e.intelamt.user||""==e.intelamt.user)return;(o=CreateAmtRedirect(CreateAmtRemoteDesktop("kvmid_"+i),authCookie)).shortid=i,o.onStateChanged=onMultiDesktopStateChange,o.m.bpp=1,o.m.useZRLE=!0,o.m.showmouse=!0,o.m.onKvmData=function(e){console.log("KVM Data received in multi-desktop mode, this is not supported.")},0<debugmode&&(o.m.onScreenSizeChange=mdeskAdjust),o.Start(n,16994,"*","*",0),o.contype=2,multiDesktop[n]=o}else 1==t&&((o=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("kvmid_"+i),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).m.mouseCursorActive(11==xxcurrentView),o.shortid=i,o.attemptWebRTC=attemptWebRTC,o.onStateChanged=onMultiDesktopStateChange,o.m.CompressionLevel=multidesktopsettings.quality,o.m.ScalingLevel=multidesktopsettings.scaling,multidesktopsettings.framerate&&(o.m.FrameRateTimer=multidesktopsettings.framerate),0<debugmode&&(o.m.onScreenSizeChange=mdeskAdjust),o.Start(n),o.contype=1,multiDesktop[n]=o)}else o.Stop(),delete multiDesktop[n]}function getMeshActions(e,t){if(0==(4&t))return"";var n="";return 0==(1024&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Füge einen neuen Intel&reg;-AMT-Rechner hinzu, der sich im Internet befindet." onclick=\'return addCiraDeviceToMesh("'+e._id+"\")'>CIRA hinzufügen</a>"),1==e.mtype&&(0==(1&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Füge einen neuen Intel&reg;-AMT-Rechner hinzu, der sich im lokalen Netzwerk befindet." onclick=\'return addDeviceToMesh("'+e._id+"\")'>Lokales Gerät hinzufügen</a>",n+=' <a href=# style=cursor:pointer;font-size:10px title="Füge einen neuen Intel&reg;-AMT-Rechner durch Scannen des lokalen Netzwerks hinzu." onclick=\'return addAmtScanToMesh("'+e._id+"\")'>Netzwerk durchsuchen</a>"),e.amt&&2==e.amt.type?n+=' <a href=# style=cursor:pointer;font-size:10px title="Aktivierung von Intel AMT im Client Control Mode (CCM) durchführen." onclick=\'return showCcmActivation("'+e._id+"\")'>Aktivierung</a>":e.amt&&3==e.amt.type&&0!=(1048576&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Aktivierung von Intel AMT im Admin Control Mode (ACM) durchführen." onclick=\'return showAcmActivation("'+e._id+"\")'>Aktivierung</a>")),2==e.mtype&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Füge einen neuen Computer durch Installation des Mesh-Agenten zu dieser Gerätegruppe hinzu." onclick=\'return addAgentToMesh("'+e._id+"\")'>Agenten hinzufügen</a>",0==(2&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Laden Sie jemanden ein, den Mesh-Agenten für diese Gerätegruppe zu installieren." onclick=\'return inviteAgentToMesh("'+e._id+"\")'>Einladen</a>")),n}function addDeviceToMesh(e){if(xxdialogMode)return!1;var t=meshes[e],n=format('Füge ein neues Intel&reg;-AMT-Gerät zur Gerätegruppe "{0}" hinzu.',EscapeHtml(t.name))+"<br /><br />";return n+=addHtmlValue("Gerätename","<input id=dp1devicename style=width:230px maxlength=32 autocomplete=off onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />"),n+=addHtmlValue("Hostname",'<input id=dp1hostname style=width:230px maxlength=32 autocomplete=off placeholder="Gleich dem Gerätenamen" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />'),n+=addHtmlValue("Benutzername",'<input id=dp1username style=width:230px maxlength=32 autocomplete=off placeholder="Admin" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />'),n+=addHtmlValue("Passwort","<input id=dp1password type=password style=width:230px autocomplete=off maxlength=32 onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />"),setDialogMode(2,"Intel&reg;-AMT-Gerät hinzufügen",3,addDeviceToMeshEx,n+=addHtmlValue("Sicherheit","<select id=dp1tls style=width:236px><option value=0>Keine TLS-Sicherheit</option><option value=1>TLS-Sicherheit vorausgesetzt</option></select>"),e),validateDeviceToMesh(),Q("dp1devicename").focus(),!1}function showCcmActivation(e){if(xxdialogMode)return!1;var t=serverinfo.name,n=meshes[e];-1!=t.indexOf(".")&&0==(2&features)||(t=window.location.hostname);var i;domainUrl.substring(0,domainUrl.length-1);1==serverinfo.https?i="wss://"+t+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl:i="ws://"+t+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl;var o=format('Aktivierung von Intel AMT im Client Control Mode (CCM) in Gruppe "{0}" durchführen durch Herunterladen des MeshCMD-Werkzeugs und Ausführen wie folgt:',EscapeHtml(n.name))+"<br /><br />";return setDialogMode(2,"Intel&reg; AMT Aktivierung",9,null,o+="<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtccm --url "+i+"amtactivate?id="+e.split("/")[2]+" --serverhttpshash "+serverinfo.tlshash+"</textarea>"),Q("idx_dlgOkButton").focus(),!1}function showAcmActivation(e){if(xxdialogMode)return!1;var t=serverinfo.name,n=meshes[e];-1!=t.indexOf(".")&&0==(2&features)||(t=window.location.hostname);var i;domainUrl.substring(0,domainUrl.length-1);1==serverinfo.https?i="wss://"+t+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl:i="ws://"+t+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl;var o=format('Aktivierung von Intel AMT im Admin Control Mode (ACM) in Gruppe "{0}" durchführen durch Herunterladen des MeshCMD-Werkzeugs und Ausführen wie folgt:',EscapeHtml(n.name))+"<br /><br />";return o+="<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtacm --url "+i+"amtactivate?id="+e.split("/")[2]+" --serverhttpshash "+serverinfo.tlshash+"</textarea>",null!=serverinfo.amtAcmFqdn&&(o+="<div style=margin-top:8px>Intel AMT benötigt einen gesetzten Trusted FQDN im MEBx oder eine drahtgebundene Verbindung zum LAN: <b>"+serverinfo.amtAcmFqdn.join(", ")+"</b></div>"),setDialogMode(2,"Intel&reg; AMT Aktivierung",9,null,o),Q("idx_dlgOkButton").focus(),!1}function addAmtScanToMesh(e){if(xxdialogMode)return!1;var t="Geben Sie einen Bereich von IP-Adressen ein, um nach Intel-AMT-Geräten zu suchen.<br /><br />";return t+=addHtmlValue("IP-Bereich",'<input id=dp1range style=width:184px value="192.168.1.0/24" onkeyup=addAmtScanToMeshKeyUp(event) /><input id=dp1rangebutton type=button value="Scannen" onclick=addAmtScanToMeshButton()></input>'),setDialogMode(2,"Nach Intel&reg;-AMT-Geräten suchen",3,addAmtScanToMeshEx,t+='<div id=dp1results style="width:100%;height:200px;background-color:white;border:1px gray solid;overflow-y:scroll"></div>',e),QE("idx_dlgOkButton",!1),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>"),focusTextBox("dp1range"),!1}function addAmtScanToMeshKeyUp(e){13==e.keyCode&&(haltEvent(e),addAmtScanToMeshButton())}function addAmtScanToMeshEx(e,t){for(var n=document.getElementsByClassName("DevScanCheckbox"),i=0;i<n.length;i++)if(n[i].checked){var o=n[i].getAttribute("tag"),r=amtScanResults[o],a=r.hostname;"host"==r.hosttype&&(a=capitalizeFirstLetter(a.split(".")[0])),meshserver.send({action:"addamtdevice",meshid:t,devicename:a,hostname:r.hostname,amtusername:"",amtpassword:"",amttls:r.tls})}}function addAmtScanToMeshButton(){QE("dp1range",!1),QE("dp1rangebutton",!1),QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px>Scanne...</div>"),meshserver.send({action:"scanamtdevice",range:Q("dp1range").value})}function addAmtScanToMeshCheckbox(){for(var e=document.getElementsByClassName("DevScanCheckbox"),t=0,n=0;n<e.length;n++)e[n].checked&&t++;QE("idx_dlgOkButton",0<t)}function addCiraDeviceToMesh(e){if(xxdialogMode)return!1;var t=meshes[e],n=e.split("/")[2].replace(/\@/g,"X").replace(/\$/g,"X"),i="<select id=dlgAddCiraSel onclick=dlgAddCiraSelClick() style=width:230px><option value=0>MeshCommander-Script</option><option value=1>Manueller Benutzername/Passwort</option>";0==(16&features)&&(i+="<option value=2>Manuelles Zertifikat</option></select>");var o="";return o+=addHtmlValue("Einrichtungsmethode",i),o+="<hr>",o+="<div id=dlgAddCira0>"+format("Um ein neues Intel&reg;-AMT-Gerät zur Gerätegruppe \"{0}\" mit CIRA hinzuzufügen, laden Sie die folgenden Script-Dateien herunter und verwenden Sie <a href='http://meshcommander.com' rel='noreferrer noopener' target='_blank'>MeshCommander</a>, um das Script auf den zu konfigurierenden Rechnern auszuführen.",EscapeHtml(t.name))+"<br /><br />",o+=addHtmlValue("CIRA einrichten",'<a href="mescript.ashx?type=1'+(urlargs.key?"&key="+urlargs.key:"")+"&meshid="+e+'" download>cira_setup.mescript</a>'),o+=addHtmlValue("CIRA bereinigen",'<a href="mescript.ashx?type=2'+(urlargs.key?"&key="+urlargs.key:"")+'" download>cira_clean.mescript</a>'),o+="</div>",o+="<div id=dlgAddCira1 style=display:none>"+format('Um ein neues Intel&reg;-AMT-Gerät zur Gerätegruppe "{0}" mit CIRA hinzuzufügen, laden Sie das folgende Zertifikat als bekanntes Stammzertifikat in Intel AMT',EscapeHtml(t.name)),serverinfo.mpspass?o+=" und gegenüber dem Server authentifizieren mittels dieses Benutzernamens und Passworts.<br /><br />":o+=" und gegenüber dem Server authentifizieren mittels dieses Benutzernamens und eines beliebigen Passworts.<br /><br />",o+=addHtmlValue("Stammzertifikat",'<a href="MeshServerRootCert.cer'+(urlargs.key?"?key="+urlargs.key:"")+'" download>Stammzertifikatsdatei</a>'),o+=addHtmlValue("Benutzername",'<input style=width:230px readonly value="'+n.substring(0,16)+'" />'),serverinfo.mpspass&&(o+=addHtmlValue("Passwort",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpspass)+'" />')),null!=serverinfo&&(o+=addHtmlValue("MPS-Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')),o+="</div>",0==(16&features)&&(o+="<div id=dlgAddCira2 style=display:none>"+format('Um ein neues Intel&reg;-AMT-Gerät zur Gerätegruppe "{0}" mit CIRA hinzuzufügen, laden Sie das folgende Zertifikat als bekanntes Stammzertifikat in Intel AMT, authentifizieren Sie sich mittels eines Clientzertifikats mit dem folgenden Common Name und verbinden Sie sich zu folgendem Server.',EscapeHtml(t.name))+"<br /><br />",o+=addHtmlValue("Stammzertifikat",'<a href="MeshServerRootCert.cer'+(urlargs.key?"?key="+urlargs.key:"")+'" download>Stammzertifikatsdatei</a>'),o+=addHtmlValue("Unternehmen",'<input style=width:230px readonly value="'+n+'" />'),null!=serverinfo&&(o+=addHtmlValue("MPS-Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')),o+="</div>"),setDialogMode(2,"Intel&reg;-AMT-CIRA-Gerät hinzufügen",2,null,o,"fileDownload"),Q("dlgAddCiraSel").focus(),!1}function dlgAddCiraSelClick(){var e=Q("dlgAddCiraSel").value;QV("dlgAddCira0",0==e),QV("dlgAddCira1",1==e),QV("dlgAddCira2",2==e)}function checkEmail(e){var t=e.split("@"),n=2==t.length&&0<t[0].length&&1<t[1].split(".").length&&2<t[1].length;if(1==n){var i=t[1].split(".");for(var o in i)0==i[o].length&&(n=!1)}return n}function inviteAgentToMesh(e){if(xxdialogMode)return!1;var t="",n=meshes[e];return 64&features&&(t+=addHtmlValue("Einladungstyp","<select id=d2InviteType onchange=d2ChangedInviteType() style=width:236px><option value=0>Link-Einladung</option><option value=1>E-Mail-Einladung</option></select>")+"<hr />",t+="<div id=emailInviteDiv style=display:none>"+format('Laden Sie jemanden ein, den Mesh-Agenten zu installieren. Eine E-Mail einem Link zur Mesh-Agenten-Installation für die Gerätegruppe "{0}" wird verschickt.',EscapeHtml(n.name))+"<br /><br />",t+=addHtmlValue("Name (optional)",'<input id=agentInviteName value="" style=width:230px maxlength=64 />'),t+=addHtmlValue("E-Mail",'<input id=agentInviteEmail style=width:230px placeholder="example@email.com" onkeyup=validateAgentInvite()></input>'),t+=addHtmlValue("Betriebssystem","<select id=agentInviteNameOs onchange=d2ChangedInviteType() style=width:236px><option value=4>Sende Installations-Link</option><option value=0 selected>Alle unterstützten</option><option value=1>nur Windows</option><option value=3>Nur Apple MacOS</option><option value=2>nur Linux</option></select>"),t+="<div id=d2agentexpirediv>",t+=addHtmlValue("Link-Ablauf","<select id=agentInviteExpire style=width:236px><option value=1>1 Stunde</option><option value=8>8 Stunden</option><option value=24>1 Tag</option><option value=168>1 Woche</option><option value=5040>1 Monat</option><option value=0>Unbegrenzt</option></select>"),t+="</div>",t+=addHtmlValue("Installationstyp","<select id=agentInviteType style=width:236px><option value=0>Hintergrund und interaktiv</option><option value=2>Nur Hintergrund</option><option value=1>Nur interaktiv</option></select>"),t+=addHtmlValue("Nachricht<br />(optional)",'<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>'),t+="</div>"),t+="<div id=urlInviteDiv>"+format('Laden Sie jemanden ein, den Mesh-Agenten zu installieren, indem Sie einen Einladungslink freigeben. Dieser Link verweist den Benutzer auf Installationsanweisungen für die Gerätegruppe "{0}". Der Link ist öffentlich und es wird kein Konto für diesen Server benötigt.',EscapeHtml(n.name))+"<br /><br />",t+=addHtmlValue("Link-Ablauf","<select id=d2inviteExpire style=width:236px onchange=d2RequestInvitationLink()><option value=1>1 Stunde</option><option value=8>8 Stunden</option><option value=24>1 Tag</option><option value=168>1 Woche</option><option value=5040>1 Monat</option><option value=0>Unbegrenzt</option></select>"),setDialogMode(2,"Einladen",3,performAgentInvite,t+='<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="Link in Zwischenablage kopieren" style=cursor:pointer onclick=d2CopyInviteToClip()></div></div>',e),64&features?(Q("d2InviteType").focus(),d2ChangedInviteType()):(Q("d2inviteExpire").focus(),validateAgentInvite()),d2RequestInvitationLink(),!1}function d2RequestInvitationLink(){meshserver.send({action:"createInviteLink",meshid:xxdialogTag,expire:parseInt(Q("d2inviteExpire").value),flags:0})}function d2ChangedInviteType(){QV("urlInviteDiv",0==Q("d2InviteType").value),QV("d2agentexpirediv",4==Q("agentInviteNameOs").value),QV("emailInviteDiv",1==Q("d2InviteType").value),validateAgentInvite()}function d2CopyInviteToClip(){copyTextToClip(Q("agentInvitationLink").href)}function validateAgentInvite(){64&features&&1==Q("d2InviteType").value?(QE("idx_dlgOkButton",checkEmail(Q("agentInviteEmail").value)),QV("idx_dlgCancelButton",!0)):(QE("idx_dlgOkButton",!0),QV("idx_dlgCancelButton",!1))}function performAgentInvite(e,t){64&features&&1==Q("d2InviteType").value&&meshserver.send({action:"inviteAgent",meshid:t,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)})}function addAgentToMesh(e){if(xxdialogMode)return!1;var t=meshes[e],n="";n+=addHtmlValue("Betriebssystem","<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 (Deinstallation)</option><option value=4>Linux / BSD (Deinstallation)</option></select>"),n+="<div id=aginsTypeDiv>",n+=addHtmlValue("Installationstyp","<select id=aginsType onchange=addAgentToMeshClick() style=width:236px><option value=0>Hintergrund & interaktiv</option><option value=2>Nur Hintergrund</option><option value=1>Nur interaktiv</option></select>"),n+="</div><hr>";var i=t.name;i=i.split("\\").join("").split("/").join("").split(":").join("").split("*").join("").split("?").join("").split('"').join("").split("<").join("").split(">").join("").split("|").join("").split(" ").join("").split("'").join(""),n+="<div id=agins_windows>"+format('Um einen neuen Rechner zur Gerätegruppe "{0}" hinzuzufügen, laden Sie den Mesh-Agenten herunter und installieren Sie ihn auf dem zu verwaltenden Rechner. In diesen Agenten sind Server- und Gerätegruppen-Informationen bereits eingebettet.',EscapeHtml(t.name))+"<br /><br />",n+=addHtmlValue("Mesh-Agent",'<a id=aginsw32lnk href="meshagents?id=3&meshid='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="32bit-Version des MeshAgents">Windows (.exe)</a> <img src=images/link4.png height=10 width=10 title="Kopieren Sie die Windows 32-Bit-Agenten-URL in die Zwischenablage" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=3&meshid='+e.split("/")[2]+'&installflags=",1)>'),n+=addHtmlValue("Mesh-Agent",'<a id=aginsw64lnk href="meshagents?id=4&meshid='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="64bit-Version des MeshAgents">Windows x64 (.exe)</a> <img src=images/link4.png height=10 width=10 title="Kopieren Sie die Windows 64-Bit-Agenten-URL in die Zwischenablage" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=4&meshid='+e.split("/")[2]+'&installflags=",1)>'),0<debugmode&&(n+=addHtmlValue("Einstellungsdatei",'<a id=aginswmshlnk href="meshsettings?id='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download rel="noreferrer noopener" target="_blank">'+format("{0} Einstellungen (.msh)",EscapeHtml(t.name))+"</a>")),n+="</div>",n+="<div id=agins_linux style=display:none>"+format("Um einen Rechner zu {0} hinzuzufügen, führe den folgenden Befehl aus. Root-Zugriff wird benötigt.",EscapeHtml(t.name))+"<br />",n+="<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>",n+="<div style='font-size:x-small'>* Unter BSD, führe zunächst \"pkg install wget sudo bash\" aus.</div></div>",n+="<div id=agins_osx style=display:none>"+format('Um einen neuen Rechner zur Gerätegruppe "{0}" hinzuzufügen, laden Sie den Mesh-Agenten herunter und installieren Sie ihn auf dem zu verwaltenden Rechner. In dieses Agenten-Installationsprogramm sind Server- und Gerätegruppen-Informationen bereits eingebettet.',EscapeHtml(t.name))+"<br /><br />",n+=addHtmlValue("Mesh-Agent",'<a href="meshosxagent?id=16&meshid='+e.split("/")[2]+(urlargs.key?"&key="+urlargs.key:"")+'" download rel="noreferrer noopener" target="_blank" title="64-Bit-Version des MacOS Mesh-Agenten">MacOS Agent (64bit)</a> <img src=images/link4.png height=10 width=10 title="MacOS-Agenten-URL in Zwischenablage kopieren" style=cursor:pointer onclick=copyAgentUrl("meshosxagent?id=16&meshid='+e.split("/")[2]+'",0)>'),n+="</div>",n+='<div id=agins_windows_un style=display:none>Um den Mesh-Agenten zu entfernen, laden Sie die untenstehende Datei herunter, führen Sie sie aus und klicken Sie auf "Deinstallieren".<br /><br />',n+=addHtmlValue("Mesh-Agent",'<a href="meshagents?id=3'+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="32bit-Version des MeshAgents">Windows (.exe)</a>'),n+=addHtmlValue("Mesh-Agent",'<a href="meshagents?id=4'+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="64bit-Version des MeshAgents">Windows x64 (.exe)</a>'),n+="</div>",n+="<div id=agins_linux_un style=display:none>Um einen Mesh-Agenten zu entfernen, führen Sie den folgenden Befehl aus. Root-Zugriff wird benötigt.<br />",n+="<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>",setDialogMode(2,"Mesh-Agenten hinzufügen",2,null,n+="</div>","fileDownload");var o=serverinfo.name;-1!=o.indexOf(".")&&0==(2&features)||(o=window.location.hostname);var r=domainUrl.substring(0,domainUrl.length-1);if(1==serverinfo.https){var a=443==serverinfo.port?"":":"+serverinfo.port;0==(8192&features)?(Q("agins_linux_area").value='(wget "https://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-check-certificate -O ./meshinstall.sh || wget "https://'+o+a+domainUrl+'meshagents?script=1" --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://'+o+a+r+" '"+e.split("/")[2]+"' || ./meshinstall.sh https://"+o+a+r+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='(wget "https://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-check-certificate -O ./meshinstall.sh || wget "https://'+o+a+domainUrl+'meshagents?script=1" --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n'):(Q("agins_linux_area").value='wget "https://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://'+o+a+r+" '"+e.split("/")[2]+"' || ./meshinstall.sh https://"+o+a+r+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='wget "https://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-proxy --no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n')}else{a=80==serverinfo.port?"":":"+serverinfo.port;0==(8192&features)?(Q("agins_linux_area").value='(wget "http://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" -O ./meshinstall.sh || wget "http://'+o+a+domainUrl+'meshagents?script=1" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh http://'+o+a+r+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='(wget "http://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" -O ./meshinstall.sh || wget "http://'+o+a+domainUrl+'meshagents?script=1" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n'):(Q("agins_linux_area").value='wget "http://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://'+o+a+r+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='wget "http://'+o+a+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n')}return Q("aginsSelect").focus(),addAgentToMeshClick(),!1}function copyAgentUrl(e,t){var n=serverinfo.name;-1!=n.indexOf(".")&&0==(2&features)||(n=window.location.hostname);domainUrl.substring(0,domainUrl.length-1);var i="https://"+n+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+e;1==t&&(i+=Q("aginsType").value),copyTextToClip(i+=urlargs.key?"&key="+urlargs.key:"")}function addAgentToMeshClick(){var e=Q("aginsSelect").value;QV("agins_windows",0==e),QV("agins_linux",1==e),QV("agins_osx",2==e),QV("agins_windows_un",3==e),QV("agins_linux_un",4==e),QV("aginsTypeDiv",0==e),Q("aginsw32lnk").href=Q("aginsw32lnk").href.split("installflags=")[0]+"installflags="+Q("aginsType").value+(urlargs.key?"&key="+urlargs.key:""),Q("aginsw64lnk").href=Q("aginsw64lnk").href.split("installflags=")[0]+"installflags="+Q("aginsType").value+(urlargs.key?"&key="+urlargs.key:""),0<debugmode&&(Q("aginswmshlnk").href=Q("aginswmshlnk").href.split("installflags=")[0]+"installflags="+Q("aginsType").value+(urlargs.key?"&key="+urlargs.key:""))}function validateDeviceToMesh(){QE("idx_dlgOkButton",0<Q("dp1devicename").value.length&&passwordcheck(Q("dp1password").value))}function addDeviceToMeshEx(e,t){var n=Q("dp1username").value;""==n&&(n="admin");var i=Q("dp1hostname").value;""==i&&(i=Q("dp1devicename").value),meshserver.send({action:"addamtdevice",meshid:t,devicename:Q("dp1devicename").value,hostname:i,amtusername:n,amtpassword:Q("dp1password").value,amttls:Q("dp1tls").value})}function deviceHeaderSet(){0!=deviceHeaderId?(deviceHeaders["DevxHeader"+deviceHeaderId]=1==deviceHeaderTotal?"1 Knoten":format("{0} Knoten",deviceHeaderTotal),deviceHeaderId++,deviceHeaderCount={},deviceHeaderTotal=0):deviceHeaderId=1}var powerStateStrings=["",'<span title="Gerät ist eingeschaltet.">eingeschaltet</span>','<span title="Gerät befindet sich im Schlafzustand (S1).">Schlafend</span>','<span title="Gerät befindet sich im Schlafzustand (S2).">Schlafend</span>','<span title="Gerät befindet sich im Tiefschlafzustand (S3).">Tiefschlaf</span>','<span title="Gerät befindet sich im Ruhezustand (S4).">Ruhezustand</span>','<span title="Gerät ist ausgeschaltet (S5).">Soft-Off</span>','<span title="Gerät wurde erkannt, aber der Energiezustand konnte nicht ermittelt werden.">präsent</span>'],powerStateStrings2=["","Gerät ist eingeschaltet","Gerät befindet sich im Schlafzustand (S1)","Gerät befindet sich im Schlafzustand (S2)","Gerät befindet sich im Tiefschlafzustand (S3)","Gerät ist im Ruhezustand (S4)","Gerät ist im Soft-Off-Zustand (S5)","Gerät ist präsent, aber der Energiezustand kann nicht ermittelt werden"],powerColorTable=["pwsTransparent","pwsBlack","pwsBlue","pwsBlue2","pwsLightblue","pwsBlueviolet","pwsDarkgreen","pwsLightseagreen","pwsLightseagreen2"];function NodeStateStr(e){var t=[];return 0<e.state&&e.state<powerStatetable.length&&state.push(powerStatetable[e.state]),e.conn&&(0!=(1&e.conn)&&t.push('<span title="Mesh-Agent ist verbunden und bereit.">Agent</span>'),0!=(2&e.conn)?t.push('<span title="Intel&reg; AMT CIRA ist verbunden und einsatzbereit.">CIRA</span>'):0!=(4&e.conn)&&t.push('<span title="Intel&reg; AMT ist routebar.">AMT</span>'),0!=(8&e.conn)&&t.push('<span title="Mesh-Agent ist erreichbar mittels eines anderen Agenten als Vermittler.">Weiterleitung</span>'),0!=(16&e.conn)&&t.push('<span title="MQTT-Verbindung zum Gerät ist aktiv.">MQTT</span>')),null!=e.pwr&&0!=e.pwr&&t.push(powerStateStrings[e.pwr]),t.join(", ")}function PowerStateStr(e){return e<powerStatetable.length?powerStatetable[e]:""}function PowerStateStr2(e){return 0!=e&&e<powerStatetable.length?powerStatetable[e]:"Unbekannt"}function selectallButtonFunction(){for(var e=document.getElementsByClassName("DeviceCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;for(n=0;n<e.length;n++)e[n].checked=0==t;p1updateInfo()}function p1updateInfo(){for(var e=document.getElementsByClassName("DeviceCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;if(0<t?(QE("GroupActionButton",!0),Q("SelectAllButton").value="Auswahl aufheben",QV("cxmgroupsplit",!0),QV("cxmdesktop",!0)):(QE("GroupActionButton",!1),Q("SelectAllButton").value="Alle auswählen",QV("cxmgroupsplit",!1),QV("cxmdesktop",!1)),null!=customui&&customui.devicesbarbuttons)for(var n in customui.devicesbarbuttons)"one"==customui.devicesbarbuttons[n].selection&&QE("cui:"+n,1==t),"many"==customui.devicesbarbuttons[n].selection&&QE("cui:"+n,1<=t)}function groupActionFunction(){var e="",t=getCheckedDevices();if(4194304&features)for(var n in t)if(0!=(16&getNodeFromId(t[n]).conn)){e+="<option value=103>Sende MQTT-Nachricht</option>";break}for(var n in t){var i=getNodeFromId(t[n]),o=GetNodeRights(i);if(0!=(1&i.conn)&&0!=(32768&o)){e+="<option value=104>Agenten deinstallieren</option>";break}}var r="Wählen Sie eine Operation für die Durchführung auf allen ausgewählten Geräten. Aktionen werden nur bei entsprechenden Rechten durchgeführt.<br /><br />";setDialogMode(2,"Gruppenaktion",3,groupActionFunctionEx,r+=addHtmlValue("Vorgang","<select id=d2groupop><option value=100>Geräte aufwecken</option><option value=4>Geräte schlafenlegen</option><option value=3>Geräte zurücksetzen</option><option value=2>Geräte ausschalten</option><option value=105>Geräteinformationen exportieren</option><option value=102>In Gerätegruppe verschieben</option>"+e+"<option value=101>Geräte löschen</option></select>"))}function getCheckedDevices(){for(var e=[],t=document.getElementsByClassName("DeviceCheckbox"),n=0;n<t.length;n++)if(t[n].checked&&t[n].value){var i=t[n].value.substring(6);-1==e.indexOf(i)&&e.push(i)}return e}function uncheckAllDevices(){for(var e=document.getElementsByClassName("DeviceCheckbox"),t=0;t<e.length;t++)e[t].checked=!1}function groupActionFunctionEx(){var e=Q("d2groupop").value;if(100==e)meshserver.send({action:"wakedevices",nodeids:getCheckedDevices()}),uncheckAllDevices();else if(101==e){"<label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelCheck() />Bestätigen</label>",setDialogMode(2,"Knoten löschen",3,d2groupActionFunctionDelExec,"Bestätigen Sie das Löschen der gewählten Geräte?<br /><br /><label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelCheck() />Bestätigen</label>"),QE("idx_dlgOkButton",!1)}else 102==e?p10showChangeGroupDialog(getCheckedDevices()):103==e?p10showSendMqttMsgDialog(getCheckedDevices()):104==e?p10showSendUninstallAgentDialog(getCheckedDevices()):105==e?p2downloadDeviceInfo():(meshserver.send({action:"poweraction",nodeids:getCheckedDevices(),actiontype:parseInt(e)}),uncheckAllDevices())}function p2downloadDeviceInfo(){if(!xxdialogMode){var e="Laden Sie die Liste der Geräte mit einem der folgenden Dateiformate herunter.<br /><br />";e+=addHtmlValue("CSV-Format","<a href=# style=cursor:pointer onclick='return p2downloadDeviceInfoCSV()'>devicelist.csv</a>"),setDialogMode(2,"Geräteinformationsexport",1,null,e+=addHtmlValue("JSON-Format","<a href=# style=cursor:pointer onclick='return p2downloadDeviceInfoJSON()'>devicelist.json</a>"))}}function p2downloadDeviceInfoCSV(){var e="id, name, rname, host, icon, ip, osdesc, state, gruppenname, conn, pwr\r\n",t=getCheckedDevices();for(var n in t){var i=getNodeFromId(t[n]);e+='"'+i._id.split(",").join("")+'","'+i.name.split(",").join("")+'","'+(i.rname?i.rname.split(",").join(""):"")+'","'+(i.host?i.host.split(",").join(""):"")+'","'+i.icon+'","'+(i.ip?i.ip:"")+'","'+(i.osdesc?i.osdesc.split(",").join(""):"")+'","'+i.state+'","'+meshes[i.meshid].name.split(",").join("")+'","'+(i.conn?i.conn:"")+'","'+(i.pwr?i.pwr:"")+'"\r\n'}return saveAs(new Blob([e],{type:"application/octet-stream"}),"devicelist.csv"),uncheckAllDevices(),!1}function p2downloadDeviceInfoJSON(){var e=getCheckedDevices(),t=[];for(var n in e)t.push(getNodeFromId(e[n]));return saveAs(new Blob([JSON.stringify(t,null,2)],{type:"application/octet-stream"}),"devicelist.json"),uncheckAllDevices(),!1}function d2groupActionFunctionDelCheck(){QE("idx_dlgOkButton",Q("d2check").checked)}function d2groupActionFunctionDelExec(){meshserver.send({action:"removedevices",nodeids:getCheckedDevices()}),uncheckAllDevices()}function onSortSelectChange(e){sort=document.getElementById("sortselect").selectedIndex,e||putstore("sort",sort)}function nameSort(e,t){var n=e.name.toLowerCase(),i=t.name.toLowerCase();return i<n?1:n<i?-1:0}function meshSort(e,t){return e.meshnamel>t.meshnamel?1:e.meshnamel<t.meshnamel?-1:e.meshid==t.meshid?1==showRealNames?e.rnamel>t.rnamel?1:e.rnamel<t.rnamel?-1:0:e.namel>t.namel?1:e.namel<t.namel?-1:0:0}function powerSort(e,t){var n=e.pwr?e.pwr:0,i=t.pwr?t.pwr:0;return i<n?-1:n<i?1:n==i?1==showRealNames?e.rnamel>t.rnamel?1:e.rnamel<t.rnamel?-1:0:e.namel>t.namel?1:e.namel<t.namel?-1:0:0}function deviceSort(e,t){return e.namel>t.namel?1:e.namel<t.namel?-1:0}function deviceHostSort(e,t){return e.rnamel>t.rnamel?1:e.rnamel<t.rnamel?-1:0}function onSearchFocus(e){searchFocus=e}function onMapSearchFocus(e){mapSearchFocus=e}function onUserSearchFocus(e){userSearchFocus=e}function onConsoleFocus(e){consoleFocus=e}function onSearchInputChanged(){var e=Q("SearchInput").value.toLowerCase().trim();putstore("_search",Q("SearchInput").value);var t=null,n=null,i=null,o=null;if(e.startsWith("Benutzer:".toLowerCase())?t=e.substring("Benutzer:".length):e.startsWith("u:".toLowerCase())?t=e.substring("u:".length):e.startsWith("ip:".toLowerCase())?n=e.substring("ip:".length):e.startsWith("gruppe:".toLowerCase())?i=e.substring("gruppe:".length):e.startsWith("g:".toLowerCase())?i=e.substring("g:".length):e.startsWith("Etikett:".toLowerCase())?o=Q("SearchInput").value.trim().substring("Etikett:".length):e.startsWith("t:".toLowerCase())&&(o=Q("SearchInput").value.trim().substring("t:".length)),""==e)for(var r in nodes)nodes[r].v=!0;else if(null!=n)for(var r in nodes)nodes[r].v=null!=nodes[r].ip&&0<=nodes[r].ip.indexOf(n);else if(null!=i)for(var r in nodes)nodes[r].v=0<=meshes[nodes[r].meshid].name.toLowerCase().indexOf(i);else if(null!=o)for(var r in nodes)nodes[r].v=null==nodes[r].tags&&""==o||null!=nodes[r].tags&&0<=nodes[r].tags.indexOf(o);else if(null!=t){for(var r in nodes)if(nodes[r].v=!1,nodes[r].users&&0<nodes[r].users.length)for(var a in nodes[r].users)0<=nodes[r].users[a].toLowerCase().indexOf(t)&&(nodes[r].v=!0)}else try{var s=e.split(/\s+/).join("|"),l=new RegExp(s);for(var r in nodes)if(nodes[r].v=l.test(nodes[r].name.toLowerCase())||null!=nodes[r].rnamel&&l.test(nodes[r].rnamel.toLowerCase()),0==nodes[r].v&&nodes[r].tags)for(var d in nodes[r].tags){if(l.test(nodes[r].tags[d].toLowerCase())){nodes[r].v=!0;break}nodes[r].v=!1}}catch(e){for(var r in nodes)nodes[r].v=!0}if(Q("OnlineCheckBox").checked)for(var r in nodes)null!=nodes[r].conn&&0!=nodes[r].conn||(nodes[r].v=!1)}var contextelement=null;function handleContextMenu(e){if(hideContextMenu(),!xxdialogMode){for(var t=null!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=null!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop,i=document.elementFromPoint(e.pageX-t,e.pageY-n);i&&null!=i&&null==i.attributes.cmenu;)i=i.parentElement;if(null==i)return!0;var o=i.attributes.cmenu.value;switch(o){case"termConnectButton":if(null==currentNode||null==currentNode.agent)return!0;contextelement=i;var r=document.getElementById("termShellContextMenu");4<currentNode.agent.id&&(r=document.getElementById("termShellContextMenuLinux")),showContextMenuDiv(r,e.pageX,e.pageY);break;case"deskConnectButton":if(null==currentNode||null==currentNode.agent)return!0;contextelement=i,showContextMenuDiv(document.getElementById("deskConnectContextMenu"),e.pageX,e.pageY);break;case"devsContentMenu":contextelement=i,showContextMenuDiv(r=document.getElementById("contextMenu"),e.pageX,e.pageY);var a=contextelement.children[1].attributes.onclick.value,s=getNodeFromId(a.substring(12,a.length-18)),l=meshes[s.meshid],d=GetNodeRights(s),c=0!=(16&d),u=4294967295==d||0==(65536&d),p=4294967295==d||0==(512&d),m=4294967295==d||0==(1024&d);QV("cxdesktop",(1==l.mtype||null==s.agent||null==s.agent.caps||0!=(1&s.agent.caps)||s.intelamt&&2==s.intelamt.state)&&(8&d||256&d)&&u),QV("cxterminal",(1==l.mtype||null==s.agent||null==s.agent.caps||0!=(2&s.agent.caps)||s.intelamt&&2==s.intelamt.state)&&8&d&&p),QV("cxfiles",2==l.mtype&&(null==s.agent||null==s.agent.caps||0!=(4&s.agent.caps))&&8&d&&m),QV("cxevents",null!=s.intelamt&&(2==s.intelamt.state||2&s.conn)&&8&d),QV("cxconsole",c&&2==l.mtype&&(null==s.agent||null==s.agent.caps||0!=(8&s.agent.caps))&&8&d);break;default:if(null==(r=document.getElementById(o)))return!0;contextelement=i,showContextMenuDiv(r,e.pageX,e.pageY)}return haltEvent(e)}}function showContextMenuDiv(e,t,n){var i=document.documentElement.getBoundingClientRect(),o=i.height,r=i.width;e.style.left=e.style.right=e.style.top=e.style.bottom=null,r/2<t?e.style.right=r-event.pageX+"px":e.style.left=event.pageX+"px",o/2<n?e.style.bottom=o-event.pageY+"px":e.style.top=event.pageY+"px",e.style.display="block"}function cmaction(e,t){var n=contextelement.children[1].attributes.onclick.value;if(n=n.substring(12,n.length-18),9==e&&(Q("viewselect").value=3,Q("viewselect").onchange(),Q("autoConnectDesktopCheckbox").checked=!0,Q("autoConnectDesktopCheckbox").onclick()),0<e&&e<9){var i=[0,10,12,11,13,16,17,15,19][e];if(t&&1==t.shiftKey)window.open(window.location.origin+"?node="+n.split("/")[2]+"&viewmode="+i+"&hide=16","meshcentral:"+n);else{gotoDevice(n,i);var o=meshes[currentNode.meshid];1&currentNode.conn&&2==o.mtype&&(11==i&&null==desktop&&1&currentNode.agent.caps&&connectDesktop(null,3),12==i&&null==terminal&&2&currentNode.agent.caps&&connectTerminal(null,1),13==i&&null==files&&connectFiles(null))}}}function cmmeshaction(e){var t=contextelement.attributes.onclick.value.substring(10,contextelement.attributes.onclick.value.length-2),n=document.getElementsByClassName("DeviceCheckbox");if(1==e||2==e)for(var i=0;i<n.length;i++)n[i].attributes&&n[i].attributes.class.value.split(" ")[0]==t&&(n[i].checked=1==e);p1updateInfo()}function cmtermaction(e){e<100?connectTerminal(null,1,{protocol:e}):100==e&&connectTerminal(null,1,{protocol:1,requireLogin:!0})}function cmdeskaction(e){1==e&&connectDesktop(null,3,null,72),2==e&&connectDesktop(null,3,null,8),3==e&&connectDesktop(null,3,null,64)}function cmaltportaction(e){if(!xxdialogMode){setDialogMode(2,"RDP-Verbindung",3,function(){setDialogMode(0);var e=0<Q("d10rdpport").value.length?parseInt(Q("d10rdpport").value):3389;meshserver.send({action:"changedevice",nodeid:currentNode._id,rdpport:e}),null!=currentNode&&p10clickOnce(currentNode._id,"RDP2",e)},'RDP-Remoteverbindungsport:<br /><br /><input type=text placeholder="3389" inputmode="numeric" pattern="[0-9]*" onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" maxlength=5 id=d10rdpport type=text>',currentNode),Q("d10rdpport").focus(),null!=currentNode.rdpport&&(Q("d10rdpport").value=currentNode.rdpport)}}function cmrfbportaction(e){if(!xxdialogMode){setDialogMode(2,"noVNC Connection",3,function(){setDialogMode(0);var e=0<Q("d10rfbport").value.length?parseInt(Q("d10rfbport").value):3389;meshserver.send({action:"changedevice",nodeid:currentNode._id,rfbport:e}),null!=currentNode&&p10rfb(currentNode._id,e)},'noVNC remote connection port:<br /><br /><input type=text placeholder="5900" inputmode="numeric" pattern="[0-9]*" onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" maxlength=5 id=d10rfbport type=text>',currentNode),Q("d10rfbport").focus(),null!=currentNode.rfbport&&(Q("d10rfbport").value=currentNode.rfbport)}}function cmfilesaction(e){if(!xxdialogMode){var t=p13sort_files(p13filetree.dir)[parseInt(contextelement.attributes.fileindex.nodeValue)];1==e?(setDialogMode(2,"Umbenennen",3,p13renamefileEx,'<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% value="'+t.n+'" />',{action:"rename",path:p13filetreelocation.join("/"),oldname:t.n}),focusTextBox("p13renameinput"),p13fileNameCheck()):2==e?t.s<=204800?p13downloadfile(encodeURIComponentEx(p13filetreelocation.join("/")+"/"+t.n),encodeURIComponentEx(t.n),t.s,"viewer"):messagebox("Datei-Editor","Nur Dateien kleiner als 200 kB können bearbeitet werden."):3==e&&setDialogMode(2,"Löschen",3,p13deletefileCm,"Element löschen?",t)}}function cmdeskplayeraction(e){xxdialogMode||window.open(window.location.origin+"{{{domainurl}}}player.htm","meshcentral-deskplayer")}function p13deletefileCm(e,t){files.sendText({action:"rm",reqid:1,path:p13filetreelocation.join("/"),delfiles:[t.n],rec:!1}),p13folderup(999)}function hideContextMenu(){QV("contextMenu",!1),QV("meshContextMenu",!1),QV("termShellContextMenu",!1),QV("termShellContextMenuLinux",!1),QV("deskConnectContextMenu",!1),QV("altPortContextMenu",!1),QV("rfbPortContextMenu",!1),QV("filesContextMenu",!1),QV("deskPlayerContextMenu",!1),contextelement=null}var map_cm_popup,map_cm_editMarker,map_cm_clearMarker,map_cm_saveMarker,map_cm_nodemenu_items,contextmenu_items,currentNode,xxmap={map:null,contextmenu:null,activeInteractions:[],showindex:0,markersSource:null,markersLayer:null,mapLayer:null,mapView:null};function updateMapMarkers(e){if(0!=(32768&features)){if(null!=xxmap&&null==xxmap.map)try{loadmap()}catch(e){console.error("loadmap() exception",e)}if(null!=xxmap){var t=null;for(var n in nodes)try{var i=map_parseNodeLoc(nodes[n]),o=xxmap.markersSource.getFeatureById(nodes[n]._id);if(null==i||nodes[n].meshid!=e&&null!=e)o&&xxmap.markersSource.removeFeature(o);else{var r=i[0],a=i[1];i[2];null==t?t=[r,a,r,a,0]:(r<t[0]&&(t[0]=r),a<t[1]&&(t[1]=a),r>t[2]&&(t[2]=r),a>t[3]&&(t[3]=a)),null==o?(addFeature(nodes[n]),t[4]=1):(updateFeature(nodes[n],o),o.setStyle(markerStyle(nodes[n],i[2])))}}catch(e){console.error("updateMapMarkers() exception",e,JSON.stringify(nodes[n]))}return t}}}function stringToIntHash(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}function map_parseNodeLoc(e){var t=null,n=0;return e.iploc&&(t=e.iploc,n=1),e.wifiloc&&(t=e.wifiloc,n=2),e.gpsloc&&(t=e.gpsloc,n=3),e.userloc&&(t=e.userloc,n=4),null==t||"string"!=typeof t?null:(t=t.split(","),1==n?[parseFloat(t[0])+stringToIntHash(e._id.substring(0,20))/1e11,parseFloat(t[1])+stringToIntHash(e._id.substring(20))/1e11,n]:[parseFloat(t[0]),parseFloat(t[1]),n])}function loadmap(){if(0!=(32768&features)&&null!=xxmap)if(0!=(32768&features)){QV("viewselectmapoption",!0),QV("devViewButton4",!0);try{xxmap.markersSource=new ol.source.Vector,xxmap.markersLayer=new ol.layer.Vector({source:xxmap.markersSource}),xxmap.mapLayer=new ol.layer.Tile({source:new ol.source.OSM}),xxmap.mapView=new ol.View({center:ol.proj.transform([0,0],"EPSG:4326","EPSG:3857"),zoom:2,minZoom:2,maxZoom:20,extent:ol.proj.transformExtent([-1e5,-69.55,1e5,69.55],"EPSG:4326","EPSG:3857")}),xxmap.map=new ol.Map({target:"xdevicesmap",layers:[xxmap.mapLayer,xxmap.markersLayer],view:xxmap.mapView}),xxmap.map.addOverlay(map_cm_popup),xxmap.map.on("click",function(e){var t=xxmap.map.forEachFeatureAtPixel(e.pixel,function(e,t){return e});if(t){var n=t.getId();if(null!=n)gotoDevice(n,10);else gotoDevice(getCorrespondingFeature(t).getId(),10)}}),xxmap.map.on("pointermove",function(e){var t=xxmap.map.forEachFeatureAtPixel(e.pixel,function(e,t){return e});if(t){xxmap.map.getTargetElement().style.cursor="pointer";var n=t.getGeometry().getCoordinates();if(map_cm_popup.setPosition(n),t.getId())QH("xmap-info-window",t.get("name"));else{var i=getCorrespondingFeature(t);QH("xmap-info-window",i.get("name"))}}else xxmap.map.getTargetElement().style.cursor="",QH("xmap-info-window","")});var e=new ContextMenu({width:160,defaultItems:!1,items:contextmenu_items});e.on("open",function(e){var t=xxmap.map.forEachFeatureAtPixel(e.pixel,function(e,t){return e});if(xxmap.contextmenu.clear(),t)if(t.getId())addContextMenuItems(t);else{var n=getCorrespondingFeature(t);n?addContextMenuItems(n):xxmap.contextmenu.extend(contextmenu_items)}else xxmap.contextmenu.extend(contextmenu_items)}),null==xxmap.contextmenu&&(xxmap.contextmenu=e),xxmap.map.addControl(xxmap.contextmenu)}catch(e){console.log(e),QV("viewselectmapoption",!1),QV("devViewButton4",!1),xxmap=null}}else xxmap=null}function addFeature(e,t,n){var i=getModifiedFeature(e._id);if(i)xxmap.markersSource.addFeature(i);else{if(!t&&!n){var o=map_parseNodeLoc(e);t=o[0],n=o[1]}if(180<n&&(n=180-n,meshserver.send({action:"changedevice",nodeid:e._id,userloc:[t,n]})),t<90&&-90<t&&n<180&&-180<n){var r=new ol.Feature({geometry:new ol.geom.Point(ol.proj.transform([n,t],"EPSG:4326","EPSG:3857")),name:e.name,status:e.conn,lat:t,lon:n});r.setId(e._id),r.setStyle(markerStyle(e)),xxmap.markersSource.addFeature(r)}}}function removeFeature(e){var t=xxmap.markersSource.getFeatureById(e._id);t&&xxmap.markersSource.removeFeature(t)}function updateFeature(e,t){e.conn!=t.get("status")&&(t.set("status",e.conn),t.setStyle(markerStyle(e)));var n=map_parseNodeLoc(e);if(null!=n){var i=n[0],o=n[1];if(i!=t.get("lat")||o!=t.get("lon")){t.set("lat",i),t.set("lon",o);var r=ol.proj.transform([parseFloat(o),parseFloat(i)],"EPSG:4326","EPSG:3857");t.getGeometry().setCoordinates(r)}}e.name!=t.get("name")&&t.set("name",e.name)}function modifyMarkerloc(e){var t=e.getId();if(t&&(e.setStyle(markerStyle(getNodeFromId(e.a),4)),!getActiveInteractions(e))){var n=new ol.interaction.Modify({features:new ol.Collection([e]),pixelTolerance:10});xxmap.activeInteractions.push({featureid:t,feature:e,interaction:n}),xxmap.map.addInteraction(n)}}function saveMarkerloc(e){var t=e.getId();if(t){var n=getActiveInteractions(e);if(n){xxmap.map.removeInteraction(n),removeInteraction(t);var i=e.getGeometry().getCoordinates(),o=ol.proj.transform(i,"EPSG:3857","EPSG:4326");180<o[0]&&(o[0]=180-o[0]);var r=[o[1],o[0]];meshserver.send({action:"changedevice",nodeid:t,userloc:r})}}}function markerStyle(e,t){null==t&&(t=0,e.iploc&&(t=1),e.wifiloc&&(t=2),e.gpsloc&&(t=3),e.userloc&&(t=4));var n=connStateColor(e);return[new ol.style.Style({image:new ol.style.Icon({color:n,anchor:[.5,1],src:"images/mapmarker"+["","-ip","-wifi","-gps","-user"][t]+".png"})})]}function connStateColor(e){return 1==e.conn||3==e.conn||5==e.conn?"#00ffdd":"#C70039"}function addContextMenuItems(t){getActiveInteractions(t)?(map_cm_saveMarker.data=t,xxmap.contextmenu.push(map_cm_saveMarker)):(map_cm_editMarker.data=t,xxmap.contextmenu.push(map_cm_editMarker),getNodeFromId(t.a).userloc&&(map_cm_clearMarker.data=t,xxmap.contextmenu.push(map_cm_clearMarker)));map_cm_nodemenu_items.forEach(function(e){"Bis auf Fläche hineinzoomen"==e.text||"Bis auf Fläche herauszoomen"==e.text?e.data=t:"-"!=e&&(e.data=t.getId())}),xxmap.contextmenu.extend(map_cm_nodemenu_items)}function getActiveInteractions(e){for(var t=e.getId(),n=0;n<xxmap.activeInteractions.length;n++)if(xxmap.activeInteractions[n].featureid==t)return xxmap.activeInteractions[n].interaction;return!1}function getModifiedFeature(e){if(e)for(var t=0;t<xxmap.activeInteractions.length;t++)if(xxmap.activeInteractions[t].featureid==e)return xxmap.activeInteractions[t].feature;return null}function removeInteraction(e){for(var t=-1,n=0;n<xxmap.activeInteractions.length;n++)if(xxmap.activeInteractions[n].featureid===e){t=n;break}0<=t&&xxmap.activeInteractions.splice(t,1)}function getCorrespondingFeature(e){for(var t=e.getGeometry().getCoordinates(),n=0;n<xxmap.activeInteractions.length;n++){var i=xxmap.activeInteractions[n].feature,o=i.getGeometry().getCoordinates();if(o[0].toFixed(5)==t[0].toFixed(5)&&o[1].toFixed(5)==t[1].toFixed(5))return i}return null}function refreshMap(e,t){e&&(xxmap.map.setTarget(null),xxmap.map=null,xxmap.markersSource=null,xxmap.mapView=null,xxmap.mapLayer=null,xxmap.activeInteractions=[]);var n=updateMapMarkers();if(null!=n&&(t||1==n[4])){var i=(n[0]+n[2])/2,o=(n[1]+n[3])/2,r=Math.max(Math.abs(n[0]-n[2]),Math.abs(n[1]-n[3])),a=xxmap.map.getView();a.setCenter(ol.proj.transform([o,i],"EPSG:4326","EPSG:3857"));for(var s=360,l=-2;r<s;)l++,s/=2;a.setZoom(l)}}function placeNode(e){if(!xxdialogMode){var t='<div style=margin-bottom:6px><label for=selectnode-search>Suche</label>&nbsp&nbsp<input type=text placeholder="Gerätename" 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>Keine Geräte gefunden.</div>';for(var n in nodes)t+="<div class=noselect id="+nodes[n]._id+"-rowid onclick=selectNodeToPlace(event,'"+nodes[n]._id+"') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id="+nodes[n]._id+"-checkid type=checkbox style=width:16px;display:inline />",t+="<div class=j"+nodes[n].icon+" style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>"+nodes[n].name+"</div></div>";setDialogMode(2,"Wähle einen Knoten zum Ablegen",3,placeNodeEx,t+"</div>",e),onPlaceNodeInputChange()}}function placeNodeEx(e,t){var n=document.getElementsByName("PlaceMapDeviceCheckbox");for(var i in n)if(n[i].checked){var o=getNodeFromId(n[i].id.substring(0,n[i].id.length-8));if(o){var r=xxmap.markersSource.getFeatureById(i),a=ol.proj.transform(t,"EPSG:3857","EPSG:4326"),s=[a[1],a[0]];if(r)r.getGeometry().setCoordinates(t),getActiveInteractions(r)?saveMarkerloc(r):meshserver.send({action:"changedevice",nodeid:o._id,userloc:s});else meshserver.send({action:"changedevice",nodeid:o._id,userloc:s})}}}function onPlaceNodeInputChange(){updatePlaceNodeTable(Q("selectnode-search").value.trim().toLowerCase())}function updatePlaceNodeTable(e){document.getElementsByName("PlaceMapDeviceCheckbox");var t=0;for(var n in nodes){var i=0<=nodes[n].namel.indexOf(e)||""==e||null!=nodes[n].rnamel&&0<=nodes[n].rnamel.indexOf(e);i&&t++,QV(nodes[n]._id+"-rowid",i)}QV("noNodesMapPlace",0==t)}function selectNodeToPlace(e,t){if("PlaceMapDeviceCheckbox"!=e.target.name){var n=Q(t+"-checkid");n.checked=!n.checked}var i=document.getElementsByName("PlaceMapDeviceCheckbox"),o=0;for(var r in i)i[r].checked&&o++;QE("idx_dlgOkButton",0<o)}function addMeshOptions(e,t){}function meshOptionRmvMod(e,t){}function meshExists(){for(var e in meshes)if(meshes[e])return!0;return!1}function setMeshView(e){var t=Q("select-mesh");t[t.selectedIndex].value==e&&(t[0].selected=!0,onSelectMeshChange())}function clearMeshOptions(){}function getSearchLocation(){try{var e=Q("mapSearchLocation").value.trim();if(0<e.length){var t=new XMLHttpRequest;t.onreadystatechange=function(){4==t.readyState&&200==t.status&&formatSearchData(t.responseText)},t.open("GET","https://nominatim.openstreetmap.org/search?q="+e+"&format=json",!0),t.send()}}catch(e){}}function formatSearchData(e){try{QH("xmapSearchResults","");for(var t=JSON.parse(e),n=0,i='<div class="xmapItem">',o=0;o<t.length;o++)if(t[o].display_name&&t[o].boundingbox[0]&&t[o].boundingbox[1]&&t[o].boundingbox[2]&&t[o].boundingbox[3]){n++;i+='<div class="xmapItemSel1" onclick=mapGotoSelectedLocation(this)><div>'+t[o].display_name+"</div><div style=display:none>"+t[o].boundingbox[0]+"!#!"+t[o].boundingbox[1]+"!#!"+t[o].boundingbox[2]+"!#!"+t[o].boundingbox[3]+"</div></div>"}if(i+="</div>",1==n)zoomToExtent([parseFloat(t[0].boundingbox[2]),parseFloat(t[0].boundingbox[0]),parseFloat(t[0].boundingbox[3]),parseFloat(t[0].boundingbox[1])]);else 0==n&&(i="<div style=width:200px>Kein Standort gefunden.<div>"),QV("xmapSearchResultsDlg",!0);QH("xmapSearchResults",i)}catch(e){}}function mapGotoSelectedLocation(e){var t=e.children[1].innerHTML.split("!#!");zoomToExtent([parseFloat(t[2]),parseFloat(t[0]),parseFloat(t[3]),parseFloat(t[1])]),mapCloseSearchWindow()}function mapCloseSearchWindow(){QH("xmapSearchResults",""),QV("xmapSearchResultsDlg",!1)}function zoomToLocation(e,t){var n=xxmap.map.getView();n.setCenter(e),n.setZoom(t)}function zoomToFitExtent(){if(0<xxmap.markersSource.getFeatures().length){var e=xxmap.markersSource.getExtent();xxmap.map.getView().fit(e,xxmap.map.getSize())}}function zoomToExtent(e){var t=ol.proj.transformExtent(e,ol.proj.get("EPSG:4326"),ol.proj.get("EPSG:3857"));xxmap.map.getView().fit(t,xxmap.map.getSize())}function refreshDevice(e){currentNode&&currentNode._id==e&&gotoDevice(e,xxcurrentView,!0)}32768&features&&(map_cm_popup=new ol.Overlay({element:Q("xmap-info-window"),positioning:"bottom-center",stopEvent:!1}),map_cm_editMarker={text:"Knotenstandort ändern",callback:function(e){modifyMarkerloc(e.data)}},map_cm_clearMarker={text:"Gerätestandort entfernen",callback:function(e){meshserver.send({action:"changedevice",nodeid:e.data.a,userloc:[]})}},map_cm_saveMarker={text:"Knoten-Standort speichern",callback:function(e){saveMarkerloc(e.data)}},map_cm_nodemenu_items=[{text:"Allgemeine Information",callback:function(e){null!=e.data&&gotoDevice(e.data,10)}},{text:"Desktop",callback:function(e){null!=e.data&&gotoDevice(e.data,11)}},{text:"Terminal",callback:function(e){null!=e.data&&gotoDevice(e.data,12)}},{text:"Intel&reg; AMT",callback:function(e){null!=e.data&&gotoDevice(e.data,14)}},"-",{text:"Bis auf Fläche hineinzoomen",callback:function(e){zoomToLocation(e.data.getGeometry().getCoordinates(),19)}},{text:"Bis auf Fläche herauszoomen",callback:function(e){zoomToLocation(e.data.getGeometry().getCoordinates(),2)}}],contextmenu_items=[{text:"Aktualisieren",callback:function(){refreshMap(!0,!0)}},{text:"Zoomen um Fläche zu entsprechen",callback:function(){zoomToFitExtent()}},{text:"Karte hier zentrieren",callback:function(e){xxmap.mapView.animate({center:e.coordinate})}},{text:"Knoten hier ablegen",callback:function(e){placeNode(e.coordinate)}}]);var powerTimelineNode=null,powerTimelineReq=null,powerTimelineUpdate=null,powerTimeline=null;function getCurrentNode(){return currentNode}function gotoDevice(e,t,n,i){if(!0===userinfo.emailVerified||1!=serverinfo.emailcheck||4294967295==userinfo.siteadmin)if(262144&features&&0==count2factoraAuths())setDialogMode(2,"Konto-Sicherheit",1,null,'Auf Geräte kann nicht zugegriffen werden, bis Zweifaktor-Authentifizierung eingeschaltet wurde. Dies wird als Sicherheitsmaßnahme vorausgesetzt. Gehen Sie auf den "Mein Konto"-Tab und sehen Sie sich die "Kontosicherheit"-Sektion an.');else if(i&&1==i.shiftKey)window.open(window.location.origin+"?node="+e.split("/")[2]+"&viewmode=10&hide=16","meshcentral:"+e);else{var o=getNodeFromId(e);if(null!=o){var r=meshes[o.meshid],a=GetNodeRights(o),s=null==currentNode||currentNode._id!=e;if(!currentNode||currentNode._id!=o._id||1==n){if(currentNode=o,QV("p10deviceNotify",null!=currentNode.sessions&&(null!=currentNode.sessions.kvm||null!=currentNode.sessions.terminal||null!=currentNode.sessions.files)),QV("p10deviceBattery",!1),null!=currentNode.sessions&&null!=currentNode.sessions.battery){var l=currentNode.sessions.battery,d="";"ac"==l.state&&(d="Device is plugged-in"),"dc"==l.state&&(d="Device is battery powered");var c="",u=-1;"number"==typeof l.level&&0<=l.level&&l.level<=100&&(c=l.level+"%",5<(u=Math.floor((l.level+10)/25)+1)&&(lvl=5),"ac"==l.state&&(100==l.level?u=11:u+=5)),0<u&&(Q("p10deviceBattery").title=null!=d?d+", "+c:c,QV("p10deviceBattery",!0),Q("p10deviceBattery").className="deviceBatteryLarge deviceBatteryLarge"+u)}else QV("p10deviceBattery",!1);var p,m=EscapeHtml(o.name);0==m.length&&(m="<i>Kein(e)</i>"),0==(4&a)||r.flags&&0!=(2&r.flags)||(m='<span tabindex=0 title="Hier klicken, um den serverseitigen Gerätenamen zu bearbeiten" onclick=showEditNodeValueDialog(0) onkeyup="if (event.key == \'Enter\') showEditNodeValueDialog(0)" style=cursor:pointer>'+m+' <img class=hoverButton src="images/link5.png" /></span>'),p=m,r&&(m+="<span style=color:#AAA;font-size:small> - "+EscapeHtml(r.name)+"</span>"),QH("p10deviceName",m),QH("p11deviceName",m),QH("p12deviceName",m),QH("p13deviceName",m),QH("p14deviceName",m),QH("p15deviceName","Konsole - "+m),QH("p16deviceName",m),QH("p17deviceName",m),QH("p19deviceName",m);var g="<table style=width:100%>";0!=(8&args.hide)&&(g+="<br />"+addDeviceAttribute("Name",p)),r&&(g+=addDeviceAttribute('<span title="Der Name der Gerätegruppe zu der dieser Rechner gehört.">Gruppe</span>','<a href=# title="Der Name der Gerätegruppe zu der dieser Rechner gehört" onclick=gotoMesh("'+o.meshid+'") style=cursor:pointer>'+EscapeHtml(meshes[o.meshid].name)+"</a>")),null!=o.rname&&o.name!=o.rname&&(g+=addDeviceAttribute('<span title="Der im Betriebssystem festgelegte Name dieses Computers">Name im Betriebssystem</span>','<span title="Der im Betriebssystem festgelegte Name dieses Computers">'+EscapeHtml(o.rname)+"</span>")),0==(1&features)&&(g+=addDeviceAttribute("Hostname",addLinkConditional("<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>"+(o.host?EscapeHtml(o.host):"<i>Kein(e)</i>")+"</span>","showEditNodeValueDialog(1)",4&a)));var h=o.desc?EscapeHtml(o.desc):"<i>Kein(e)</i>";if(g+=addDeviceAttribute("Beschreibung",0!=(4&a)?"<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>"+h+' <img class=hoverButton src="images/link5.png" /></span>':h),null!=o.agent&&null!=o.agent.id&&null!=o.agent.ver){var v="";v=o.agent.id<=agentsStr.length?agentsStr[o.agent.id]:agentsStr[0],0!=o.agent.ver&&(v+=" v"+o.agent.ver),g+=addDeviceAttribute("Mesh-Agent",v)}if(null!=o.intelamt){v="";var f={0:nobreak("Nicht aktiviert (Pre)"),1:nobreak("Nicht aktiviert (In)"),2:nobreak("Aktiviert")};null!=o.intelamt.ver&&null==o.intelamt.state?v+="<i>Unbekannter Zustand</i>, v"+o.intelamt.ver:null==o.intelamt.ver&&2==o.intelamt.state?v+="<i>Aktiviert</i>":null==o.intelamt.ver||null==o.intelamt.state?v+="<i>Unbekannte Version & Zustand</i>":(v+=f[o.intelamt.state],2==o.intelamt.state&&o.intelamt.flags&&(2&o.intelamt.flags?v+=' <span title="Intel AMT ist im Client Control Mode aktiviert">CCM</span>':4&o.intelamt.flags&&(v+=' <span title="Intel AMT ist im Admin Control Mode aktiviert">ACM</span>')),v+=", v"+o.intelamt.ver),1==o.intelamt.tls&&(v+=', <span title="Intel AMT ist mit TLS-Netzwerksicherheit eingerichtet">TLS</span>'),2==o.intelamt.state&&(null!=o.intelamt.user&&""!=o.intelamt.user||(v+=0!=(4&a)?', <i style=color:#FF0000;cursor:pointer title="Zugangsdaten für Intel&reg; AMT bearbeiten" onclick=editDeviceAmtSettings("'+o._id+'")>Keine Zugangsdaten</i>':", <i style=color:#FF0000>Keine Zugangsdaten</i>"),v+=" ",0!=(4&a)&&(v+='<img src=images/link4.png height=10 width=10 title="Zugangsdaten für Intel&reg; AMT bearbeiten" style=cursor:pointer onclick=editDeviceAmtSettings("'+o._id+'")>'));var k='<span title="Intel&reg; Manageability Engine">Intel&reg; ME<span>';"number"==typeof o.intelamt.sku&&(0!=(8&o.intelamt.sku)?k='<span title="Intel&reg; Active Management Technology">Intel&reg; AMT<span>':0!=(16&o.intelamt.sku)&&(k='<span title="Intel&reg; Standard Manageability">Intel&reg; SM<span>')),g+=addDeviceAttribute(k,v)}if(null!=o.agent&&null!=o.agent.tag)(b=EscapeHtml(o.agent.tag)).startsWith("mailto:")&&(b='<a href="'+b+'">'+b.substring(7)+"</a>"),g+=addDeviceAttribute("Agent-Markierung",b);else if(null!=o.intelamt&&null!=o.intelamt.tag){var b;(b=EscapeHtml(o.intelamt.tag)).startsWith("mailto:")&&(b='<a href="'+b+'">'+b.substring(7)+"</a>"),g+=addDeviceAttribute("Intel&reg; AMT Kennzeichen",b)}if(o.osdesc&&(g+=addDeviceAttribute("Betriebssystem",o.osdesc)),o.av&&0<o.av.length){var x=[];for(var y in o.av)if(o.av[y].product){var w=EscapeHtml(o.av[y].product);!0!==o.av[y].enabled&&(w+=" - <span style=color:red>Deaktiviert</span>"),!0!==o.av[y].updated&&(w+=" - <span style=color:red>Veraltet</span>"),1==o.av[y].enabled&&1==o.av[y].updated&&(w+=" - <span style=color:green>OK</span>"),x.push(w)}g+=addDeviceAttribute("Antivirus",x.join("<br />"))}if(o.users&&o.conn&&0<o.users.length&&1&o.conn&&(g+=addDeviceAttribute(format("Aktive Benutzer{0}",1<o.users.length?"s":""),o.users.join(", "))),null!=o.agent){var S=[],D=0;o.consent&&(D=o.consent),serverinfo.consent&&(D|=serverinfo.consent),64&D&&8&D?S.push("Desktop-Einverständnis & -Werkzeugleiste"):64&D?S.push("Desktop-Werkzeugleiste"):8&D?S.push("Desktop-Einverständnis"):1&D&&S.push("Desktop-Benachrichtigung"),16&D?S.push("Terminal-Einverständnis"):2&D&&S.push("Terminal-Benachrichtigung"),32&D?S.push("Dateien-Einverständnis"):4&D&&S.push("Dateien-Benachrichtigung"),7==D&&(S=["Immer benachrichtigen"]),56==(56&D)&&(S=["Immer nachfragen"]),""==(S=S.join(", "))&&(S="<i>Kein(e)</i>"),g+=addDeviceAttribute("Benutzereinwilligung",addLinkConditional(S,"p20editmeshconsent(3)",1&a))}var C=o.conn;if(C&&1<C){var M=[];0!=(1&o.conn)&&M.push('<span title="Mesh-Agent ist verbunden und bereit.">Mesh-Agent</span>'),0!=(2&o.conn)?M.push('<span title="Intel&reg; AMT CIRA ist verbunden und einsatzbereit.">Intel&reg; AMT CIRA</span>'):0!=(4&o.conn)&&M.push('<span title="Intel&reg; AMT ist routebar und einsatzbereit.">Intel&reg; AMT</span>'),0!=(8&o.conn)&&M.push('<span title="Mesh-Agent ist erreichbar mittels eines anderen Agenten als Vermittler.">Netzrelais</span>'),0!=(16&o.conn)&&M.push('<span title="MQTT-Verbindung zum Gerät ist aktiv.">MQTT</span>'),g+=addDeviceAttribute("Konnektivität",M.join(", "))}var E="<i>Kein(e)</i>";if(null!=o.tags)for(var y in E="",o.tags)E+='<span class="tagSpan">'+o.tags[y]+"</span>";g+=addDeviceAttribute("Tags",0!=(4&a)?"<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>"+E+' <img class=hoverButton src="images/link5.png" /></span>':E),g+="</table><br />",0!=(76&a)&&(g+='<input type=button value="Aktionen" title="Energiezustandsaktionen auf dem Gerät ausführen" onclick=deviceActionFunction() />'),g+='<input type=button value="Notizen" title="Zeige Notizen zu diesem Gerät" onclick=showNotes('+(0==(128&a))+',"'+encodeURIComponentEx(o._id)+'") />',g+='<input type=button value="Ereignis eintragen" title="Schreibe ein Ereignis für dieses Gerät" onclick=writeDeviceEvent("'+encodeURIComponentEx(o._id)+'") />',1&C&&8&a&&(g+='<input type=button value="Nachricht" title="Display a text message on the remote device" onclick=deviceMessageFunction() />'),QH("p10html",g),masterUpdate(256);var A=4294967295==a||0==(65536&a),T=4294967295==a||0==(512&a),N=4294967295==a||0==(1024&a),U=4294967295==a||0==(2048&a);g='<div class="p10html3right">',0!=(4&a)&&(g+='&nbsp;<a href=# onclick=p10showChangeGroupDialog(["'+o._id+'"]) title="Dieses Gerät in eine andere Gerätegruppe verschieben">Gruppe wechseln</a>',g+='&nbsp;<a href=# onclick=p10showDeleteNodeDialog("'+o._id+'") title="Dieses Gerät entfernen">Gerät löschen</a>'),g+='</div><div class="p10html3left">',o.agent&&(g+='<a href=# onclick=p10showNodeNetInfoDialog("'+o._id+'") title="Geräte-Netzwerkschnittstelleninformationen anzeigen">Schnittstellen</a>&nbsp;'),32768&features&&null!=xxmap&&(g+='<a href=# onclick=p10showNodeLocationDialog("'+o._id+'") title="Geräte-Standortinformationen anzeigen">Standort</a>&nbsp;'),4294967295!=userinfo.siteadmin&&0!=(128&userinfo.siteadmin)||T&&0!=(8&a)&&null!=o.agent&&(g+='<a href=# onclick=p10showMeshCmdDialog(1,"'+o._id+'") title="Trafficrouter verwendet, um zu einem Gerät über diesen Server zu verbinden.">MeshCmd</a>&nbsp;'),0!==args.xterm||!o.agent||0==(2&o.agent.caps)||0==(8&a)||4294967295!=a&&0!=(512&a)||(g+='<a href=# onclick=p10openxterm(event,"'+o._id+'") title="Öffnen Sie das XTerm-Terminal">XTerm</a>&nbsp;'),0!=(1&C)&&1==clickOnce&&o.agent&&0!=(8&a)&&(0<o.agent.id&&o.agent.id<5&&(g+='<a href=# cmenu=altPortContextMenu id=rdpClickOnceLink onclick=p10clickOnce("'+o._id+'","RDP2") title="Benötigt Microsoft-ClickOnce-Unterstützung in Ihrem Browser.">RDP</a>&nbsp;'),4<o.agent.id&&(g+='<a href=# onclick=p10clickOnce("'+o._id+'","PSSH",22) title="Benötigt Microsoft-ClickOnce-Unterstützung in Ihrem Browser.">Putty</a>&nbsp;',g+='<a href=# onclick=p10clickOnce("'+o._id+'","WSCP",22) title="Benötigt Microsoft-ClickOnce-Unterstützung in Ihrem Browser.">WinSCP</a>&nbsp;')),0!=(1&C)&&o.agent&&0!=(8&a)&&0==(536870912&features)&&(g+='<a href=# cmenu=rfbPortContextMenu id=rfbLink onclick=p10rfb("'+o._id+'") title="Launch noVNC session to this device.">noVNC</a>&nbsp;'),0!=(1&C)&&o.agent&&0!=(8&a)&&0==(1073741824&features)&&(g+='<a href=# cmenu=rfbPortContextMenu id=mstscLink onclick=p10mstsc("'+o._id+'") title="Launch web-based RDP session to this device.">Web-RDP</a>&nbsp;'),4294967295==a&&4194304&features&&(g+='<a href=# onclick=p10showMqttLoginDialog("'+o._id+'") title="MQTT-Zugangsdaten für dieses Gerät abrufen.">MQTT-Anmeldung</a>&nbsp;'),g+="</div><br>",QH("p10html3",g);var _=PowerStateStr(o.state);0!=(1&C)&&(0<_.length&&(_+="<br/>"),_+='<span style=font-size:12px title="Agent verbunden">Agent verbunden</span>'),0!=(2&C)?(0<_.length&&(_+="<br/>"),_+='<span style=font-size:12px title="Intel&reg; AMT verbunden">Intel&reg; AMT verbunden</span>'):0!=(4&C)&&(0<_.length&&(_+="<br/>"),_+='<span style=font-size:12px title="Intel&reg; AMT erkannt">Intel&reg; AMT erkannt</span>'),0!=(16&C)&&(0<_.length&&(_+="<br/>"),_+='<span style=font-size:12px title="MQTT verbunden">MQTT-Kanal verbunden</span>'),""==_&&o.lastconnect&&(_="<span style=font-size:12px>Zuletzt gesehen:<br />"+printDateTime(new Date(o.lastconnect))+"</span>"),QH("MainComputerState",_),Q("MainComputerImage").setAttribute("src","images/icons256-"+o.icon+"-1.png"),Q("MainComputerImage").className=o.conn&&0!=o.conn?"":"gray",T&&setupTerminal(),N&&setupFiles();var I=0!=(16&a);I?setupConsole():15==t&&(t=10),QV("MainDevDesktop",A&&(null==o.agent&&("number"!=typeof o.intelamt.sku||0!=(8&o.intelamt.sku))||null!=o.agent&&(null==o.agent.caps||0!=(1&o.agent.caps)||o.intelamt&&2==o.intelamt.state))&&(8&a||256&a)),QV("MainDevTerminal",(null==o.agent&&null!=o.intelamt||null==o.agent.caps||0!=(2&o.agent.caps)||o.intelamt&&2==o.intelamt.state)&&8&a&&T),QV("MainDevFiles",null!=o.agent&&null!=o.agent.caps&&0!=(4&o.agent.caps)&&8&a&&N),QV("MainDevAmt",null!=o.intelamt&&(2==o.intelamt.state||2&o.conn)&&8&a&&U),QV("MainDevConsole",I&&null!=o.agent&&null!=o.agent.caps&&0!=(8&o.agent.caps)&&8&a),QV("MainDevPlugins",!1),QV("p15uploadCore",null!=o.agent&&null!=o.agent.caps&&0!=(16&o.agent.caps)),QH("p15coreName",null!=o.agent&&null!=o.agent.core?o.agent.core:"");var V=Q("p14iframe").contentWindow.getCurrentMeshNode();null!=V&&V._id!=currentNode._id&&Q("p14iframe").contentWindow.disconnect();var z=0!=(6&o.conn);if(Q("p14iframe").contentWindow.setConnectionState(z),Q("p14iframe").contentWindow.setFrameHeight("650px"),Q("p14iframe").contentWindow.setAuthCallback(updateAmtCredentials),QV("deskActionsBtn",0!=(72&a)),QV("termActionsBtn",0!=(72&a)),QV("filesActionsBtn",0!=(72&a)),powerTimelineNode!=currentNode._id&&powerTimelineReq!=currentNode._id&&(QH("p10html2",""),powerTimelineReq=currentNode._id,meshserver.send({action:"powertimeline",nodeid:currentNode._id}),meshserver.send({action:"lastconnect",nodeid:currentNode._id}),meshserver.send({action:"getsysinfo",nodeid:currentNode._id}),meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id}),QH("p17info","")),QV("DeskTools",!1),showDeskToolsProcesses(),refreshDeviceEvents(),document.title=currentNode&&10<=xxcurrentView&&xxcurrentView<20?currentNode.name+(r?" - "+r.name:"")+" - "+decodeURIComponent("{{{extitle}}}"):decodeURIComponent("{{{extitle}}}"),s&&(p11clearConsoleMsg(),p12clearConsoleMsg(),p13clearConsoleMsg()),null!=pluginHandler){QH("p19headers",""),QH("p19pages",""),pluginHandler.callHook("onDeviceRefreshEnd",e,t,n,i);var R=getstore("_curPluginPage",null);null!=R&&null!=Q("p19ph-"+R)&&pluginHandler.callPluginPage(R,Q("p19ph-"+R))}if(g="",7&a&&(g+='<a href=# onclick="return p20showAddMeshUserDialog(5)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzer hinzufügen</a>',null!=usergroups)){var B=0,H=!1;for(var y in usergroups)usergroups[y]._id.split("/")[1]==e.split("/")[1]&&(B++,null!=currentNode.links&&null!=currentNode.links[y]||(H=!0));0<B&&H&&(g+='<a href=# onclick="return p20showAddMeshUserDialog(6)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzergruppe hinzufügen</a>')}g+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Benutzerberechtigungen</th><th scope=col style=text-align:left></th></tr>';var F=1;if(null!=currentNode.links){var G=[];for(var y in currentNode.links)(y.startsWith("user/")||y.startsWith("ugrp/"))&&G.push(y);for(var y in G.sort(),G){var P="",L="",O=G[y],K=currentNode.links[O].rights,W=EscapeHtml(O.split("/")[2]),j=(L=makeUserDeviceRightsString(K),!1);null!=users&&null!=users[O]&&(W=EscapeHtml(users[O].name)),null!=usergroups&&null!=usergroups[O]&&(W=EscapeHtml(usergroups[O].name),j=!0),0!=(2&a)&&(L=j?(P="<a href=# onclick='return p30removeUserFromNode(event,\""+encodeURIComponentEx(O)+'")\' title="Benutzergruppenrechte an dieser Gerätegruppe entfernen" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>','<span style=cursor:pointer onclick=p20showAddMeshUserDialog(6,"'+encodeURIComponentEx(O)+'")>'+L+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"):(P="<a href=# onclick='return p30removeUserFromNode(event,\""+encodeURIComponentEx(O)+'")\' title="Entziehe Benutzerrechte an dieser Gerätegruppe" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>','<span style=cursor:pointer onclick=p20showAddMeshUserDialog(5,"'+encodeURIComponentEx(O)+'")>'+L+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>")),null!=users&&(W=j?"<a href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(O)+"\");haltEvent(event);'>"+W+"</a>":"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(O)+"\");haltEvent(event);'>"+W+"</a>"),g+="<tr "+(++F%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="'+(j?"Benutzergruppe":"Benutzer")+'" class=m'+(j?4:2)+"></div><div>&nbsp;"+W+"<div></div></div></td><td style=width:70%><div style=float:right>"+P+"</div><div>"+L+"</div></td></tr>"}}1==F&&(g+="<tr><td><div style=padding:6px>&nbsp;<i>Keine Benutzer mit speziellen Geräteberechtigungen</i><div></div></div></td><td></td></tr>"),g+="</tbody></table>",QH("p10html4",g);var q="";if(0==(268435456&features)&&10<=xxcurrentView&&xxcurrentView<=19&&null!=currentNode){for(var y in q="?viewmode="+xxcurrentView+"&gotonode="+currentNode._id.split("/")[2],urlargs)q+="&"+y+"="+urlargs[y];try{window.history.replaceState({},document.title,window.location.pathname+q)}catch(e){}}}setupDesktop(),go(t=t||10)}}else setDialogMode(2,"Konto-Sicherheit",1,null,'Auf Geräte kann nicht zugegriffen werden, bis die E-Mail-Adresse verifiziert wurde. Dies wird für eine Passwort-Wiederherstellung benötigt. Gehen Sie auf den "Mein Konto"-Tab, um Ihre E-Mail-Adresse zu ändern und zu verifizieren.')}function makeUserDeviceRightsString(e){if(57592==e)return"Volle Geräterechte";var t=[];if(8&e){var n=[];256&e&&n.push("Keine Eingabe"),512&e&&n.push("Kein Terminal"),1024&e&&n.push("Keine Dateien"),2048&e&&n.push("Kein AMT"),4096&e&&n.push("Eingeschränkte Eingabe"),65536&e&&n.push("Kein Desktop"),0<n.length?t.push("Control ("+n.join(", ")+")"):t.push("Steuerung")}return 16&e&&t.push("Konsole"),32&e&&t.push("Server-Dateien"),64&e&&t.push("Aufwachen"),128&e&&t.push("Notizen"),8192&e&&t.push("Ereignisse begrenzen"),16384&e&&t.push("Chat"),32768&e&&t.push("Deinstallation"),0==t.length?"Keine Berechtigungen":t.join(", ")}function makeDeviceGroupRightsString(e){if(4294967295==e)return"Volle Rechte";var t=[];if(1&e&&t.push("Gruppe bearbeiten"),2&e&&t.push("Benutzer verwalten"),4&e&&t.push("Geräte verwalten"),8&e){var n=[];256&e&&n.push("Keine Eingabe"),512&e&&n.push("Kein Terminal"),1024&e&&n.push("Keine Dateien"),2048&e&&n.push("Kein AMT"),4096&e&&n.push("Eingeschränkte Eingabe"),65536&e&&n.push("Kein Desktop"),0<n.length?t.push("Control ("+n.join(", ")+")"):t.push("Steuerung")}return 16&e&&t.push("Konsole"),32&e&&t.push("Server-Dateien"),64&e&&t.push("Aufwachen"),128&e&&t.push("Notizen"),8192&e&&t.push("Ereignisse begrenzen"),16384&e&&t.push("Chat"),32768&e&&t.push("Deinstallation"),0==t.length?"Keine Berechtigungen":t.join(", ")}function writeDeviceEvent(e){xxdialogMode||(setDialogMode(2,"Geräte-Ereignis hinzufügen",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>",e),Q("d2devEvent").focus())}function writeDeviceEventEx(e,t){meshserver.send({action:"setDeviceEvent",nodeid:decodeURIComponent(t),msg:encodeURIComponentEx(Q("d2devEvent").value)})}function showNotes(e,t){xxdialogMode||(setDialogMode(2,"Notizen",2,showNotesEx,"<textarea id=d2devNotes ro="+e+" noteid="+t+" readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>Gerätegruppennotizen können von anderen Gerätegruppenadministratoren eingesehen und verändert werden.<span>",t),meshserver.send({action:"getNotes",id:decodeURIComponent(t)}))}function showNotesEx(e,t){meshserver.send({action:"setNotes",id:decodeURIComponent(t),notes:encodeURIComponentEx(Q("d2devNotes").value)})}function deviceChat(e){if(!xxdialogMode){var t="/messenger?id=meshmessenger/"+encodeURIComponentEx(currentNode._id)+"/"+encodeURIComponentEx(userinfo._id)+"&title="+currentNode.name;null!=authCookie&&""!=authCookie&&(t+="&auth="+authCookie),e&&1==e.shiftKey?window.open(t,"meshmessenger:"+currentNode._id):window.open(t,"meshmessenger:"+currentNode._id,"directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560"),meshserver.send({action:"meshmessenger",nodeid:decodeURIComponent(currentNode._id)})}}function deviceToggleBackground(){xxdialogMode||meshserver.send({action:"msg",type:"deskBackground",nodeid:currentNode._id,op:1})}function deviceUrlFunction(){xxdialogMode||(setDialogMode(2,"Öffne Seite auf Gerät",3,deviceUrlFunctionEx,'<input id=d2devurl placeholder="http://server.com" style=width:100%;overflow-y:scroll></input>'),Q("d2devurl").focus())}function deviceUrlFunctionEx(){meshserver.send({action:"msg",type:"openUrl",nodeid:currentNode._id,url:Q("d2devurl").value})}function deviceMessageFunction(){xxdialogMode||(setDialogMode(2,"Device Message",3,deviceMessageFunctionEx,"<div style=margin-bottom:4px>Display a message box on the remote device.</div><textarea id=d2devMessage style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>"),Q("d2devMessage").focus())}function deviceMessageFunctionEx(){meshserver.send({action:"msg",type:"messagebox",nodeid:currentNode._id,title:"{{{title}}}",msg:Q("d2devMessage").value})}function deviceToastFunction(){xxdialogMode||(setDialogMode(2,"Gerätebenachrichtigung",3,deviceToastFunctionEx,"<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>"),Q("d2devToast").focus())}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"{{{title}}}",msg:Q("d2devToast").value})}function deviceActionFunction(){if(!xxdialogMode){var e=GetNodeRights(currentNode),t="Wählen Sie eine Operation für die Durchführung auf diesem Gerät.<br /><br />",n="<select id=d2deviceop style=float:right;width:250px>";0!=(64&e)&&(n+="<option value=100>Aufwecken</option>"),0!=(8&e)&&(n+="<option value=4>Schlafen</option><option value=3>Zurücksetzen</option><option value=2>Ausschalten</option>"),0!=(16&currentNode.conn)&&(n+="<option value=103>Sende MQTT-Nachricht</option>"),0!=(1&currentNode.conn)&&0!=(32768&e)&&(n+="<option value=104>Agenten deinstallieren</option>"),setDialogMode(2,"Geräteaktion",3,deviceActionFunctionEx,t+=addHtmlValue("Vorgang",n+="</select>"))}}function deviceActionFunctionEx(){var e=Q("d2deviceop").value;100==e?meshserver.send({action:"wakedevices",nodeids:[currentNode._id]}):103==e?p10showSendMqttMsgDialog([currentNode._id]):104==e?p10showSendUninstallAgentDialog([currentNode._id]):meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e)})}function updateAmtCredentials(e){var t=getNodeFromId(currentNode._id);1==e||null==t.intelamt.user||""==t.intelamt.user?editDeviceAmtSettings(currentNode._id,updateAmtCredentialsEx):Q("p14iframe").contentWindow.connectButtonfunctionEx()}function updateAmtCredentialsEx(e,t){Q("p14iframe").contentWindow.connectButtonfunctionEx()}function updateDeviceTimeline(){2==meshserver.State&&null!=powerTimelineNode&&null!=powerTimelineUpdate&&null!=currentNode&&powerTimelineNode==powerTimelineReq&&currentNode._id==powerTimelineNode&&powerTimelineUpdate<Date.now()&&(powerTimelineUpdate=null,meshserver.send({action:"powertimeline",nodeid:currentNode._id}),meshserver.send({action:"lastconnect",nodeid:currentNode._id}))}function drawDeviceTimeline(){if(!(null==currentNode||xxcurrentView<10||19<xxcurrentView)){var e=null,t=Date.now();currentNode._id==powerTimelineNode&&(e=powerTimeline);var n=new Date;n.setHours(0,0,0,0);(n=new Date(n.getTime()-5184e5)).getTime();var i=[];if(null!=e&&1<e.length){i.push([0,e[1],e[0]]);for(var o=e[1],r=2;r<e.length;r+=2){var a=e[r],s=t;e.length>r+1&&(s=e[r+1]),i.push([o,o+s,a]),o+=s}}var l="",d=1,c=new Date,u=Q("masthead").offsetWidth-192;c.setHours(0,0,0,0);for(r=0;r<7;r++){var p="",m=c.getTime(),g=m+864e5;for(var h in i){var v=i[h];if(1==isTimeBlockInside(m,g,v[0],v[1])){var f=Math.max(m,v[0]),k=Math.min(Math.min(g,v[1]),t),b=Math.round((k-f)*u/864e5);if(0<b){var x=format("{0} from {1} to {2}.",powerStateStrings2[v[2]],printTime(new Date(f)),printTime(new Date(k)));p+='<div class="pwState '+powerColor(v[2])+'" title="'+x+'" style="width:'+b+'px;"></div>'}}}l+="<tr class="+(d%2==0?"altBack":"")+"><td><div>&nbsp;"+printDate(c)+"<div></div></div></td><td><div>"+p+"</div></td></tr>",++d,c=new Date(c.getTime()-864e5)}QH("p10html2",'<table cellpadding=2 cellspacing=0><thead><tr style=><th scope=col style=text-align:center;width:150px>Tag</th><th scope=col style=text-align:center><a download href="devicepowerevents.ashx?id='+currentNode._id+(urlargs.key?"&key="+urlargs.key:"")+'" onclick="setDialogMode(0)"><img title="Energiezustandsereignisse herunterladen" src="images/link4.png" /></a>7-Tage-Energiezustand</th></tr></thead><tbody>'+l+"</tbody></table>")}}function powerColor(e){return e<powerColorTable.length?powerColorTable[e]:"pwsYellow"}function isTimeBlockInside(e,t,n,i){return n<e&&t<i||(e<n&&n<t||e<i&&i<t)}function addDeviceAttribute(e,t){return"<tr><td class=style7>"+e+"</td><td class=style9>"+t+"</td></tr>"}function editDeviceAmtSettings(e,t,n){if(!xxdialogMode){var i="",o=getNodeFromId(e),r=3;0!=(4&GetNodeRights(o))&&(i+=addHtmlValue("Benutzername",'<input id=dp10username style=width:230px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />'),i+=addHtmlValue("Passwort","<input id=dp10password type=password style=width:230px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />"),i+=addHtmlValue("Sicherheit","<select id=dp10tls style=width:236px><option value=0>Keine TLS-Sicherheit</option><option value=1>TLS-Sicherheit vorausgesetzt</option></select>"),null!=o.intelamt.user&&""!=o.intelamt.user&&(r=7),setDialogMode(2,"Zugangsdaten für Intel&reg; AMT bearbeiten",r,editDeviceAmtSettingsEx,i,{node:o,func:t,arg:n}),null!=o.intelamt.user&&""!=o.intelamt.user?Q("dp10username").value=o.intelamt.user:Q("dp10username").value="admin",Q("dp10tls").value=o.intelamt.tls,validateDeviceAmtSettings())}}function validateDeviceAmtSettings(){QE("idx_dlgOkButton",passwordcheck(Q("dp10password").value))}function editDeviceAmtSettingsEx(e,t){if(2==e)meshserver.send({action:"changedevice",nodeid:t.node._id,intelamt:{user:"",pass:""}});else{var n=Q("dp10username").value;""==n&&(n="admin");var i=Q("dp10password").value;""==i&&(n=""),meshserver.send({action:"changedevice",nodeid:t.node._id,intelamt:{user:n,pass:i,tls:parseInt(Q("dp10tls").value)}}),t.node.intelamt.user=n,t.node.intelamt.tls=parseInt(Q("dp10tls").value),t.func&&setTimeout(function(){t.func(null,t.arg)},300)}}function p10showSendMqttMsgDialog(e){if(xxdialogMode)return!1;var t=addHtmlValue("Thema","<input id=dp2topic style=width:230px maxlength=64 onchange=p10validateSendMqttMsgDialog() onkeyup=p10validateSendMqttMsgDialog(event,1) />");return setDialogMode(2,"Sende MQTT-Nachricht",3,p10showSendMqttMsgDialogEx,t+=addHtmlValue("Nachricht","<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>"),e),p10validateSendMqttMsgDialog(),Q("dp2topic").focus(),!1}function p10validateSendMqttMsgDialog(){QE("idx_dlgOkButton",0<Q("dp2topic").value.length&&0<Q("dp2msg").value.length)}function p10showSendMqttMsgDialogEx(e,t){meshserver.send({action:"sendmqttmsg",nodeids:t,topic:Q("dp2topic").value,msg:Q("dp2msg").value}),uncheckAllDevices()}function p10showSendUninstallAgentDialog(e){if(xxdialogMode)return!1;var t="";return t=1<e.length?format("Möchten Sie die ausgewählten {0} Agenten wirklich deinstallieren?",e.length):"Möchten Sie den ausgewählten Agenten wirklich deinstallieren?",t+="<br /><br />",1<e.length?t+="Dies wird die Geräte nicht vom Server entfernen, aber die Geräte werden nicht länger eine Verbindung zum Server aufbauen können. Aller entfernter Zugriff auf die Geräte geht verloren. Die Geräte müssen verbunden sein, damit dieser Befehl funktioniert.":t+="Dies wird das Gerät nicht vom Server entfernen, aber das Gerät wird nicht länger eine Verbindung zum Server aufbauen können. Aller entfernter Zugriff auf das Gerät geht verloren. Das Gerät muss verbunden sein, damit dieser Befehl funktioniert.",setDialogMode(2,"Agenten deinstallieren",3,p10showSendUninstallAgentDialogEx,t+="<br /><br /><label style=color:red><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />Bestätigen</label>",e),p10validateSendUninstallAgentDialog(),!1}function p10validateSendUninstallAgentDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showSendUninstallAgentDialogEx(e,t){meshserver.send({action:"uninstallagent",nodeids:t}),uncheckAllDevices()}function p10showChangeGroupDialog(e){if(xxdialogMode)return!1;var t=null;if(1==e.length)try{t=meshes[getNodeFromId(e[0])]._id}catch(e){}var n="<select id=p10newGroup style=width:236px>",i=0;for(var o in meshes){var r=GetMeshRights(o);meshes[o]._id!=t&&4&r&&(i++,n+="<option value='"+meshes[o]._id+"'>"+meshes[o].name+"</option>")}if(n+="</select>",0<i){var a=1==e.length?"Wähle eine neue Gruppe für dieses Gerät<br /><br />":"Wähle eine neue Gruppe für die ausgewählten Geräte<br /><br />";setDialogMode(2,"Gruppe wechseln",3,p10showChangeGroupDialogEx,a+=addHtmlValue("Neue Gerätegruppe",n),e)}else setDialogMode(2,"Gruppe wechseln",1,null,"Es existiert keine andere Gerätegruppe des selben Typs.");return!1}function p10showChangeGroupDialogEx(e,t){meshserver.send({action:"changeDeviceMesh",nodeids:t,meshid:Q("p10newGroup").value}),uncheckAllDevices()}function p10showDeleteNodeDialog(e){return xxdialogMode||(setDialogMode(2,"Knoten löschen",3,p10showDeleteNodeDialogEx,format("Möchten Sie den Knoten {0} wirklich löschen?",EscapeHtml(currentNode.name))+"<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />Bestätigen</label>",e),p10validateDeleteNodeDialog()),!1}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(e,t){meshserver.send({action:"removedevices",nodeids:[t]})}function p10clickOnce(e,t,n){return"RDP2"==t&&null==n&&(n=null!=currentNode.rdpport?currentNode.rdpport:3389),meshserver.send({action:"getcookie",nodeid:e,tcpport:n,tag:"clickonce",protocol:t}),!1}function p10rfb(e,t){null==t&&(t=null!=currentNode.rfbport?currentNode.rfbport:5900),meshserver.send({action:"getcookie",nodeid:e,tcpport:t,tag:"novnc"})}function p10mstsc(e,t){null==t&&(t=null!=currentNode.rdpport?currentNode.rdpport:3389),meshserver.send({action:"getcookie",nodeid:e,tcpport:t,tag:"mstsc"})}var d2map=null;function p10showNodeLocationDialog(){if(null!=xxdialogMode&&"@xxmap"==xxdialogTag)setDialogMode(0);else if(xxdialogMode)return!1;var e=[],t=["iploc","wifiloc","gpsloc","userloc"],n=null;for(var i in t)if(null!=currentNode[t[i]]){var o=currentNode[t[i]].split(","),r=parseFloat(o[0]),a=parseFloat(o[1]);if(r<90&&-90<r&&a<180&&-180<a){var s=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([a,r]))});s.setStyle(markerStyle(currentNode,parseInt(i)+1)),e.push(s),null==n?n=[r,a,r,a,0]:(r<n[0]&&(n[0]=r),a<n[1]&&(n[1]=a),r>n[2]&&(n[2]=r),a>n[3]&&(n[3]=a))}}var l=new ol.source.Vector({features:e}),d=new ol.layer.Vector({source:l});setDialogMode(2,"Gerätestandort",1,null,"<div id=d2map style=width:100%;height:300px></div>","@xxmap");var c=0,u=0,p=8;if(null!=n){u=(n[0]+n[2])/2,c=(n[1]+n[3])/2;var m=Math.max(Math.abs(n[0]-n[2]),Math.abs(n[1]-n[3])),g=360;for(p=-2;m<g;)p++,g/=2}return 1==e.length&&(p=8),d2map=new ol.Map({target:"d2map",interactions:ol.interaction.defaults({dragPan:!1,mouseWheelZoom:!1}),layers:[new ol.layer.Tile({source:new ol.source.OSM}),d],view:new ol.View({center:ol.proj.fromLonLat([c,u]),zoom:p})}),!1}function p10showNodeNetInfoDialog(){return xxdialogMode||(setDialogMode(2,"Netzwerkschnittstellen",1,null,"<div id=d2netinfo>Laden...</div>","if"+currentNode._id),meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id})),!1}function p10showMeshRouterDialog(){if(!xxdialogMode){var e="<div>MeshCentral Router ist ein Windows-Werkzeug für die TCP-Portweiterleitung. Sie können beispielsweise über diesen Server in ein Remote-Gerät per RDP erreichen.</div><br />";e+=addHtmlValue("Win32 ausführbar",'<a style=cursor:pointer download href="meshagents?meshaction=winrouter'+(urlargs.key?"&key="+urlargs.key:"")+'" onclick="setDialogMode(0)">MeshCentralRouter.exe</a>');var t=serverinfo.name;-1!=t.indexOf(".")&&0==(2&features)||(t=window.location.hostname);domainUrl.substring(0,domainUrl.length-1);e+='<br /><div>Run MeshCentral Router and click "install" to make it launchable from the browser.</div>',e+='<br /><a style=cursor:pointer target="mcrouterframe" rel="noreferrer noopener" download href="'+("mcrouter://"+t+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"control.ashx?c="+authCookie+"&t="+serverinfo.tlshash+"&l={{{lang}}}")+'"><input type=button style=width:100%;cursor:pointer value="Launch MeshCentral Router" /></a>',setDialogMode(2,"MeshCentral Router",1,null,e+='<iframe style=display:none name="mcrouterframe"></iframe>',"fileDownload")}}function p10showMqttLoginDialog(e){meshserver.send({action:"getmqttlogin",nodeid:e})}function p10openxterm(e,t){haltEvent(e);var n="/xterm?nodeid="+encodeURIComponentEx(t)+"&auto=1",i=getNodeFromId(t);if(null!=i)return 0<=[1,2,3,4,21,22].indexOf(i.agent.id)?n+="&os=win":n+="&os=linux",window.open(n,"xterm:"+t),!1}function p10showMeshCmdDialog(e,t){if(!xxdialogMode){"<option value=3>Windows (32bit)</option>","<option value=4>Windows (64bit)</option>","<option value=5>Linux x86 (32bit)</option>","<option value=6>Linux x86 (64bit)</option>","<option value=16>MacOS (64bit)</option>","<option value=25>Linux ARM, Raspberry Pi (32bit)</option>","</select>";var n="";0==e&&(n+="<div>MeshCmd ist ein Befehlszeilenprogramm, das viele verschiedene Vorgänge ausführt. Die Aktionsdatei kann optional heruntergeladen und bearbeitet werden, um Serverinformationen und Anmeldeinformationen bereitzustellen.<br /><br />"),1==e&&(n+='<div>Laden Sie "meshcmd" mit einer Aktionsdatei herunter, um den Datenverkehr über diesen Server an dieses Gerät weiterzuleiten. Stellen Sie sicher, dass Sie meshaction.txt bearbeiten und Ihr Kontokennwort hinzufügen, oder nehmen Sie die erforderlichen Änderungen vor.<br /><br />'),n+=addHtmlValue("Betriebssystem","<select id=aginsSelect onclick=meshCmdOsClick() style=width:236px><option value=3>Windows (32bit)</option><option value=4>Windows (64bit)</option><option value=5>Linux x86 (32bit)</option><option value=6>Linux x86 (64bit)</option><option value=16>MacOS (64bit)</option><option value=25>Linux ARM, Raspberry Pi (32bit)</option></select>"),n+=addHtmlValue("MeshCmd",'<a id=meshcmddownloadid href="meshagents?meshcmd=3'+(urlargs.key?"&key="+urlargs.key:"")+'" download></a>'),0==e&&(n+=addHtmlValue("Aktionsdatei",'<a href="meshagents?meshaction=generic'+(urlargs.key?"&key="+urlargs.key:"")+'" download>MeshAction (.txt)</a>')),1==e&&(n+=addHtmlValue("Aktionsdatei",'<a href="meshagents?meshaction=route&nodeid='+t+(urlargs.key?"&key="+urlargs.key:"")+'" download>MeshAction (.txt)</a>')),setDialogMode(2,"MeshCmd herunterladen",9,null,n+="</div>","fileDownload"),meshCmdOsClick()}}function meshCmdOsClick(){var e=Q("aginsSelect").value,t="";3==e&&(t="MeshCmd (ausführbare Win32-Datei)"),4==e&&(t="MeshCmd (ausführbare Win64-Datei)"),5==e&&(t="MeshCmd (Linux x86, 32bit)"),6==e&&(t="MeshCmd (Linux x86, 64bit)"),16==e&&(t="MeshCmd (MacOS, 64bit)"),25==e&&(t="MeshCmd (Linux ARM, 32bit)"),QH("meshcmddownloadid",t),Q("meshcmddownloadid").setAttribute("href","meshagents?meshcmd="+e+(urlargs.key?"&key="+urlargs.key:""))}function p10showiconselector(){if(!xxdialogMode&&0!=(4&GetNodeRights(currentNode))){'<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i1 onclick=p10setIcon(1) onkeypress="if (event.key==\'Enter\') p10setIcon(1)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i2 onclick=p10setIcon(2) onkeypress="if (event.key==\'Enter\') p10setIcon(2)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i3 onclick=p10setIcon(3) onkeypress="if (event.key==\'Enter\') p10setIcon(3)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i4 onclick=p10setIcon(4) onkeypress="if (event.key==\'Enter\') p10setIcon(4)"></div>',"<br />",'<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i5 onclick=p10setIcon(5) onkeypress="if (event.key==\'Enter\') p10setIcon(5)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i6 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(6)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i7 onclick=p10setIcon(7) onkeypress="if (event.key==\'Enter\') p10setIcon(7)"></div>','<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i8 onclick=p10setIcon(8) onkeypress="if (event.key==\'Enter\') p10setIcon(8)"></div>',"<br /><br /></div>",setDialogMode(2,"Icon-Auswahl",0,null,'<div style=text-align:center><br /><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i1 onclick=p10setIcon(1) onkeypress="if (event.key==\'Enter\') p10setIcon(1)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i2 onclick=p10setIcon(2) onkeypress="if (event.key==\'Enter\') p10setIcon(2)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i3 onclick=p10setIcon(3) onkeypress="if (event.key==\'Enter\') p10setIcon(3)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i4 onclick=p10setIcon(4) onkeypress="if (event.key==\'Enter\') p10setIcon(4)"></div><br /><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i5 onclick=p10setIcon(5) onkeypress="if (event.key==\'Enter\') p10setIcon(5)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i6 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(6)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i7 onclick=p10setIcon(7) onkeypress="if (event.key==\'Enter\') p10setIcon(7)"></div><div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i8 onclick=p10setIcon(8) onkeypress="if (event.key==\'Enter\') p10setIcon(8)"></div><br /><br /></div>'),QV("id_dialogclose",!0)}}function p10setIcon(e){setDialogMode(0),meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:e})}var desktopNode,showEditNodeValueDialog_modes=["Gerätename","Hostname","Beschreibung","Tags"],showEditNodeValueDialog_modes2=["name","host","desc","tags"],showEditNodeValueDialog_modes3=["","","","Tag1, Tag2, Tag3"];function showEditNodeValueDialog(e){if(!xxdialogMode){setDialogMode(2,"Gerät bearbeiten",3,showEditNodeValueDialogEx,addHtmlValue(showEditNodeValueDialog_modes[e],'<input id=dp10devicevalue maxlength=64 placeholder="'+showEditNodeValueDialog_modes3[e]+'" onchange=p10editdevicevalueValidate('+e+",event) onkeyup=p10editdevicevalueValidate("+e+",event) />"),e);var t=currentNode[showEditNodeValueDialog_modes2[e]];null==t&&(t=""),Array.isArray(t)&&(t=t.join(", ")),Q("dp10devicevalue").value=t,p10editdevicevalueValidate(),Q("dp10devicevalue").focus()}}function showEditNodeValueDialogEx(e,t){var n={action:"changedevice",nodeid:currentNode._id};n[showEditNodeValueDialog_modes2[t]]=Q("dp10devicevalue").value,meshserver.send(n)}function p10editdevicevalueValidate(e,t){var n=1<e||0<Q("dp10devicevalue").value.length;QE("idx_dlgOkButton",n),null!=t&&1==n&&13==t.keyCode&&dialogclose(1)}function setupDesktop(){if(desktopNode!=currentNode&&null!=desktop&&(desktop.Stop(),desktop=desktopNode=null),desktopNode!=currentNode||null==desktop){var e=multiDesktop[currentNode._id];if(null!=e){QH("DeskParent","");var t=e.m.CanvasId;t.setAttribute("id","Desk"),t.setAttribute("onmousedown","dmousedown(event)"),t.setAttribute("onmouseup","dmouseup(event)"),t.setAttribute("onmousemove","dmousemove(event)"),t.removeAttribute("onclick"),Q("DeskParent").appendChild(t),(desktop=e).m.SendCompressionLevel&&desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate),desktop.onStateChanged=onDesktopStateChange,desktop.onMetadataChange=function(e){updateMetadata(desktop,"deskmetadata")},desktop&&desktop.m.mouseCursorActive&&desktop.m.mouseCursorActive(!0),desktopNode=currentNode,onDesktopStateChange(desktop,desktop.State),delete multiDesktop[currentNode._id]}else QH("DeskParent",'<canvas id=Desk oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>'),desktopNode=currentNode;Q("Desk").addEventListener("DOMMouseScroll",function(e){return dmousewheel(e)}),Q("Desk").addEventListener("mousewheel",function(e){return dmousewheel(e)})}desktopNode=currentNode,updateDesktopButtons(),deskAdjust(),updateMetadata(desktop,"deskmetadata")}function updateDesktopButtons(){meshes[currentNode.meshid];var e=0;null!=desktop&&(e=desktop.State);var t=GetNodeRights(currentNode);QV("disconnectbutton1span",0!=e),QV("connectbutton1span",0==e&&(8&t||256&t)&&null!=currentNode.agent&&1&currentNode.agent.caps),QV("connectbutton1hspan",0==e&&8&t&&null!=currentNode.intelamt&&2==currentNode.intelamt.state&&null!=currentNode.intelamt.ver&&(null==currentNode.intelamt.sku||"number"==typeof currentNode.intelamt.sku&&0!=(8&currentNode.intelamt.sku))),QV("d7amtkvm",!(null==currentNode.intelamt||null==currentNode.intelamt.ver&&null!=currentNode.agent||0!=e&&2!=desktop.contype)),QV("d7meshkvm",webRtcDesktop||null!=currentNode.agent&&1&currentNode.agent.caps&&(0==e||1==desktop.contype));var n=4294967295==t||0!=(8&t)&&0==(256&t)&&0==(4096&t),i=0!=(1&currentNode.conn);QE("connectbutton1",i);var o=0!=(6&currentNode.conn);QE("connectbutton1h",o),QV("deskFocusBtn",null!=desktop&&2==desktop.contype&&0!=e&&desktopsettings.showfocus),QV("DeskClip",currentNode.agent&&11!=currentNode.agent.id&&16!=currentNode.agent.id&&(null==desktop||2!=desktop.contype)),QE("DeskClip",3==e),QE("DeskType",3==e),QV("DeskWD",n),QE("DeskWD",3==e),QV("deskkeys",n),QE("deskkeys",3==e),QV("DeskSaveImageButton",3==e&&null!=Q("Desk").toBlob),QV("DeskRecordButton",3==e&&null!=Q("Desk").toBlob&&null!=desktop.m.StartRecording),QV("DeskChatButton",0!=(16384&t)&&0==browserfullscreen&&n&&currentNode.agent&&i),QV("DeskNotifyButton",0!=(16384&t)&&0==browserfullscreen&&currentNode.agent&&currentNode.agent.id<5&&n&&currentNode.agent&&i),QV("DeskToolsButton",n&&currentNode.agent&&i),QV("DeskOpenWebButton",0==browserfullscreen&&n&&currentNode.agent&&i),QV("DeskBackgroundButton",3==e&&1==desktop.contype&&currentNode.agent&&11!=currentNode.agent.id&&16!=currentNode.agent.id&&i),QV("DeskControlSpan",n),QV("deskActionsBtn",0==browserfullscreen),QV("deskActionsSettings",0==browserfullscreen),Q("DeskControl").checked=!!(8&t)&&1==getstore("DeskControl",1),QS("DeskControlSpan").color=Q("DeskControl").checked?null:"red",0==i&&QV("DeskTools",!1)}var autoConnectDesktopTimer=null;function autoConnectDesktop(e){autoConnectDesktopTimer=null==autoConnectDesktopTimer?setInterval(function(){connectDesktop(null,1)},1e3):(clearInterval(autoConnectDesktopTimer),null)}var agentConsoleMessages=["","Waiting for user to grant access...","Denied","Failed to start remote terminal session, {0} ({1})","Timeout","Received invalid network data"];function formatAgentConsoleMessage(e,t,n){for(null==n&&(n=[]);n.length<3;)n.push("");return(t&&t<agentConsoleMessages.length?EscapeHtml(format(agentConsoleMessages[t],n[0],n[1],n[2])):EscapeHtml(e)).split("\n").join("<br />")+"<br /><br />"}function connectDesktop(e,t,n,i){if(!xxdialogMode)if(null!=e&&0!=e.shiftKey&&3==t&&(t=1),QV("p11DeskSessionSelector",!1),p11clearConsoleMsg(),null==desktop)if(desktopNode=currentNode,2==t){if(null==desktopNode.intelamt.user||""==desktopNode.intelamt.user)return void editDeviceAmtSettings(desktopNode._id,connectDesktop,2);(desktop=CreateAmtRedirect(CreateAmtRemoteDesktop("Desk"),authCookie)).debugmode=debugmode,desktop.onStateChanged=onDesktopStateChange,desktop.m.bpp=1==desktopsettings.encoding||3==desktopsettings.encoding?1:2,desktop.m.useZRLE=desktopsettings.encoding<3,desktop.m.localKeyMap=desktopsettings.localkeymap,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=deskAdjust,desktop.m.onKvmData=function(e){if(0!=e.length){var t=null;try{t=JSON.parse(e)}catch(e){}if(null!=t&&null!=t.action)if("restart"==t.action)webRtcDesktopReset(),desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}));else if("present"==t.action&&null==webRtcDesktop){webRtcDesktop={platform:t.platform};"undefined"!=typeof RTCPeerConnection?webRtcDesktop.webrtc=new RTCPeerConnection(null):"undefined"!=typeof webkitRTCPeerConnection&&(webRtcDesktop.webrtc=new webkitRTCPeerConnection(null)),webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{}),webRtcDesktop.webchannel.onopen=function(){console.log("WebRTC Data Channel Open"),Q("deskstatus").textContent=StatusStrs[desktop.State]+", Soft-KVM",desktop.m.hold(!0),webRtcDesktop.webRtcActive=!0,webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",Q("id_mainarea")),desktop.m),webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation),webRtcDesktop.softdesktop.m.onScreenSizeChange=deskAdjust,desktopsettings.quality&&(webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality),desktopsettings.scaling&&(webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling),webRtcDesktop.softdesktop.Start()},webRtcDesktop.webchannel.onclose=function(e){console.log("WebRTC Data Channel Closed"),webRtcDesktopReset()},webRtcDesktop.webrtc.onicecandidate=function(e){null==e.candidate?desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp})):webRtcDesktop.webrtcoffer.sdp+="a="+e.candidate.candidate+"\r\n"},webRtcDesktop.webrtc.oniceconnectionstatechange=function(){null==webRtcDesktop||null==webRtcDesktop.webrtc||"disconnected"!=webRtcDesktop.webrtc.iceConnectionState&&"failed"!=webRtcDesktop.webrtc.iceConnectionState||webRtcDesktopReset()},webRtcDesktop.webrtc.createOffer(function(e){webRtcDesktop.webrtcoffer=e,webRtcDesktop.webrtc.setLocalDescription(e,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}})}else"answer"==t.action&&null!=webRtcDesktop&&webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:t.sdp}),function(){},webRtcDesktopReset)}else desktop.m._sentPresence||(desktop.m._sentPresence=!0,desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1})))},desktop.Start(desktopNode._id,16994,"*","*",0),desktop.contype=2}else null==t||1==t||3==t&&4<currentNode.agent.id?((desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).m.mouseCursorActive(11==xxcurrentView),desktop.debugmode=debugmode,desktop.m.debugmode=debugmode,desktop.attemptWebRTC=attemptWebRTC,desktop.options={},null!=n&&(desktop.options.tsid=n),null!=i&&(desktop.options.consent=i),desktop.onStateChanged=onDesktopStateChange,desktop.onConsoleMessageChange=function(){desktop.consoleMessage?(Q("p11DeskConsoleMsg").innerHTML+=formatAgentConsoleMessage(desktop.consoleMessage,desktop.consoleMessageId,desktop.consoleMessageArgs),QV("p11DeskConsoleMsg",!0),null!=p11DeskConsoleMsgTimer&&clearTimeout(p11DeskConsoleMsgTimer),desktop.consoleMessageTimeout&&(p11DeskConsoleMsgTimer=setTimeout(p11clearConsoleMsg,1e3*desktop.consoleMessageTimeout))):p11clearConsoleMsg()},desktop.onMetadataChange=function(e){updateMetadata(desktop,"deskmetadata")},desktop.m.CompressionLevel=desktopsettings.quality,desktop.m.ScalingLevel=desktopsettings.scaling,desktopsettings.framerate&&(desktop.m.FrameRateTimer=desktopsettings.framerate),desktop.m.onDisplayinfo=deskDisplayInfo,desktop.m.onScreenSizeChange=deskAdjust,desktop.Start(desktopNode._id),desktop.latency.callback=function(e){console.log("latency",e),updateSessionTime()},desktop.contype=1):3==t&&meshserver.send({action:"msg",type:"userSessions",nodeid:currentNode._id,tag:i});else desktop.Stop(),webRtcDesktopReset(),desktopNode=desktop=null,null!=pluginHandler&&pluginHandler.callHook("onDesktopDisconnect")}function updateMetadata(e,t){var n="",i=0;if(e&&3==e.State){if(e.metadata&&e.metadata.users)for(var o in e.metadata.users)i+=e.metadata.users[o];1<i&&(n="<span onclick=showSessionMetadata(1) style=cursor:pointer>"+format(", {0} watching",i)+"</span>")}QH("deskmetadata",n),e==desktop&&"sessionMetadata1"==xxdialogTag&&showSessionMetadata(1)}function showSessionMetadata(e){if(!xxdialogMode||xxdialogTag=="sessionMetadata"+e){xxdialogMode&&setDialogMode(0);var t=null;if(1==e&&(t=desktop),t&&t.metadata){var n="";if(t.metadata.startTime&&(n+=addHtmlValue4("Start Time",printDateTime(new Date(t.metadata.startTime)))),t.metadata.users)for(var i in t.metadata.users){var o=1==t.metadata.users[i]?"1 connection":format("{0} connections",t.metadata.users[i]),r=i.split("/")[2];null!=users&&null!=users[i]&&(r=users[i].name),n+=addHtmlValue4(format('User "{0}"',r),o)}setDialogMode(2,"Session Information",1,null,n,"sessionMetadata"+e)}}}function p11clearConsoleMsg(){QH("p11DeskConsoleMsg",""),QV("p11DeskConsoleMsg",!1),p11DeskConsoleMsgTimer&&(clearTimeout(p11DeskConsoleMsgTimer),p11DeskConsoleMsgTimer=null)}function p12clearConsoleMsg(){QH("p12TermConsoleMsg",""),QV("p12TermConsoleMsg",!1),p12TermConsoleMsgTimer&&(clearTimeout(p12TermConsoleMsgTimer),p12TermConsoleMsgTimer=null)}function p13clearConsoleMsg(){QH("p13FilesConsoleMsg",""),QV("p13FilesConsoleMsg",!1),p13FilesConsoleMsgTimer&&(clearTimeout(p13FilesConsoleMsgTimer),p13FilesConsoleMsgTimer=null)}var webRtcDesktop=null;function webRtcDesktopReset(){if(null!=webRtcDesktop){if(null!=webRtcDesktop.softdesktop&&(webRtcDesktop.softdesktop.Stop(),webRtcDesktop.softdesktop=null),null!=webRtcDesktop.webchannel){try{webRtcDesktop.webchannel.close()}catch(e){}webRtcDesktop.webchannel=null}if(null!=webRtcDesktop.webrtc){try{webRtcDesktop.webrtc.close()}catch(e){}webRtcDesktop.webrtc=null}webRtcDesktop=null,desktop&&desktop.m&&(desktop.m.hold(!1),Q("deskstatus").textContent=StatusStrs[desktop.State])}}function onDesktopStateChange(e,t){var n=t;3==n&&2==e.contype&&n++;var i=StatusStrs[n];switch(null!=desktop&&1==desktop.webRtcActive&&(i+=", WebRTC"),QH("deskstatus",i),t){case 0:null!=desktop.m.recordedData&&deskRecordSession(),desktop.Stop(),desktopNode=desktop=null,QV("DeskFocus",!1),QV("termdisplays",!1),QV("deskRecordIcon",!1),deskFocusBtn.value="Alles fokussieren",1==fullscreen&&deskToggleFull(),webRtcDesktopReset(),deskPreferedStickyDisplay=0;break;case 2:break;case 3:desktop&&1==desktop.serverIsRecording&&QV("deskRecordIcon",!0),desktop.startTime=new Date,null==updateSessionTimer&&(updateSessionTimer=setInterval(updateSessionTime,1e3))}updateDesktopButtons(),deskAdjust(),setTimeout(deskAdjust,50),updateMetadata(desktop,"deskmetadata")}function updateSessionTime(){var e="",t=0;desktop&&desktop.startTime?(desktop.latency&&0<=desktop.latency.current&&(e=format("{0} ms, ",desktop.latency.current)),t=Math.floor((new Date-desktop.startTime)/1e3),QH("DeskTimer",e+zeroPad(Math.floor(t/3600),2)+":"+zeroPad(Math.floor(t/60)%60,2)+":"+zeroPad(t%60,2))):QH("DeskTimer",""),t=0,terminal&&terminal.startTime?(terminal.latency&&0<=terminal.latency.current&&(e=format("{0} ms, ",terminal.latency.current)),t=Math.floor((new Date-terminal.startTime)/1e3),QH("TermTimer",e+zeroPad(Math.floor(t/3600),2)+":"+zeroPad(Math.floor(t/60)%60,2)+":"+zeroPad(t%60,2))):QH("TermTimer",""),null==desktop&&null==terminal&&(clearInterval(updateSessionTimer),updateSessionTimer=null)}function showDesktopSettings(){xxdialogMode||(applyDesktopSettings(),updateDesktopButtons(),setDialogMode(7,"Einstellungen des entfernten Desktops",3,showDesktopSettingsChanged))}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value,desktopsettings.showfocus=d7showfocus.checked,desktopsettings.showmouse=d7showcursor.checked,desktopsettings.quality=d7bitmapquality.value,desktopsettings.scaling=d7bitmapscaling.value,desktopsettings.framerate=d7framelimiter.value,desktopsettings.localkeymap=d7localKeyMap.checked,localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings)),applyDesktopSettings(),desktop&&(1==desktop.contype&&0!=desktop.State&&desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate),2==desktop.contype&&(0==desktopsettings.showfocus&&(desktop.m.focusmode=0,deskFocusBtn.value="Alles fokussieren"),0!=desktop.State&&(desktop.Stop(),setTimeout(function(){connectDesktop(null,2)},50))))}function applyDesktopSettings(){var e="",t=512&features?[90,80,70,60,50,40,30,20,10,5,1]:[60,50,40,30,20,10,5,1];for(var n in t)e+="<option value="+t[n]+">"+t[n]+"%</option>";QH("d7bitmapquality",e),d7desktopmode.value=desktopsettings.encoding,d7showfocus.checked=desktopsettings.showfocus,d7showcursor.checked=desktopsettings.showmouse,d7bitmapquality.value=40,0<=t.indexOf(parseInt(desktopsettings.quality))&&(d7bitmapquality.value=desktopsettings.quality),d7bitmapscaling.value=desktopsettings.scaling,desktopsettings.framerate?d7framelimiter.value=desktopsettings.framerate:d7framelimiter.value=100,desktopsettings.localkeymap&&(d7localKeyMap.checked=desktopsettings.localkeymap),QV("deskFocusBtn",null!=desktop&&2==desktop.contype&&0!=desktop.state&&desktopsettings.showfocus)}function enterBrowserFullscreen(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}function exitBrowserFullscreen(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}function isBrowserFullscreen(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}var fullscreen=!1,browserfullscreen=!1;function deskToggleFull(e){var t=!(0===args.xterm||null!=terminal&&null==xterm);if(fullscreen=!fullscreen)QC("body").add("fulldesk"),QS("deskarea3x").height="100%",QS("deskarea3x")["max-height"]="100%",t?(QS("termTable").position="absolute",QS("termTable").top=QS("termTable").bottom=QS("termTable").left=QS("termTable").right="0"):(QS("termTable").height="100%",QS("termTable")["max-height"]="100%"),1==e.shiftKey&&(enterBrowserFullscreen(Q("container")),browserfullscreen=!0);else{QC("body").remove("fulldesk");var n=args.hide;0==footerBar&&(n|=4);var i=(1&n?0:66)+(2&n?0:24)+(4&n?0:45)+(8&n?0:60);QS("deskarea3x").height="calc(100vh - "+(75+i)+"px)",QS("deskarea3x")["max-height"]="calc(100vh - "+(75+i)+"px)",t?(QS("termTable").position=null,QS("termTable").top=QS("termTable").bottom=QS("termTable").left=QS("termTable").right=null):(QS("termTable").height="calc(100vh - "+(75+i)+"px)",QS("termTable")["max-height"]="calc(100vh - "+(75+i)+"px)"),1==browserfullscreen&&(exitBrowserFullscreen(),browserfullscreen=!1)}deskAdjust(),updateDesktopButtons(),adjustPanels(),null!=xterm&&12==xxcurrentView&&(xtermfit.fit(),xterm.focus())}function deskToggleFocus(){desktop.m.focusmode=(desktop.m.focusmode+64)%192,Q("deskFocusBtn").value=["Alles fokussieren","Kleiner Fokus","Großer Fokus"][desktop.m.focusmode/64]}function deskAdjust(){var e=Q("DeskParent").clientHeight,t=Q("DeskParent").clientWidth,n=Q("Desk").height,i=Q("Desk").width;if(2==deskAspectRatio)QS("Desk")["margin-top"]=null,QS("Desk").height="100%",QS("Desk").width="100%",QS("DeskParent").overflow="hidden";else if(1==deskAspectRatio)QS("Desk")["margin-top"]="0px",QS("Desk").height=n+"px",QS("Desk").width=i+"px",QS("DeskParent").overflow="scroll";else{if(n/i<e/t){var o=n*t/i+"px";QS("Desk").height=o,QS("Desk").width="100%"}else{var r=i*e/n+"px";QS("Desk").height=webPageFullScreen||fullscreen?null:"100%",QS("Desk").width=r}QS("Desk")["margin-top"]=null,QS("DeskParent").overflow="hidden"}}function mdeskAdjust(e,t,n,i){if(e&&t&&n&&i)if("Desk"!=i.id){var o=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex],r=o.x+2,a=Q("xdevices").clientWidth-30,s=Math.floor(a/r);s=r+Math.floor((a-s*r)/s),o.y=o.y*(s/o.x),o.x=s;var l=o.y,d=o.x;0!=e.State&&(l=o.y,d=t/n*o.y),QS(i.id)["max-height"]=l+"px",QS(i.id)["max-width"]=d+"px",QS(i.id)["margin-top"]="0",QS(i.id)["margin-bottom"]="0"}else deskAdjust()}function deskSendKeys(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){var e=Q("deskkeys").value;0==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65364,1],[65364,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,40],[desktop.m.KeyAction.UP,40],[desktop.m.KeyAction.EXUP,91]]):1==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65362,1],[65362,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,38],[desktop.m.KeyAction.UP,38],[desktop.m.KeyAction.EXUP,91]]):2==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[108,1],[108,0],[65511,0]]):desktop.sendCtrlMsg('{"action":"lock"}'):3==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[109,1],[109,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91]]):4==e?2==desktop.contype?desktop.m.sendkey([[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.DOWN,16],[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91],[desktop.m.KeyAction.UP,16]]):5==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.EXUP,91]]):6==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[114,1],[114,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,82],[desktop.m.KeyAction.UP,82],[desktop.m.KeyAction.EXUP,91]]):7==e?2==desktop.contype?desktop.m.sendkey([[65513,1],[65473,1],[65473,0],[65513,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,18],[desktop.m.KeyAction.DOWN,115],[desktop.m.KeyAction.UP,115],[desktop.m.KeyAction.EXUP,18]]):8==e?2==desktop.contype?desktop.m.sendkey([[65507,1],[119,1],[119,0],[65507,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,17],[desktop.m.KeyAction.DOWN,87],[desktop.m.KeyAction.UP,87],[desktop.m.KeyAction.EXUP,17]]):9==e?2==desktop.contype?desktop.m.sendkey([[65513,1],[65289,1],[65289,0],[65513,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,18],[desktop.m.KeyAction.DOWN,9],[desktop.m.KeyAction.UP,9],[desktop.m.KeyAction.EXUP,18]]):10==e?desktop.m.sendcad():11==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65361,1],[65361,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,37],[desktop.m.KeyAction.UP,37],[desktop.m.KeyAction.EXUP,91]]):12==e&&(2==desktop.contype?desktop.m.sendkey([[65511,1],[65363,1],[65363,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,39],[desktop.m.KeyAction.UP,39],[desktop.m.KeyAction.EXUP,91]]))}}function showDeskType(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){Q("DeskType").blur();'<textarea id=d2typeText style="margin-top:5px;width:100%;height:184px;resize:none" maxlength=2000></textarea>',setDialogMode(2,"Entfernte Tastatureingabe",3,showDeskTypeEx,'<div>Geben Sie Text ein und klicken Sie auf OK, um ihn über eine US-englische Tastatur aus der Ferne einzugeben. Stellen Sie sicher, dass sich der Remote-Cursor an der richtigen Position befindet, bevor Sie fortfahren.<div><textarea id=d2typeText style="margin-top:5px;width:100%;height:184px;resize:none" maxlength=2000></textarea>'),Q("d2typeText").focus()}}var AmtDeskTypeTimer=null,AmtDeskTypeContent=null,DeskTypeTranslate={39:222,42:106,43:107,44:188,45:189,46:190,47:191,59:186,61:187,91:219,92:220,93:221,96:192,191:111},DeskTypeShiftTranslate={33:49,34:222,35:51,36:52,37:53,38:55,40:57,41:48,58:186,60:188,62:190,63:191,64:50,94:54,95:189,106:56,107:187,123:219,124:220,125:221,126:192};function showDeskTypeEx(){var e=Q("d2typeText").value,t=Q("d2typeText").value.toUpperCase(),n=[],i=!1;if(2==desktop.contype){for(var o in e){var r=e.charCodeAt(o);n.push([r,1],[r,0])}AmtDeskTypeContent=n,AmtDeskTypeTimer=setInterval(function(){var e=AmtDeskTypeContent.shift();desktop&&desktop.m.sendkey(e[0],e[1]),null!=desktop&&0!=AmtDeskTypeContent.length||(clearInterval(AmtDeskTypeTimer),AmtDeskTypeContent=null)},10)}else{for(var o in e){r=e.charCodeAt(o);var a=t.charCodeAt(o);65<=r&&r<=90||97<=r&&r<=122?(r==a&&0==i&&(n.push([desktop.m.KeyAction.DOWN,16]),i=!0),r!=a&&1==i&&(n.push([desktop.m.KeyAction.UP,16]),i=!1)):48<=r&&r<=57?1==i&&(n.push([desktop.m.KeyAction.UP,16]),i=!1):DeskTypeTranslate[r]?(1==i&&(n.push([desktop.m.KeyAction.UP,16]),i=!1),a=DeskTypeTranslate[r]):DeskTypeShiftTranslate[r]&&(0==i&&(n.push([desktop.m.KeyAction.DOWN,16]),i=!0),a=DeskTypeShiftTranslate[r]),n.push([desktop.m.KeyAction.DOWN,a],[desktop.m.KeyAction.UP,a])}1==i&&(n.push([desktop.m.KeyAction.UP,16]),i=!1),desktop.m.SendKeyMsgKC(n)}}function showDeskClip(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){Q("DeskClip").blur();'<input id=dlgClipGet type=button value="Get Clipboard" style=width:120px onclick=showDeskClipGet()>','<input id=dlgClipSet type=button value="Set Clipboard" style=width:120px onclick=showDeskClipSet()>','<div id=dlgClipStatus style="display:inline-block;margin-left:8px" ></div>','<textarea id=d2clipText style="width:100%;height:184px;resize:none" maxlength=65535></textarea>','<input type=button value="Close" style=width:80px;float:right onclick=dialogclose(0)><div style=height:26px;margin-top:3px><span id=linuxClipWarn style=display:none>Entfernte Zwischenablage ist für 60 Sekunden gültig.</span>&nbsp;</div><div></div>',setDialogMode(2,"Entfernte Zwischenablage",8,null,'<input id=dlgClipGet type=button value="Get Clipboard" style=width:120px onclick=showDeskClipGet()><input id=dlgClipSet type=button value="Set Clipboard" style=width:120px onclick=showDeskClipSet()><div id=dlgClipStatus style="display:inline-block;margin-left:8px" ></div><textarea id=d2clipText style="width:100%;height:184px;resize:none" maxlength=65535></textarea><input type=button value="Close" style=width:80px;float:right onclick=dialogclose(0)><div style=height:26px;margin-top:3px><span id=linuxClipWarn style=display:none>Entfernte Zwischenablage ist für 60 Sekunden gültig.</span>&nbsp;</div><div></div>',"clipboard"),Q("d2clipText").focus()}}function showDeskClipGet(){null!=desktop&&3==desktop.State&&meshserver.send({action:"msg",type:"getclip",nodeid:currentNode._id})}function showDeskClipSet(){null!=desktop&&3==desktop.State&&(meshserver.send({action:"msg",type:"setclip",nodeid:currentNode._id,data:Q("d2clipText").value}),QV("linuxClipWarn",currentNode&&currentNode.agent&&4<currentNode.agent.id&&21!=currentNode.agent.id&&22!=currentNode.agent.id))}function sendCAD(){xxdialogMode||null==desktop||3!=desktop.State||desktop.m.sendcad()}function toggleDeskTools(){xxdialogMode||("none"==QS("DeskTools").display?(QV("DeskTools",!0),Q("DeskTools").nodeid=currentNode._id,QH("DeskToolsProcesses",""),QH("DeskToolsServices",""),QV("deskToolsTopTabService",!1),changeDeskToolTab(0),refreshDeskTools(0),refreshDeskTools(1)):QV("DeskTools",!1))}var deskToolTabSelection=0;function changeDeskToolTab(e){QV("DeskToolsProcessTab",0==(deskToolTabSelection=e)),QV("DeskToolsServiceTab",1==e),QS("deskToolsTopTabProcess").bottom=0==e?"0px":"3px",QS("deskToolsTopTabService").bottom=1==e?"0px":"3px",QS("deskToolsTopTabProcess").color=0==e?"black":"gray",QS("deskToolsTopTabService").color=1==e?"black":"gray"}function refreshDeskTools(e){var t=null==e?deskToolTabSelection:e;QV("DeskToolsRefreshButton",!1),setTimeout(refreshDeskToolsEx,500),0==t&&meshserver.send({action:"msg",type:"ps",nodeid:currentNode._id}),1==t&&meshserver.send({action:"msg",type:"services",nodeid:currentNode._id})}function refreshDeskToolsEx(){QV("DeskToolsRefreshButton",!0)}var deskTools={sort:1,ssort:1,msg:null,smsg:null};function sortProcess(e){deskTools.sort=e,showDeskToolsProcesses(deskTools.msg)}function sortService(e){deskTools.ssort=e,showDeskToolsServices(deskTools.smsg)}function sortProcessPid(e,t){return e.p>t.p?1:e.p<t.p?-1:sortProcessName(e,t)}function sortProcessName(e,t){return e.d>t.d?1:e.d<t.d?-1:0}function showDeskToolsProcesses(e){if(null!=(deskTools.msg=e)){if(Q("DeskTools").nodeid==e.nodeid){var t=[],n=null;try{n=JSON.parse(e.value)}catch(e){}if(null!=n){for(var i in n)t.push({p:parseInt(i),c:n[i].cmd,d:n[i].cmd.toLowerCase(),u:n[i].user});0==deskTools.sort?t.sort(sortProcessPid):1==deskTools.sort&&t.sort(sortProcessName);var o="";for(var r in t)if(0!=t[r].p){var a=t[r].c;30<a.length&&(a='<span title="'+a+'">'+a.substring(0,30)+"...</span>"),o+="<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>"+t[r].p+'</div><a href=# style=float:right;padding-right:5px;cursor:pointer title="Prozess stoppen" onclick=\'return stopProcess('+t[r].p+',"'+t[r].c+'")\'><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>'+(t[r].u?t[r].u:"")+"</div><div>"+a+"</div></div>"}QH("DeskToolsProcesses",o)}}}else QH("DeskToolsProcesses","")}function showDeskToolsServices(e){if(null!=(deskTools.smsg=e)){if(Q("DeskTools").nodeid==e.nodeid){QV("deskToolsTopTabService",!0);var t=[],n=null;try{n=JSON.parse(e.value)}catch(e){}if(null!=(deskTools.services=n)){for(var i in n)n[i].status?t.push({p:capitalizeFirstLetter(n[i].status.state.toLowerCase()),d:n[i].displayName,i:i}):n[i].serviceType&&t.push({p:n[i].serviceType,d:n[i].name,i:i});0==deskTools.ssort?t.sort(sortProcessPid):1==deskTools.ssort&&t.sort(sortProcessName);var o="";for(var i in t)if(0!=t[i].p){var r=t[i].d;30<r.length&&(r='<span title="'+r+'">'+r.substring(0,30)+"...</span>"),o+="<div onclick=showServiceDetailsDialog("+t[i].i+") class=deskToolsBar><div style=width:70px;float:left;padding-right:5px>"+t[i].p+"</div><div>"+r+"</div></div>"}QH("DeskToolsServices",o)}}}else QH("DeskToolsProcesses","")}function showServiceDetailsDialog(e){if(!xxdialogMode){var t=deskTools.services[e];if(null!=t){var n="";if(t.name&&(n+=addHtmlValue("Name",t.name)),t.displayName&&(n+=addHtmlValue("Anzeigename",t.displayName)),t.status){t.status.state&&(n+=addHtmlValue("Zustand",capitalizeFirstLetter(t.status.state.toLowerCase()))),t.status.pid&&(n+=addHtmlValue("PID",t.status.pid));var i=[];!0===t.status.isFileSystemDriver&&i.push("Dateisystemtreiber"),!0===t.status.isInteractive&&i.push("Interaktiv"),!0===t.status.isKernelDriver&&i.push("Kernel-Treiber"),!0===t.status.isOwnProcess&&i.push("Eigener Prozess"),!0===t.status.isSharedProcess&&i.push("Geteilter Prozess"),0<i.length&&(n+=addHtmlValue("Tippen",i.join(", ")))}setDialogMode(2,"Dienst-Details",8,null,n+='<br/><div style=float:right;margin-bottom:12px><input type=button value="Schließen" onclick=showServiceDetailsDialogEx(0,'+e+')></div><div style=margin-bottom:12px><input type=button value="Start" onclick=showServiceDetailsDialogEx(1,'+e+')><input type=button value="Stop" onclick=showServiceDetailsDialogEx(2,'+e+')><input type=button value="Neustart" onclick=showServiceDetailsDialogEx(3,'+e+")></div>",name)}}}function showServiceDetailsDialogEx(e,t){if(setDialogMode(0),0!=e){var n=deskTools.services[t];null!=n&&(1==e&&meshserver.send({action:"msg",type:"serviceStart",nodeid:currentNode._id,serviceName:n.name}),2==e&&meshserver.send({action:"msg",type:"serviceStop",nodeid:currentNode._id,serviceName:n.name}),3==e&&meshserver.send({action:"msg",type:"serviceRestart",nodeid:currentNode._id,serviceName:n.name}),setTimeout(function(){refreshDeskTools(1)},1e3))}}function toggleKvmControl(){putstore("DeskControl",Q("DeskControl").checked?1:0),QS("DeskControlSpan").color=Q("DeskControl").checked?null:"red"}function deskRecordSession(){if(null!=desktop)if(null==desktop.m.recordedData)Q("DeskRecordButtonImage").src="images/icon-film-red.png",desktop.m.StartRecording();else{Q("DeskRecordButtonImage").src="images/icon-film.png";var e=new Date,t="DesktopSesion-"+currentNode.name+"-"+e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)+"-"+("0"+e.getHours()).slice(-2)+"-"+("0"+e.getMinutes()).slice(-2);saveAs(data2blob(desktop.m.StopRecording().join("")),t+".mcrec")}}function deskSaveImage(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){var e=new Date,t="Desktop-"+currentNode.name+"-"+e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)+"-"+("0"+e.getHours()).slice(-2)+"-"+("0"+e.getMinutes()).slice(-2);Q("Desk").toBlob(function(e){saveAs(e,t+".png")})}}function deskDisplayInfo(e,t,n){var i=0,o="";for(var r in t)i++,o+="<option"+(n==r?" selected":"")+" value="+r+">"+t[r]+"</option>",deskPreferedStickyDisplay==r&&n!=deskPreferedStickyDisplay&&desktop.m.SetDisplay(r),deskPreferedStickyDisplay=-1;QH("termdisplays",o),QV("termdisplays",1<i)}function deskGetDisplayNumbers(e){desktop.m.GetDisplayNumbers()}var deskPreferedStickyDisplay=-1;function deskSetDisplay(e){desktop.m.SetDisplay(deskPreferedStickyDisplay=parseInt(Q("termdisplays").value)),Q("termdisplays").blur()}var terminalNode,dblClickDetectArgs={t:0,x:0,y:0};function dblClickDetect(e){if(1==e.buttons){var t=Date.now();t-dblClickDetectArgs.t<250&&Math.abs(e.clientX-dblClickDetectArgs.x)<2&&Math.abs(e.clientY-dblClickDetectArgs.y)<2&&!xxdialogMode&&null!=desktop&&Q("DeskControl").checked&&(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousedblclick(e),desktop.m.sendKeepAlive()):desktop.m.mousedblclick(e)),dblClickDetectArgs.t=t,dblClickDetectArgs.x=e.clientX,dblClickDetectArgs.y=e.clientY}}function dmousedown(e){setSessionActivity(),e.addx=Q("DeskParent").scrollLeft,e.addy=Q("DeskParent").scrollTop,!xxdialogMode&&null!=desktop&&Q("DeskControl").checked&&(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousedown(e),desktop.m.sendKeepAlive()):desktop.m.mousedown(e)),dblClickDetect(e)}function dmouseup(e){setSessionActivity(),e.addx=Q("DeskParent").scrollLeft,e.addy=Q("DeskParent").scrollTop,!xxdialogMode&&null!=desktop&&Q("DeskControl").checked&&(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mouseup(e),desktop.m.sendKeepAlive()):desktop.m.mouseup(e))}function dmousemove(e){setSessionActivity(),e.addx=Q("DeskParent").scrollLeft,e.addy=Q("DeskParent").scrollTop,!xxdialogMode&&null!=desktop&&Q("DeskControl").checked&&(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousemove(e),desktop.m.sendKeepAlive()):desktop.m.mousemove(e))}function dmousewheel(e){return setSessionActivity(),e.addx=Q("DeskParent").scrollLeft,e.addy=Q("DeskParent").scrollTop,!(xxdialogMode||null==desktop||!Q("DeskControl").checked)&&(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousewheel(e),desktop.m.sendKeepAlive()):desktop.m.mousewheel&&desktop.m.mousewheel(e),haltEvent(e),!0)}function drotate(e){xxdialogMode||null==desktop||(desktop.m.setRotation(desktop.m.rotation+e),deskAdjust(),deskAdjust())}function stopProcess(e,t){return setDialogMode(2,"Prozesskontrolle",3,stopProcessEx,format('Prozess #{0} "{1}" beenden?',e,t),e),!1}function stopProcessEx(e,t){meshserver.send({action:"msg",type:"pskill",nodeid:currentNode._id,value:t}),setTimeout(refreshDeskTools,300)}function setupTerminal(){terminalNode!=currentNode&&null!=terminal&&(terminal.Stop(),terminal=null),terminalNode=currentNode,updateTerminalButtons()}function updateTerminalButtons(){meshes[terminalNode.meshid];var e=null!=terminal&&0!=terminal.state;QV("disconnectbutton2span",1==e),QV("connectbutton2span",0==e&&null!=currentNode.agent&&2&currentNode.agent.caps),QV("connectbutton2hspan",0==e&&null!=terminalNode.intelamt&&2==terminalNode.intelamt.state&&null!=terminalNode.intelamt.ver),QV("terminalSizeDropDown",0==e&&null!=terminalNode.intelamt&&2==terminalNode.intelamt.state&&null!=terminalNode.intelamt.ver);var t=0!=(1&terminalNode.conn);QE("connectbutton2",t);var n=0!=(6&terminalNode.conn);QE("connectbutton2h",n),QE("ctrlcbutton",e),QE("ctrlxbutton",e),QE("escbutton",e),QE("bsbutton",e),QE("pastebutton",e),QE("specialkeylist",e),QE("specialkeylistinput",e),QV("terminalSettingsButtons",terminal&&2==terminal.contype),terminal&&(Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation],Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation],Q("id_tcrbutton").value="\r\n"==terminal.m.lineFeed?"CR+LF":"LF");var i=!(0===args.xterm||null!=terminal&&null==xterm);QV("termarea3xdiv",i),QV("Term",!i),QV("bsbutton",!i),QV("pastebutton",!i),QV("devListToolbarViewIcons2",i),QE("termSizeList",null==terminal)}function onTerminalStateChange(e,t){var n=t;3==n&&2==e.contype&&n++;var i=StatusStrs[n];switch(1==terminal.webRtcActive&&(i+=", WebRTC"),QH("termstatus",i),t){case 0:QH("termtitle",""),QV("termRecordIcon",!1),null==xterm?(e.m.TermResetScreen(),e.m.TermDraw()):(xterm.dispose(),xterm=xtermfit=null),null!=terminal&&(terminal.Stop(),terminal=null);break;case 3:e&&1==e.serverIsRecording&&QV("termRecordIcon",!0),terminal.startTime=new Date,null==updateSessionTimer&&(updateSessionTimer=setInterval(updateSessionTime,1e3)),null!=xterm&&xterm.focus()}updateTerminalButtons()}var autoConnectTerminalTimer=null;function autoConnectTerminal(e){autoConnectTerminalTimer=null==autoConnectTerminalTimer?setInterval(connectTerminal,100):(clearInterval(autoConnectTerminalTimer),null)}function CreateRemoteTunnel(e,t){var n={protocol:1};return null!=t&&"number"==typeof t.protocol&&(n.protocol=t.protocol),n.onTunnelUpdate=e,n.xxStateChange=function(e){},n.ProcessBinaryData=function(e){n.onTunnelUpdate(e)},n.ProcessData=function(e){n.onTunnelUpdate(e)},n.terminalEmulation=1,n.fxEmulation=0,n.lineFeed="\r\n",n}function tunnelUpdate(e){"string"==typeof e?xterm.writeUtf8(e):xterm.writeUtf8(new Uint8Array(e))}function xTermSendResize(){(xtermResizeTimer=null)!=xterm&&null!=terminal&&null!=terminal.sendCtrlMsg&&terminal.sendCtrlMsg(JSON.stringify({ctrlChannel:"102938",type:"termsize",cols:xterm.cols,rows:xterm.rows}))}function connectTerminal(e,t,n){if(p12clearConsoleMsg(),terminal)terminal.Stop(),terminal=null,fullscreen&&deskToggleFull();else if(2==t){if(null==terminalNode.intelamt.user||""==terminalNode.intelamt.user)return void editDeviceAmtSettings(terminalNode._id,connectTerminal,2);var i={};1==Q("termSizeList").value?(i.cols=80,i.rows=25):2==Q("termSizeList").value&&(i.cols=100,i.rows=30),fullscreen&&deskToggleFull(),QV("termarea3xdiv",!1),QV("Term",!0),(terminal=CreateAmtRedirect(CreateAmtRemoteTerminal("Term",i),authCookie)).debugmode=debugmode,terminal.m.debugmode=debugmode,terminal.m.onTitleChange=function(e,t){QH("termtitle"," - "+EscapeHtml(t))},terminal.onStateChanged=onTerminalStateChange,terminal.Start(terminalNode._id,16994,"*","*",0),terminal.contype=2,Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation]}else{i={protocol:null!=n&&"number"==typeof n.protocol?n.protocol:1};n&&n.requireLogin&&(i.requireLogin=!0),-1==[1,2,3,4,21,22].indexOf(currentNode.agent.id)&&(1==Q("termSizeList").value?(i.cols=80,i.rows=25,i.xterm=!0):2==Q("termSizeList").value?(i.cols=100,i.rows=30,i.xterm=!0):3==Q("termSizeList").value&&(i.cols=Math.floor((Q("column_l").clientWidth-60)/10),i.rows=Math.floor((Q("column_l").clientHeight-120)/20),i.xterm=!0)),e&&1==e.shiftKey&&(4<currentNode.agent.id?1==i.protocol&&(i.protocol=7):1==i.protocol&&(i.protocol=6)),0!==args.xterm?(QV("termarea3xdiv",!0),QV("Term",!1),null!=xterm&&xterm.dispose(),xtermfit=new FitAddon.FitAddon,xterm=new Terminal,xtermfit&&xterm.loadAddon(xtermfit),xterm.open(Q("termarea3xdiv")),xterm.onData(function(e){null!=terminal&&terminal.sendText(e)}),xtermfit&&xtermfit.fit(),xterm.onTitleChange(function(e){QH("termtitle"," - "+EscapeHtml(e))}),xterm.onResize(function(e){xtermResizeTimer&&clearTimeout(xtermResizeTimer),xtermResizeTimer=setTimeout(xTermSendResize,200)}),(terminal=CreateAgentRedirect(meshserver,CreateRemoteTunnel(tunnelUpdate,n),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).debugmode=debugmode,terminal.m.debugmode=debugmode,terminal.options={cols:xterm.cols,rows:xterm.rows},n&&n.requireLogin&&(terminal.options.requireLogin=!0),terminal.Start(terminalNode._id),terminal.onStateChanged=onTerminalStateChange,terminal.contype=1,terminal.attemptWebRTC=!1,terminal.onConsoleMessageChange=function(e,t){terminal.consoleMessage?(Q("p12TermConsoleMsg").innerHTML+=formatAgentConsoleMessage(terminal.consoleMessage,terminal.consoleMessageId,terminal.consoleMessageArgs),QV("p12TermConsoleMsg",!0),null!=p12TermConsoleMsgTimer&&clearTimeout(p12TermConsoleMsgTimer),terminal.consoleMessageTimeout&&(p12TermConsoleMsgTimer=setTimeout(p12clearConsoleMsg,1e3*terminal.consoleMessageTimeout))):p12clearConsoleMsg()}):(QV("termarea3xdiv",!1),QV("Term",!0),(terminal=CreateAgentRedirect(meshserver,CreateAmtRemoteTerminal("Term",i),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).options=i,terminal.debugmode=debugmode,terminal.m.debugmode=debugmode,terminal.m.onTitleChange=function(e,t){QH("termtitle"," - "+EscapeHtml(t))},terminal.m.lineFeed=0<=[1,2,3,4,21,22].indexOf(currentNode.agent.id)?"\r\n":"\r",terminal.attemptWebRTC=!1,terminal.onStateChanged=onTerminalStateChange,terminal.onConsoleMessageChange=function(){terminal.consoleMessage?(Q("p12TermConsoleMsg").innerHTML+=formatAgentConsoleMessage(terminal.consoleMessage,terminal.consoleMessageId,terminal.consoleMessageArgs),QV("p12TermConsoleMsg",!0),null!=p12TermConsoleMsgTimer&&clearTimeout(p12TermConsoleMsgTimer),terminal.consoleMessageTimeout&&(p12TermConsoleMsgTimer=setTimeout(p12clearConsoleMsg,1e3*terminal.consoleMessageTimeout))):p12clearConsoleMsg()},terminal.Start(terminalNode._id),terminal.contype=1,terminal.m.terminalEmulation=0,terminal.m.fxEmulation=0,Q("id_ttypebutton").value=terminalEmulations[0])}Q("connectbutton2").blur()}var terminalEmulations=["UTF8-Terminal","Erweitertes ASCII","Intel ASCII"];function termToggleType(){terminal&&!xxdialogMode&&(terminal.m.terminalEmulation=(terminal.m.terminalEmulation+1)%3,Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation],Q("id_ttypebutton").blur())}var filesNode,fxEmulations=["Intel (F10 = ESC+[OM)","Alternativ (F10 = ESC+0)","VT100+ (F10 = ESC+[OY)"];function termToggleFx(){terminal&&!xxdialogMode&&(terminal.m.fxEmulation=(terminal.m.fxEmulation+1)%3,Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation],Q("id_tfxkeysbutton").blur())}function termToggleCr(){terminal&&!xxdialogMode&&("\n"==terminal.m.lineFeed?terminal.m.lineFeed="\r\n":terminal.m.lineFeed="\n",Q("id_tcrbutton").value="\r\n"==terminal.m.lineFeed?"CR+LF":"LF")}function termSendKey(e,t){terminal&&!xxdialogMode&&(null!=xterm?(terminal.sendText?terminal.sendText(String.fromCharCode(e)):terminal.send(String.fromCharCode(e)),xterm.focus()):null!=terminal&&(terminal.m.TermSendKey(e),Q(t).blur()))}function showTermPasteDialog(){terminal&&!xxdialogMode&&(Q("pastebutton").blur(),setDialogMode(2,"Einfügen",3,showTermPasteDialogEx,'<textarea id=d2pasteText style="width:100%;height:184px;resize:none"></textarea>'),Q("d2pasteText").focus())}function showTermPasteDialogEx(){terminal&&terminal.m.TermSendKeys(Q("d2pasteText").value)}function sendSpecialKey(){null!=xterm?(terminal.sendText(String.fromCharCode(Q("specialkeylist").value)),xterm.focus()):null!=terminal&&(terminal.m.TermSendKey(Q("specialkeylist").value),Q("specialkeylist").blur(),Q("specialkeylistinput").blur())}function setupFiles(){var e=filesNode==currentNode,t=0!=(1&(filesNode=currentNode).conn);QE("p13Connect",t),0!=e&&0!=t||!files||(files.Stop(),files=null)}function onFilesStateChange(e,t){p13Connect.value=0==t?"Verbinden":"Trennen";var n=StatusStrs[t];switch(1==files.webRtcActive&&(n+=", WebRTC"),Q("p13Status").textContent=n,t){case 0:QH("p13files",""),p13filetree=null,p13filetreelocation=[],QH("p13currentpath",""),QE("p13FolderUp",!1),QV("filesRecordIcon",!1),p13setActions(),null!=files&&(files.Stop(),files=null);break;case 3:p13targetpath="",files&&(files.sendText({action:"ls",reqid:1,path:""}),1==files.serverIsRecording&&QV("filesRecordIcon",!0))}}function CreateRemoteFiles(e){var t={protocol:5};return t.onFileUpdate=e,t.xxStateChange=function(e){},t.ProcessData=function(e){t.onFileUpdate(e)},t}var autoConnectFilesTimer=null;function autoConnectFiles(e){autoConnectFilesTimer=null==autoConnectFilesTimer?setInterval(connectFiles,100):(clearInterval(autoConnectFilesTimer),null)}function connectFiles(e){p13clearConsoleMsg(),files?(files.Stop(),files=null):((files=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).attemptWebRTC=attemptWebRTC,files.onStateChanged=onFilesStateChange,files.onConsoleMessageChange=function(){files.consoleMessage?(Q("p13FilesConsoleMsg").innerHTML+=formatAgentConsoleMessage(files.consoleMessage,files.consoleMessageId,files.consoleMessageArgs),QV("p13FilesConsoleMsg",!0),null!=p13FilesConsoleMsgTimer&&clearTimeout(p13FilesConsoleMsgTimer),files.consoleMessageTimeout&&(p13FilesConsoleMsgTimer=setTimeout(p13clearConsoleMsg,1e3*files.consoleMessageTimeout))):p13clearConsoleMsg()},files.Start(filesNode._id)),p13clipboard=p13clipboardFolder=null,p13clipboardCut=0,p13updateClipview()}var p13sortorder,p13filetree=null,p13targetpath=null,p13filetreelocation=[];function p13gotFiles(e){if(0<e.length&&123!=e.charCodeAt(0))p13gotDownloadBinaryData(e);else if("download"!=(e=JSON.parse(decode_utf8(e))).action)if(e.path=e.path.replace(/\//g,"\\"),null!=p13filetree&&e.path==p13filetree.path){var t=p13getCheckedNames();p13filetree=e,p13updateFiles(t)}else{for(var n=e.path.replace(/\//g,"\\"),i=p13targetpath.replace(/\//g,"\\");0<n.length&&"\\"==n[0];)n=n.substring(1);for(;0<i.length&&"\\"==i[0];)i=i.substring(1);(n==i||"\\"==e.path&&""==p13targetpath)&&(p13filetree=e,p13updateFiles())}else p13gotDownloadCommand(e)}function p13getCheckedNames(){for(var e=[],t=document.getElementsByName("fd"),n=0;n<t.length;n++)t[n].checked&&e.push(p13filetree.dir[t[n].value].n);return e}function p13updateFiles(e){var t="",n="",i='<a href=# style=cursor:pointer onclick="return p13folderup(0)">Wurzel</a>',o=p13filetree.path.split("\\");for(var r in p13filetreelocation=[],o)""!=o[r]&&p13filetreelocation.push(o[r]);for(var r in p13filetreelocation)i+=' / <a href=# style=cursor:pointer onclick="return p13folderup('+(parseInt(r)+1)+')">'+p13filetreelocation[r]+"</a>";var a=p13filetreelocation.join("/"),s=p13sort_files(p13filetree.dir);for(var r in s){var l,d=s[r],c=d.n;l=70<(l=c).length?'<span title="'+EscapeHtml(c)+'">'+EscapeHtml(c.substring(0,70))+"...</span>":EscapeHtml(c),c=EscapeHtml(c);var u="";if(null!=d.d)u=printDateTime(new Date(d.d))+"&nbsp;";var p="";null!=d.s&&(p=getFileSizeStr(d.s));var m="";if(d.t<3){m="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+'\'>&nbsp;<span style=float:right title=""></span><span><div class=fileIcon'+d.t+' onclick=p13folderset("'+encodeURIComponentEx(d.nx)+'")></div><a href=# style=cursor:pointer onclick=\'return p13folderset("'+encodeURIComponentEx(d.nx)+"\")'>"+l+"</a></span></div>"}else{var g=l;0<d.s&&(g="<a href=# style=cursor:pointer onclick=\"return p13downloadfile('"+encodeURIComponentEx(a+"/"+c)+"','"+encodeURIComponentEx(c)+"',"+d.s+')">'+l+"</a>"),m="<div id=fileEntry cmenu=filesContextMenu fileIndex="+r+" class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'>&nbsp;<span class=fsize>"+u+"</span><span style=float:right>"+p+"</span><span><div class=fileIcon"+d.t+"></div>"+g+"</span></div>"}d.t<3?t+=m:n+=m}if(QH("p13files",t+n),QH("p13currentpath",i),QE("p13FolderUp",0!=p13filetreelocation.length),null!=e){var h=document.getElementsByName("fd");for(r=0;r<h.length;r++)0<=e.indexOf(p13filetree.dir[h[r].value].n)&&(h[r].checked=!0)}p13setActions()}function p13folderset(e){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[e].n).split("\\").join("/"),files.sendText({action:"ls",reqid:1,path:p13targetpath})}function p13folderup(e){if(null==e)p13filetreelocation.pop();else for(;p13filetreelocation.length>e;)p13filetreelocation.pop();return p13targetpath=p13filetreelocation.join("/"),files.sendText({action:"ls",reqid:1,path:p13targetpath}),!1}function p13sort_filename(e,t){return e.ln>t.ln?1*p13sortorder:e.ln<t.ln?-1*p13sortorder:0}function p13sort_timestamp(e,t){return e.d>t.d?1*p13sortorder:e.d<t.d?-1*p13sortorder:0}function p13sort_bysize(e,t){return e.s==t.s?p13sort_filename(e,t):(e.s-t.s)*p13sortorder}function p13sort_files(e){var t=[],n=Q("p13sortdropdown").value;for(var i in e)e[i].nx=i,null==e[i].s&&(e[i].s=0),null==e[i].n&&(e[i].n=i),e[i].ln=e[i].n.toLowerCase(),t.push(e[i]);return p13sortorder=1,3<n&&(p13sortorder=-1,n-=3),1==n?t.sort(p13sort_filename):2==n?t.sort(p13sort_bysize):3==n&&t.sort(p13sort_timestamp),t}function p13setActions(){if(null==p13filetree)QE("p13DeleteFileButton",!1),QE("p13NewFolderButton",!1),QE("p13UploadButton",!1),QE("p13RenameFileButton",!1),QE("p13ViewFileButton",!1),QE("p13SelectAllButton",!1),Q("p13SelectAllButton").value="Alle auswählen",QE("p13RefreshButton",!1),QE("p13CutButton",!1),QE("p13CopyButton",!1),QE("p13PasteButton",!1);else{var e=p13getFileSelCount(),t=p13getFileCount(),n=p13getFileSelCount(!1),i=0<currentNode.agent.id&&currentNode.agent.id<5;QE("p13DeleteFileButton",0<e&&(0<p13filetreelocation.length||0==i)),QE("p13NewFolderButton",0<p13filetreelocation.length||0==i),QE("p13UploadButton",0<p13filetreelocation.length||0==i),QE("p13RenameFileButton",1==e&&(0<p13filetreelocation.length||0==i)),QE("p13ViewFileButton",1==e&&1==n&&(0<p13filetreelocation.length||0==i)),QE("p13SelectAllButton",0<t),Q("p13SelectAllButton").value=0<e?"Auswahl aufheben":"Alle auswählen",QE("p13RefreshButton",!0),QE("p13CutButton",0<e&&e==n&&(0<p13filetreelocation.length||0==i)),QE("p13CopyButton",0<e&&e==n&&(0<p13filetreelocation.length||0==i)),QE("p13PasteButton",(0<p13filetreelocation.length||0==i)&&null!=p13clipboard&&0<p13clipboard.length)}}function p13getFileSelCount(e){for(var t=0,n=document.getElementsByName("fd"),i=0;i<n.length;i++)!n[i].checked||0==e&&"3"!=n[i].attributes.file.value||t++;return t}function p13getFileSelDirCount(){for(var e=0,t=document.getElementsByName("fd"),n=0;n<t.length;n++)t[n].checked&&"999"==t[n].attributes.file.value&&e++;return e}function p13getFileCount(){return document.getElementsByName("fd").length}function p13selectallfile(){for(var e=0==p13getFileSelCount(),t=document.getElementsByName("fd"),n=0;n<t.length;n++)t[n].checked=e;p13setActions()}function p13createfolder(){setDialogMode(2,"Neuer Ordner",3,p13createfolderEx,"<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% />"),focusTextBox("p13renameinput"),p13fileNameCheck()}function p13createfolderEx(){files.sendText({action:"mkdir",reqid:1,path:p13filetreelocation.join("/")+"/"+Q("p13renameinput").value}),p13folderup(999)}function p13deletefile(){var e=p13getFileSelCount(),t=0<p13getFileSelDirCount()?"<br /><br /><label><input type=checkbox id=p13recdeleteinput>Rekursiv Löschen</label><br>":"<input type=checkbox id=p13recdeleteinput style='display:none'>";setDialogMode(2,"Löschen",3,p13deletefileEx,1<e?format("{0} ausgewählte Elemente löschen?",e)+t:"Ausgewähltes Element löschen?"+t)}function p13deletefileEx(){for(var e=[],t=document.getElementsByName("fd"),n=0;n<t.length;n++)t[n].checked&&e.push(p13filetree.dir[t[n].value].n);files.sendText({action:"rm",reqid:1,path:p13filetreelocation.join("/"),delfiles:e,rec:Q("p13recdeleteinput").checked}),p13folderup(999)}function p13renamefile(){for(var e,t=document.getElementsByName("fd"),n=0;n<t.length;n++)t[n].checked&&(e=p13filetree.dir[t[n].value].n);setDialogMode(2,"Umbenennen",3,p13renamefileEx,'<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% value="'+e+'" />',{action:"rename",path:p13filetreelocation.join("/"),oldname:e}),focusTextBox("p13renameinput"),p13fileNameCheck()}function p13renamefileEx(e,t){t.newname=Q("p13renameinput").value,files.sendText(t),p13folderup(999)}function p13fileNameCheck(e){var t=isFilenameValid(Q("p13renameinput").value);QE("idx_dlgOkButton",t),1==t&&null!=e&&13==e.keyCode&&dialogclose(1)}function p13uploadFile(){setDialogMode(2,"Datei hochladen",3,p13uploadFileEx,"<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange=\"updateUploadDialogOk('p13uploadinput')\" />"),updateUploadDialogOk("p13uploadinput")}function updateUploadDialogOk(e){QE("idx_dlgOkButton",0<Q("p13uploadinput").files.length)}function p13uploadFileEx(){p13doUploadFiles(Q("p13uploadinput").files)}function p13viewfile(){for(var e=document.getElementsByName("fd"),t=0;t<e.length;t++)if(e[t].checked){p13filetree.dir[e[t].value].s<=204800?p13downloadfile(encodeURIComponentEx(p13filetreelocation.join("/")+"/"+p13filetree.dir[e[t].value].n),encodeURIComponentEx(p13filetree.dir[e[t].value].n),p13filetree.dir[e[t].value].s,"viewer"):messagebox("Datei-Editor","Nur Dateien kleiner als 200 kB können bearbeitet werden.");break}}var p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;function p13copyFile(e){var t=document.getElementsByName("fd");p13clipboard=[],p13clipboardCut=e,p13clipboardFolder=p13targetpath;for(var n=0;n<t.length;n++)t[n].checked&&"3"==t[n].attributes.file.value&&p13clipboard.push(p13filetree.dir[t[n].value].n);p13updateClipview()}function p13pasteFile(){var e="";null!=p13clipboard&&0<p13clipboard.length&&(e=0==p13clipboardCut?1<p13clipboard.length?format("Bestätigen Sie das Kopieren von {0} Einträgen an diesen Ort?",p13clipboard.length):format("Bestätigen Sie das Kopieren von 1 Eintrag an diesen Ort?"):1<p13clipboard.length?format("Bestätigen Sie das Verschieben von {0} Einträgen an diesen Ort?",p13clipboard.length):format("Bestätigen Sie das Verschieben von 1 Eintrag an diesen Ort?")),setDialogMode(2,"Einfügen",3,p13pasteFileEx,e)}function p13pasteFileEx(){files.sendText({action:0==p13clipboardCut?"copy":"move",reqid:1,scpath:p13clipboardFolder,dspath:p13targetpath,names:p13clipboard}),p13folderup(999),1==p13clipboardCut&&(p13clipboardFolder=p13clipboard=null,p13clipboardCut=0,p13updateClipview())}function p13updateClipview(){var e="";null!=p13clipboard&&0<p13clipboard.length&&(e=0==p13clipboardCut?1<p13clipboard.length?format('Halte {0} Einträge zum Kopieren, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Leeren</a>.',p13clipboard.length):format('Halte 1 Eintrag zum Kopieren, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Leeren</a>.'):1<p13clipboard.length?format('Halte {0} Einträge zum Verschieben, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Leeren</a>.',p13clipboard.length):format('Halte 1 Eintrag zum Verschieben, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Leeren</a>.')),QH("p13bottomstatus",e),p13setActions()}function p13clearClip(){return p13clipboardFolder=p13clipboard=null,p13clipboardCut=0,p13updateClipview(),!1}function p13fileDragDrop(e){if(haltEvent(e),QV("p13bigfail",!1),QV("p13bigok",!1),null!=e.dataTransfer&&0!=e.dataTransfer.files.length&&null!=p13filetree){var t=[];for(var n in e.dataTransfer.files)null!=e.dataTransfer.files[n].size&&0!=e.dataTransfer.files[n].size&&t.push(e.dataTransfer.files[n]);0!=t.length&&p13doUploadFiles(t)}}var downloadFile,p13dragtimer=null;function p13fileDragOver(e){haltEvent(e),null!=p13dragtimer&&(clearTimeout(p13dragtimer),p13dragtimer=null);var t=null!=p13filetree;QV("p13bigok",t),QV("p13bigfail",!t)}function p13fileDragLeave(e){haltEvent(e),"p13filetable"!=e.target.id?(QV("p13bigfail",!1),QV("p13bigok",!1)):p13dragtimer=setTimeout(function(){QV("p13bigfail",!1),QV("p13bigok",!1),p13dragtimer=null},10)}function p13downloadfile(e,t,n,i){xxdialogMode||downloadFile||!files||(downloadFile={path:decodeURIComponent(e),file:decodeURIComponent(t),size:n,tsize:0,data:"",state:0,id:Math.random(),tag:i},files.sendText({action:"download",sub:"start",id:downloadFile.id,path:downloadFile.path}),setDialogMode(2,"Datei herunterladen",10,p13downloadFileCancel,"<div>"+downloadFile.file+"</div><br /><progress id=d2progressBar style=width:100% value=0 max="+n+" />"))}function p13downloadFileCancel(){setDialogMode(0),files.sendText({action:"download",sub:"cancel",id:downloadFile.id}),downloadFile=null}function p13gotDownloadCommand(e){null!=downloadFile&&e.id==downloadFile.id&&("start"==e.sub?(downloadFile.state=1,files.sendText({action:"download",sub:"startack",id:downloadFile.id})):"cancel"==e.sub&&(downloadFile=null,setDialogMode(0)))}function p13gotDownloadBinaryData(e){downloadFile&&0!=downloadFile.state&&(4<e.length&&(downloadFile.tsize+=e.length-4,downloadFile.data+=e.substring(4),Q("d2progressBar").value=downloadFile.tsize),0!=(1&ReadInt(e,0))?"viewer"==downloadFile.tag?(setDialogMode(4,EscapeHtml(downloadFile.file),3,p13editSaveBack,null,downloadFile.file),QS("dialog").width="auto",QS("dialog").bottom="80px",QS("dialog").top=QS("dialog").left=QS("dialog").right="100px",Q("d4editorarea").value=downloadFile.data,downloadFile=null):(saveAs(data2blob(downloadFile.data),downloadFile.file),downloadFile=null,setDialogMode(0)):files.sendText({action:"download",sub:"ack",id:downloadFile.id}))}var uploadFile,d4EditWrapVal=0,d4EditSizeVal=0;function d4ToggleWrap(e){e||(d4EditWrapVal=++d4EditWrapVal%2),Q("d4WrapButton").value=["Umbruch: an","Umbruch: aus"][d4EditWrapVal],QS("d4editorarea").overflow=0==d4EditWrapVal?"auto":"scroll",QS("d4editorarea")["white-space"]=0==d4EditWrapVal?null:"pre",putstore("editorWrap",d4EditWrapVal)}function d4ToggleSize(e){e||(d4EditSizeVal=++d4EditSizeVal%4),QS("d4editorarea")["font-size"]=["100%","125%","150%","200%"][d4EditSizeVal],Q("d4SizeButton").value=["Größe: 100%","Größe: 125%","Größe: 150%","Größe: 200%"][d4EditSizeVal],putstore("editorSize",d4EditSizeVal)}function p13editSaveBack(e,t){var n=(new TextEncoder).encode(Q("d4editorarea").value);p13uploadFileContinue(1,[{name:t,size:n.byteLength,type:"text/plain",xdata:n}])}function p13doUploadFiles(e){if(!xxdialogMode){var t=0<currentNode.agent.id&&currentNode.agent.id<5,n=[],i=0;for(var o in p13filetree.dir)t?n.push(p13filetree.dir[o].n.toLowerCase()):n.push(p13filetree.dir[o].n);for(o=0;o<e.length;o++)t?0<=n.indexOf(e[o].name.toLowerCase())&&i++:0<=n.indexOf(e[o].name)&&i++;0==i?p13uploadFileContinue(1,e):setDialogMode(2,"Datei hochladen",3,p13uploadFileContinue,format(1==i?"Das Hochladen wird 1 Datei überschreiben. Fortfahren?":"Das Hochladen wird {0} Dateien überschreiben. Fortfahren?",i),e)}}function p13uploadFileContinue(e,t){(uploadFile={}).xpath=p13filetreelocation.join("/"),uploadFile.xfiles=t,uploadFile.xfilePtr=-1,setDialogMode(2,"Datei hochladen",10,p13uploadFileCancel,"<div id=p13dfileName>Verbinden...</div><br /><progress id=d2progressBar style=width:100% value=0 max=0 />"),p13uploadReconnect()}function onFileUploadStateChange(e,t){switch(t){case 0:setTimeout(function(){p13folderup(9999)},200);break;case 3:p13uploadNextFile()}}function p13uploadReconnect(){uploadFile.ws=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotUploadData),serverPublicNamePort,authCookie,authRelayCookie,domainUrl),uploadFile.ws.attemptWebRTC=!1,uploadFile.ws.ctrlMsgAllowed=!1,uploadFile.ws.onStateChanged=onFileUploadStateChange,uploadFile.ws.Start(filesNode._id)}function p13uploadNextFile(){if(uploadFile.xfilePtr++,uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var e=uploadFile.xfiles[uploadFile.xfilePtr];QH("p13dfileName",e.name),Q("d2progressBar").max=e.size,Q("d2progressBar").value=0,null==e.xdata?(uploadFile.xreader=new FileReader,uploadFile.xreader.onload=function(){uploadFile.xdata=uploadFile.xreader.result,uploadFile.ws.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:e.name,size:uploadFile.xdata.byteLength}))},uploadFile.xreader.readAsArrayBuffer(e)):(uploadFile.xdata=e.xdata,uploadFile.ws.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:e.name,size:uploadFile.xdata.byteLength})))}else p13uploadFileCancel()}function p13uploadFileCancel(e,t){null!=uploadFile&&(null!=uploadFile.ws&&(uploadFile.ws.Stop(),uploadFile.ws=null),uploadFile=null),setDialogMode(0)}function p13gotUploadData(e){var t=JSON.parse(e);if(null!=uploadFile&&parseInt(uploadFile.xfilePtr)==parseInt(t.reqid))if("uploadstart"==t.action){p13uploadNextPart(!1);for(var n=0;n<8;n++)p13uploadNextPart(!0)}else"uploadack"==t.action?p13uploadNextPart(!1):"uploaderror"==t.action&&p13uploadFileCancel()}function p13uploadNextPart(e){var t=uploadFile.xdata,n=uploadFile.xptr,i=uploadFile.xptr+4096;if(i>t.byteLength){if(1==e)return;i=t.byteLength}if(n==t.byteLength)null!=uploadFile.ws&&(uploadFile.ws.Stop(),uploadFile.ws=null),uploadFile.xfiles.length>uploadFile.xfilePtr+1?p13uploadReconnect():p13uploadFileCancel();else{var o=t.slice(n,i);uploadFile.ws.send(o),uploadFile.xptr=i,Q("d2progressBar").value=i}}var currentDeviceEvents=null;function deviceEventsUpdate(){var e="",t=null;for(var n in currentDeviceEvents){var i=currentDeviceEvents[n],o=new Date(i.time);if(i.msg){null==i.h&&(i.h=Math.random()),printDate(o)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(o))+"</td></tr>");var r="si3";"user"==i.etype&&(r="m2"),"server"==i.etype&&(r="si3");var a=EscapeHtml(i.msg).split("(R)").join("&reg;");i.username&&(a=2&userinfo.siteadmin&&i.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(i.userid)+"\");haltEvent(event);'>"+EscapeHtml(i.username)+"</a> &rarr; "+a:EscapeHtml(i.username)+" &rarr; "+a),"relay"!=i.etype&&"relaylog"!=i.action||(r="relayIcon16"),e+="<tr onclick=showEventDetails("+i.h+",1) onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+r+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(o)+" - "+a+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>Keine Ereignisse vorhanden</i><br><br>"),QH("p16events",e)}function refreshDeviceEvents(){meshserver.send({action:"events",nodeid:currentNode._id,limit:parseInt(p16limitdropdown.value)})}function showEventDetails(e,t){var n,i;for(var o in 1==t&&(n=currentDeviceEvents),2==t&&(n=events),3==t&&(n=currentUserEvents),n)if(n[o].h==e){i=n[o];break}if(i){if(xxdialogMode)return!1;var r="<div style=overflow-y:auto>";for(var o in i)"h"!=o&&"_id"!=o&&"ids"!=o&&"domain"!=o&&null!=i[o]&&"object"!=typeof i[o]&&(r+=addHtmlValue3(EscapeHtml(o),EscapeHtml(i[o])));setDialogMode(2,"Ereignisdetails",9,null,r+="</div>")}}var consoleNode,DeviceDetailsHardware=null,DeviceDetailsNetwork=null,DeviceDetailsNodeId=null;function updateDeviceDetails(e,t,n){if(null!=currentNode&&(null==e&&(e=currentNode),currentNode._id==e._id)){DeviceDetailsNodeId!=e._id&&(DeviceDetailsNetwork=DeviceDetailsHardware=null,DeviceDetailsNodeId=e._id),null!=t&&(DeviceDetailsHardware=t),null!=n&&(DeviceDetailsNetwork=n),null==(t=DeviceDetailsHardware)&&(t={}),null==(n=DeviceDetailsNetwork)&&(n={});var i=[],o={};if(t.windows&&t.windows.osinfo||e.osdesc){var r="";if(e.rname&&(r+=addDetailItem("Name",EscapeHtml(e.rname),o)),e.osdesc&&(r+=addDetailItem("Version",EscapeHtml(e.osdesc),o)),t.windows&&t.windows.osinfo)(d=t.windows.osinfo).OSArchitecture&&(r+=addDetailItem("Architektur",EscapeHtml(d.OSArchitecture),o));""!=r&&i.push({name:"Betriebssystem",html:r,img:"software64.png"})}if(e.agent){r="";if(null!=e.agent&&null!=e.agent.id&&null!=e.agent.ver){var a="";a=e.agent.id<=agentsStr.length?agentsStr[e.agent.id]:agentsStr[0],0!=e.agent.ver&&(a+=" v"+e.agent.ver),r+=addDetailItem("Mesh-Agent",a)}if(0!=(1&e.conn)?r+=addDetailItem("Letzte Agenten-Verbindung","Jetzt verbunden"):e.lastconnect&&(r+=addDetailItem("Letzte Agenten-Verbindung",printDateTime(new Date(e.lastconnect)))),e.lastaddr){var s=e.lastaddr.split(":");2<s.length?r+=addDetailItem("Letzte Agenten-Adresse",e.lastaddr):isPrivateIP(e.lastaddr)?r+=addDetailItem("Letzte Agenten-Adresse",s[0]):r+=addDetailItem("Letzte Agenten-Adresse",'<a href="https://iplocation.com/?ip='+s[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+s[0]+"</a>")}""!=r&&i.push({name:"Mesh-Agent",html:r,img:"meshagent64.png"})}if(null!=n.netif){r="";for(var l in r+="<table style=width:100%>",n.netif){var d=n.netif[l];r+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",r+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.name+(d.dnssuffix?", "+d.dnssuffix:""))+"</b></div>",d.desc&&(r+=addDetailItem("Beschreibung",EscapeHtml(d.desc).split("(R)").join("&reg;"))),d.mac&&(d.gatewaymac?r+=addDetailItem("MAC-Schicht",format("MAC: {0}, Gateway: {1}",EscapeHtml(d.mac),EscapeHtml(d.gatewaymac))):r+=addDetailItem("MAC-Schicht",format("MAC: {0}",d.mac))),d.v4addr&&"0.0.0.0"!=d.v4addr&&(d.v4gateway&&d.v4mask?r+=addDetailItem("IPv4-Schicht",format("IP: {0}, Maske: {1}, Gateway: {2}",EscapeHtml(d.v4addr),EscapeHtml(d.v4mask),EscapeHtml(d.v4gateway))):r+=addDetailItem("IPv4-Schicht",format("IP: {0}",EscapeHtml(d.v4addr)))),r+="</div>"}""!=(r+="</table>")&&i.push({name:"Vernetzung",html:r,img:"networking64.png"})}if(null!=e.intelamt){r="";r+=addDetailItem("Version",e.intelamt.ver?"v"+e.intelamt.ver:"<i>Unbekannt</i>",o);var c={0:nobreak("Nicht aktiviert (Pre)"),1:nobreak("Nicht aktiviert (In)"),2:nobreak("Aktiviert")},u="";2==e.intelamt.state&&e.intelamt.flags&&(2&e.intelamt.flags?u=", Client Control Mode (CCM)":4&e.intelamt.flags&&(u=", Admin Control Mode (ACM)")),r+=addDetailItem("Bereitstellungsstaat",(e.intelamt.state?c[e.intelamt.state]:"<i>Unbekannt</i>")+u,o),r+=addDetailItem("Sicherheit",1==e.intelamt.tls?"Mit TLS gesichert":"TLS ist nicht eingerichtet",o),""!=(r+=addDetailItem("Administrator-Anmeldeinformationen",null==e.intelamt.user||""==e.intelamt.user?"Nicht bekannt":"Bekannt",o))&&i.push({name:"Intel&reg; Active Management Technology (Intel&reg; AMT)",html:r,img:"amt64.png"})}if(t.identifiers){r="";var p=t.identifiers;if(p.bios_vendor&&(r+=addDetailItem("Hersteller",EscapeHtml(p.bios_vendor),o)),p.bios_version&&(r+=addDetailItem("Version",EscapeHtml(p.bios_version),o)),""!=r&&i.push({name:"BIOS",html:r,img:"chip64.png"}),r="",p.board_vendor&&(r+=addDetailItem("Hersteller",EscapeHtml(p.board_vendor),o)),p.board_name&&(r+=addDetailItem("Name",EscapeHtml(p.board_name),o)),p.board_serial&&""!=p.board_serial&&(r+=addDetailItem("Seriennummer",EscapeHtml(p.board_serial),o)),p.board_version&&(r+=addDetailItem("Version",EscapeHtml(p.board_version),o)),p.product_uuid&&(r+=addDetailItem("Kennung",EscapeHtml(p.product_uuid),o)),p.cpu_name&&(r+=addDetailItem("CPU",EscapeHtml(p.cpu_name).split("(TM)").join("&trade;").split("(R)").join("&reg;"),o)),p.gpu_name)for(var l in p.gpu_name)r+=addDetailItem("GPU",EscapeHtml(p.gpu_name[l]).split("(TM)").join("&trade;").split("(R)").join("&reg;"),o);""!=r&&i.push({name:"Hauptplatine",html:r,img:"motherboard64.png"})}if(t.windows&&t.windows.memory){r="";for(var l in t.windows.memory.sort(function(e,t){return e.BankLabel>t.BankLabel?1:e.BankLabel<t.BankLabel?-1:0}),r+="<table style=width:100%>",t.windows.memory){d=t.windows.memory[l];r+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",r+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.BankLabel)+"</b></div>",d.Capacity&&(r+=addDetailItem("Kapazität / Geschwindigkeit",format("{0} MB, {1} MHz",d.Capacity/1024/1024,d.Speed),o)),d.PartNumber&&(r+=addDetailItem("Teilenummer",EscapeHtml(d.Manufacturer&&"Undefined"!=d.Manufacturer?d.Manufacturer+", ":"")+EscapeHtml(d.PartNumber),o)),r+="</div>"}""!=(r+="</table>")&&i.push({name:"Speicher",html:r,img:"ram64.png"})}if(t.identifiers&&p.storage_devices){r="";for(var l in p.storage_devices.sort(function(e,t){return e.Caption>t.Caption?1:e.Caption<t.Caption?-1:0}),r+="<table style=width:100%>",p.storage_devices){(d=p.storage_devices[l]).Size&&(r+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",r+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.Caption)+"</b></div>",d.Model&&d.Model!=d.Caption&&(r+=addDetailItem("Model",EscapeHtml(d.Model),o)),d.Size&&("string"==typeof d.Size&&parseInt(d.Size)==d.Size&&(d.Size=parseInt(d.Size)),"number"==typeof d.Size&&(r+=addDetailItem("Capacity",format("{0} MB",Math.floor(d.Size/1024/1024)),o)),"string"==typeof d.Size&&(r+=addDetailItem("Capacity",EscapeHtml(d.Size),o))),r+="</div>")}""!=(r+="</table>")&&i.push({name:"Storage",html:r,img:"storage64.png"})}r="";for(var l in i)null==i[l].img?r+="<div class=DevSt style=margin-bottom:3px;margin-left:16px><b>"+i[l].name+"</b></div><div style=margin-bottom:10px;margin-left:16px>"+i[l].html+"</div>":(r+="<table style=width:100%><tr>",r+="<td style=width:64px;vertical-align:top><img src=images/details/"+i[l].img+" border=0 width=64 /></td>",r+="<td><div class=DevSt style=margin-bottom:3px;margin-left:16px><b>"+i[l].name+"</b></div><div style=margin-bottom:10px;margin-left:16px>"+i[l].html+"</div></td>",r+="</tr></table>");""==r?QH("p17info","Keine Informationen zu diesem Gerät."):QH("p17info",r)}}function agentConsoleHandleKeys(e){if(e.ctrlKey||e.altKey)return!0;var t=0,n=Q("p15consoleText");if(e.key)if(13==e.keyCode&&0==consoleFocus)p15consoleSend(e),t=1;else if(8==e.keyCode&&0==consoleFocus){var i=n.value;n.value=i.substring(0,i.length-1),t=1}else if(27==e.keyCode)n.value="",t=1;else if(38==e.keyCode||40==e.keyCode){var o=consoleHistory.indexOf(n.value);38==e.keyCode&&consoleHistory.length-1>o?n.value=consoleHistory[o+1]:40==e.keyCode&&0<o?n.value=consoleHistory[o-1]:40==e.keyCode&&0==o&&(n.value=""),t=1}else 1===e.key.length&&(insertTextAtCursor(n,e.key),t=1);else 0!=e.charCode&&0==consoleFocus&&(n.value=n.value+String.fromCharCode(e.charCode),t=1);return 0<t?haltEvent(e):void 0}function insertTextAtCursor(e,t){if(document.selection)e.focus(),sel=document.selection.createRange(),sel.text=t;else if(e.selectionStart||"0"==e.selectionStart){var n=e.selectionStart,i=e.selectionEnd;e.value=e.value.substring(0,n)+t+e.value.substring(i,e.value.length),e.setSelectionRange(i+1,i+1)}else e.value+=myValue}var consoleServerText="";function setupConsole(){if(115==xxcurrentView){var e="server"==consoleNode;consoleNode="server",QH("p15deviceName","Meine Server-Konsole"),QE("p15consoleText",!0),QH("p15statetext",""),QH("p15coreName",""),QV("p15outputselecttd",!1),0==e&&(QH("p15agentConsoleText",consoleServerText),Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight)}else{e=consoleNode==currentNode,meshes[(consoleNode=currentNode).meshid];if(0!=(16&GetNodeRights(currentNode))){null==consoleNode.consoleText&&(consoleNode.consoleText=""),0==e&&(QH("p15agentConsoleText",consoleNode.consoleText),Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight);var t=0!=(1&consoleNode.conn)||0!=(16&consoleNode.conn),n=0!=(1&consoleNode.conn)?"Agent ist online":"Agent ist offline";0!=(16&consoleNode.conn)&&(n+=", MQTT ist verbunden"),QH("p15statetext",n),QE("p15consoleText",t),QE("p15uploadCore",0!=(1&consoleNode.conn)),QV("p15outputselecttd",17==(17&consoleNode.conn))}else QH("p15statetext","Zugriff verweigert"),QE("p15consoleText",!1),QE("p15uploadCore",!1),QV("p15outputselecttd",!1)}}function p15consoleClear(){QH("p15agentConsoleText",""),Q("id_p15consoleClear").blur(),115==xxcurrentView?consoleServerText="":consoleNode.consoleText=""}var consoleHistory=[];function p15consoleSend(e){if(!e||13==e.keyCode){var t=Q("p15consoleText").value,n="<div style=color:green>&gt; "+EscapeHtml(t)+"<br/></div>";if(115==xxcurrentView?(consoleServerText+=n,meshserver.send({action:"serverconsole",value:t})):0==(16&consoleNode.conn)||2!=Q("p15outputselect").value&&0!=(1&consoleNode.conn)?(consoleNode.consoleText+=n,meshserver.send({action:"msg",type:"console",nodeid:consoleNode._id,value:t})):(n="<div style=color:orange>MQTT&gt; "+EscapeHtml(t)+"<br/></div>",consoleNode.consoleText+=n,meshserver.send({action:"sendmqttmsg",topic:"console",nodeids:[consoleNode._id],msg:t})),Q("p15agentConsoleText").innerHTML+=n,Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight,Q("p15consoleText").value="",0<t.length){var i=consoleHistory.indexOf(t);0<=i&&consoleHistory.splice(i,1),consoleHistory.unshift(t),consoleHistory.splice(10)}}}function p15consoleReceive(e,t,n){"serverconsole"===e?(t="<div>"+EscapeHtml(t)+"</div>",consoleServerText+=t,"server"==consoleNode&&(Q("p15agentConsoleText").innerHTML+=t,Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight)):(t="MQTT"==n?"<div style=color:red>MQTT&gt; "+EscapeHtml(t)+"<br/></div>":"<div>"+EscapeHtml(t)+"</div>",null==e.consoleText?e.consoleText=t:e.consoleText+=t,consoleNode==e&&(Q("p15agentConsoleText").innerHTML+=t,Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight))}function p15downloadConsoleText(){saveAs(new Blob([Q("p15agentConsoleText").innerText],{type:"application/octet-stream"}),"console.txt")}function p15uploadCore(e){xxdialogMode||(1==e.shiftKey?meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"}):1==e.altKey?meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"}):1==e.ctrlKey?p15uploadCore2():setDialogMode(2,"Agenten-Aktion durchführen",3,p15uploadCoreEx,addHtmlValue("Aktion","<select id=d3coreMode style=width:230px><option value=1>Vorgabe-Serverkern hochladen</option><option value=2>Den Kern löschen</option><option value=6>Wiederherstellungkern hochladen</option><option value=3>Kern-Datei hochladen</option><option value=4>Agenten sanft trennen</option><option value=5>Agenten hart trennen</option></select>")))}function p15uploadCoreEx(){1==Q("d3coreMode").value?meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"}):2==Q("d3coreMode").value?meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"}):3==Q("d3coreMode").value?p15uploadCore2():4==Q("d3coreMode").value?meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:1}):5==Q("d3coreMode").value?meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:2}):6==Q("d3coreMode").value&&meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"recovery"})}function p15uploadCore2(){xxdialogMode||(Q("d3localmodeform").action="uploadmeshcorefile.ashx",Q("d3auth").value=authCookie,Q("d3attrib").value=currentNode._id,setDialogMode(3,"Mesh-Agent-Kern hochladen",3,p15uploadCoreEx2),d3init())}function p15uploadCoreEx2(){if(1==Q("d3uploadMode").value)Q("d3submit").click();else{var e=d3getFileSel();1==e.length&&meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"custom",path:d3filetreelocation.join("/")+"/"+e[0]})}}function account_managePhone(){var e;xxdialogMode||0==(33554432&features)||(null!=userinfo.phone?(e='<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>',e+="<td style=text-align:center><div style=padding:6px>Verified phone number</div><div style=font-size:20px>"+userinfo.phone+"</div>",setDialogMode(2,"Phone Notifications",3,account_managePhoneRemove,e+="<div style=margin:10px><label><input id=d2delPhone type=checkbox onclick=account_managePhoneRemoveValidate() />Remove phone number</label></div>"),account_managePhoneRemoveValidate()):(e='<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>',e+="<td>Enter your SMS capable phone number. Once verified, the number may be used for login verification and other notifications.",setDialogMode(2,"Phone Notifications",3,account_managePhoneAdd,e+='<br /><br /><div style=width:100%;text-align:center>Phone number: <input type=tel pattern="[0-9]" autocomplete="tel" inputmode="tel" maxlength=18 id=d2phoneinput onKeyUp=account_managePhoneValidate() onkeypress="if (event.key==\'Enter\') account_managePhoneValidate(1)"></div></table>',"verifyPhone"),Q("d2phoneinput").focus(),account_managePhoneValidate()))}function isPhoneNumber(e){return e.match(/^\(?([0-9]{3,4})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/)}function account_managePhoneValidate(e){var t=isPhoneNumber(Q("d2phoneinput").value);QE("idx_dlgOkButton",t),1==e&&t&&dialogclose(1)}function account_managePhoneCodeValidate(e){var t=6==Q("d2phoneCodeInput").value.length&&Q("d2phoneCodeInput").value.match(/[0-9]/);QE("idx_dlgOkButton",t),1==e&&t&&dialogclose(1)}function account_managePhoneConfirm(e,t){meshserver.send({action:"confirmPhone",code:Q("d2phoneCodeInput").value,cookie:t})}function account_managePhoneAdd(){0!=isPhoneNumber(Q("d2phoneinput").value)&&(QE("d2phoneinput",!1),meshserver.send({action:"verifyPhone",phone:Q("d2phoneinput").value}))}function account_managePhoneRemove(){Q("d2delPhone").checked&&meshserver.send({action:"removePhone"})}function account_managePhoneRemoveValidate(){QE("idx_dlgOkButton",Q("d2delPhone").checked)}function account_manageAuthEmail(){if(!xxdialogMode&&0!=(8388608&features)){var e=1==userinfo.otpekey&&null!=userinfo.email&&1==userinfo.emailVerified;setDialogMode(2,"E-Mail-Authentifikation",1,function(){e!=Q("email2facheck").checked&&meshserver.send({action:"otpemail",enabled:Q("email2facheck").checked})},"Wenn diese Option aktiviert ist, erhalten Sie bei jeder Anmeldung die Option, ein Anmeldetoken für zusätzliche Sicherheit an Ihr E-Mail-Konto zu senden.<br /><br /><label><input id=email2facheck type=checkbox "+(e?"checked":"")+"/>Aktivieren Sie die E-Mail-Zwei-Faktor-Authentifizierung.</label>")}}function account_manageAuthApp(){if(!xxdialogMode&&0!=(4096&features))return 1==userinfo.otpsecret?account_removeOtp():account_addOtp(),!1}function account_addOtp(){xxdialogMode||1==userinfo.otpsecret||0==(4096&features)||(setDialogMode(2,"Authentifikator-Anwendung",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"<div id=d2optinfo>Laden...</div>","otpauth-request"),meshserver.send({action:"otpauth-request"}))}function account_addOtpCheck(e){var t=6==Q("d2otpauthinput").value.length;QE("idx_dlgOkButton",t),e&&13==e.keyCode&&t&&dialogclose(1)}function account_removeOtp(){xxdialogMode||1!=userinfo.otpsecret||0==(4096&features)||setDialogMode(2,"Authentifikator-Anwendung",3,function(){meshserver.send({action:"otpauth-clear"})},"Bestätigen Sie das Entfernen der Zweifaktor-Anmeldung mittels Authentifikator-Applikation?")}function account_manageOtp(e){return 2==xxdialogMode&&"otpauth-manage"==xxdialogTag&&dialogclose(0),xxdialogMode||0==(4096&features)||0<count2factoraAuths()&&meshserver.send({action:"otpauth-getpasswords",subaction:e}),!1}function account_manageHardwareOtp(){return 2==xxdialogMode&&"otpauth-hardware-manage"==xxdialogTag&&dialogclose(0),xxdialogMode||0==(4096&features)||meshserver.send({action:"otp-hkey-get"}),!1}function account_addhkey(e){if(3==e){var t="Geben Sie den Namen des hinzuzufügenden Schlüssels ein.<br /><br />";t+=addHtmlValue("Schlüsselname",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="Mein Schlüssel" onkeyup=account_addhkeyValidate(event,2) />')}else if(2==e){t="Geben Sie einen Schlüsselnamen ein, wählen Sie OTP und drücken Sie die Taste an Ihrem YubiKey&trade;.<br /><br />";t+=addHtmlValue("Schlüsselname",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="Mein Schlüssel" onkeyup=account_addhkeyValidate(event,1) />'),t+=addHtmlValue("YubiKey&trade; OTP","<input id=dp1key style=width:230px autocomplete=off onkeyup=account_addhkeyValidate(event,2) />")}setDialogMode(2,"Sicherheitsschlüssel hinzufügen",3,account_addhkeyEx,t,e),Q("dp1keyname").focus()}function account_addhkeyValidate(e,t){null!=e&&13==e.keyCode&&(2==t?dialogclose(1):Q("dp1key").focus())}function account_addhkeyEx(e,t){var n=Q("dp1keyname").value;""==n&&(n="MyKey"),2==t?(meshserver.send({action:"otp-hkey-yubikey-add",name:n,otp:Q("dp1key").value}),setDialogMode(2,"Sicherheitsschlüssel hinzufügen",0,null,"<br />Überprüfen...<br /><br /><br />","otpauth-hardware-manage")):3==t&&meshserver.send({action:"webauthn-startregister",name:n})}function account_removehkey(e){meshserver.send({action:"otp-hkey-remove",index:e}),meshserver.send({action:"otp-hkey-get"})}var currentMesh,filetreelinkpath,loclist={af:"Afrikaans",sq:"Albanian",ar:"Arabisch (Standard)","ar-dz":"Arabisch (Algerien)","ar-bh":"Arabisch (Bahrain)","ar-eg":"Arabisch (Ägypten)","ar-iq":"Arabisch (Irak)","ar-jo":"Arabisch (Jordanien)","ar-kw":"Arabisch (Kuwait)","ar-lb":"Arabisch (Libanon)","ar-ly":"Arabisch (Libyen)","ar-ma":"Arabisch (Marokko)","ar-om":"Arabisch (Oman)","ar-qa":"Arabisch (Katar)","ar-sa":"Arabisch (Saudi-Arabien)","ar-sy":"Arabisch (Syrien)","ar-tn":"Arabisch (Tunesien)","ar-ae":"Arabisch (V.A.E.)","ar-ye":"Arabisch (Jemen)",an:"Aragonesisch",hy:"Armenisch",as:"Assamesisch",ast:"Asturisch",az:"Aserbaidschanisch",eu:"Baskisch",bg:"Bulgarisch",be:"Belarussisch",bn:"Bengali",bs:"Bosnisch",br:"Bretonisch",my:"Birmanisch",ca:"Katalanisch",ch:"Chamorro",ce:"Tschetschenisch",zh:"Chinesisch","zh-hk":"Chinesisch (Hong Kong)","zh-cn":"Chinesisch (VR China)","zh-sg":"Chinesisch (Singapur)","zh-tw":"Chinesisch (Taiwan)",cv:"Tschuwaschisch",co:"Korsisch",cr:"Cree",hr:"Kroatisch",cs:"Tschechisch",da:"Dänisch",nl:"Niederländisch (Standard)","nl-be":"Niederländisch (Belgisch)",en:"Englisch","en-au":"Englisch (Australien)","en-bz":"Englisch (Belize)","en-ca":"Englisch (Kanada)","en-ie":"Englisch (Irland)","en-jm":"Englisch (Jamaika)","en-nz":"Englisch (Neuseeland)","en-ph":"Englisch (Philippinen)","en-za":"Englisch (Südafrika)","en-tt":"Englisch (Trinidad Tobago)","en-gb":"Englisch (Vereinigtes Königreich)","en-us":"Englisch (USA)","en-zw":"Englisch (Simbabwe)",eo:"Esperanto",et:"Estnisch",fo:"Färöisch",fa:"Persisch",fj:"Fidschianisch",fi:"Finnisch",fr:"Französisch (Standard)","fr-be":"Französisch (Belgien)","fr-ca":"Französisch (Kanada)","fr-fr":"Französisch (Frankreich)","fr-lu":"Französisch (Luxemburg)","fr-mc":"Französisch (Monaco)","fr-ch":"Französisch (Schweiz)",fy:"Friesisch",fur:"Friaulisch",gd:"Gälisch (Schottisch)","gd-ie":"Gälisch (Irisch)",gl:"Galicisch",ka:"georgisch",de:"Deutsch (Standard)","de-at":"Deutsch (Österreich)","de-de":"Deutsch (Deutschland)","de-li":"Deutsch (Liechtenstein)","de-lu":"Deutsch (Luxemburg)","de-ch":"Deutsch (Schweiz)",el:"Griechisch",gu:"Gujurati",ht:"Haitianisch",he:"Hebräisch",hi:"Hindi",hu:"Ungarisch",is:"Isländisch",id:"Indonesisch",iu:"Inuktitut",ga:"Irisch",it:"Italienisch (Standard)","it-ch":"Italienisch (Schweiz)",ja:"Japanisch",kn:"Kannada",ks:"Kashmiri",kk:"Kasachisch",km:"Khmer",ky:"Kirgisisch",tlh:"Klingonisch",ko:"Koreanisch","ko-kp":"Koreanisch (Nordkorea)","ko-kr":"Koreanisch (Südkorea)",la:"Latein",lv:"Lettisch",lt:"Litauisch",lb:"Luxemburgisch",mk:"Mazedonisch (EJRM)",ms:"Malaiisch",ml:"Malayalam",mt:"Maltesisch",mi:"Maori",mr:"Marathi",mo:"Moldawisch",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegisch",nb:"Norwegisch (Bokmal)",nn:"Norwegisch (Nynorsk)",oc:"Okzitanisch",or:"Oriya",om:"Oromo","fa-ir":"Persisch (Iran)",pl:"Polnisch",pt:"Portugiesisch","pt-br":"Portugiesisch (Brasilien)",pa:"Punjabi","pa-in":"Punjabi (Indien)","pa-pk":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rätoromanisch",ro:"Rumänisch","ro-mo":"Rumänisch (Moldawien)",ru:"Russisch","ru-mo":"Russisch (Moldawien)",sz:"Sami (Lappisch)",sg:"Sango",sa:"Sanskrit",sc:"Sardisch",sd:"Sindhi",si:"Singhalesisch",sr:"Serbisch",sk:"Slowakisch",sl:"Slowenisch",so:"Somani",sb:"Sorbisch",es:"Spanisch","es-ar":"Spanisch (Argentinien)","es-bo":"Spanisch (Bolivien)","es-cl":"Spanisch (Chile)","es-co":"Spanisch (Kolumbien)","es-cr":"Spanisch (Costa Rica)","es-do":"Spanisch (Dominikanische Republik)","es-ec":"Spanisch (Ecuador)","es-sv":"Spanisch (El Salvador)","es-gt":"Spanisch (Guatemala)","es-hn":"Spanisch (Honduras)","es-mx":"Spanisch (Mexiko)","es-ni":"Spanisch (Nicaragua)","es-pa":"Spanisch (Panama)","es-py":"Spanisch (Paraguay)","es-pe":"Spanisch (Peru)","es-pr":"Spanisch (Puerto Rico)","es-es":"Spanisch (Spanien)","es-uy":"Spanisch (Uruguay)","es-ve":"Spanisch (Venezuela)",sx:"Sutu",sw:"Suaheli",sv:"Schwedisch","sv-fi":"Schwedisch (Finnland)","sv-sv":"Schwedisch (Schweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Türkisch",tk:"Turkmenisch",uk:"Ukrainisch",hsb:"Obersorbisch",ur:"Urdu",ve:"Venda",vi:"Vietnamesisch",vo:"Volapuk",wa:"Wallonisch",cy:"Walisisch",xh:"Xhosa",ji:"Jiddisch",zu:"Zulu"},loclistex={"zh-chs":"Vereinfachtes Chinesisch"};function account_showLocalizationSettings(){if(xxdialogMode)return!1;var e=getstore("loctag",0),t="",n='<select id=d2locselect style=width:240px><option value="*">Browsereinstellung des Benutzers</option>';for(var i in loclist)n+='<option value="'+i+'"'+(e==i?" selected":"")+">"+i+" - "+loclist[i]+"</option>";if(n+="</select>",serverinfo.languages&&0<serverinfo.languages.length){t+="Das Ändern der Sprache erfordert eine Aktualisierung der Seite.<br /><br />";var o='<select id=d2langselect style=width:240px><option value="*">Browsereinstellung des Benutzers</option>';for(var i in serverinfo.languages){var r=serverinfo.languages[i];o+='<option value="'+r+'"'+(userinfo.lang==r?" selected":"")+">"+r+" - "+(loclist[r]?loclist[r]:loclistex[r])+"</option>"}t+=addHtmlValue("Sprache",o+="</select>")}return t+=addHtmlValue("Datum & Uhrzeit",n),4294967295==userinfo.siteadmin&&""==domain&&(t+='<br /><a rel="noreferrer noopener" target="_blank" href="translator.htm">Hilf bei der Übersetzung von MeshCentral</a>'),setDialogMode(2,"Lokalisierungseinstellungen",3,account_showLocalizationSettingsEx,t),!1}function account_showLocalizationSettingsEx(){var e=Q("d2langselect").value;"*"==e&&null==userinfo.lang&&(e=userinfo.lang),e!=userinfo.lang&&meshserver.send({action:"changelang",lang:e});var t=getstore("loctag",0),n=Q("d2locselect").value;t!=n&&("*"!=n?args.locale=n:delete args.locale,putstore("loctag",args.locale),masterUpdate(4294967295))}function account_enableNotifications(){return Notification&&Notification.requestPermission().then(function(e){QV("accountEnableNotificationsSpan","granted"!=e)}),!1}function account_showAccountNotifySettings(){if(xxdialogMode)return!1;setDialogMode(2,"Benachrichtungseinstellungen",3,account_showAccountNotifySettingsEx,"<div><label><input id=p2notifyPlayNotifySound type=checkbox />Benachrichtigungston.</label></div><div><label><input id=p2notifyGroupName type=checkbox />Gerätegruppenname anzeigen</label></div><div><label><input id=p2notifyIntelDeviceConnect type=checkbox />Geräteverbindungen.</label></div><div><label><input id=p2notifyIntelDeviceDisconnect type=checkbox />Gerätetrennungen.</label></div><div><label><input id=p2notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT Desktop- und Seriell-Ereignisse.</label></div>");var e=getstore("notifications",0);return Q("p2notifyPlayNotifySound").checked=1&e,Q("p2notifyIntelDeviceConnect").checked=2&e,Q("p2notifyIntelDeviceDisconnect").checked=4&e,Q("p2notifyIntelAmtKvmActions").checked=8&e,Q("p2notifyGroupName").checked=16&e,!1}function account_showAccountNotifySettingsEx(){var e=0;e+=Q("p2notifyPlayNotifySound").checked?1:0,e+=Q("p2notifyIntelDeviceConnect").checked?2:0,e+=Q("p2notifyIntelDeviceDisconnect").checked?4:0,e+=Q("p2notifyIntelAmtKvmActions").checked?8:0,putstore("notifications",e+=Q("p2notifyGroupName").checked?16:0)}function account_showVerifyEmail(){return xxdialogMode||1==userinfo.emailVerified||1!=serverinfo.emailcheck||setDialogMode(2,"E-Mail-Verifizierung",3,account_showVerifyEmailEx,"Auf OK klicken, um eine Bestätigungsmail an folgende Adresse zu senden:<br /><div style=padding:8px><b>"+EscapeHtml(userinfo.email)+"</b></div>Bitte warten Sie einige Minuten, um die Bestätigung zu erhalten."),!1}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){if(xxdialogMode)return!1;var e="Ändern Sie hier Ihre Konto-E-Mail-Adresse.<br /><br />";return setDialogMode(2,"E-Mail-Adresse ändern",3,account_changeEmail,e+=addHtmlValue("Email","<input id=dp2email style=width:230px maxlength=256 onchange=account_validateEmail() onkeyup=account_validateEmail(event) />")),null!=userinfo.email&&(Q("dp2email").value=userinfo.email),account_validateEmail(),Q("dp2email").focus(),!1}function account_validateEmail(e,t){QE("idx_dlgOkButton",validateEmail(Q("dp2email").value)&&Q("dp2email").value!=userinfo.email),null!=e&&13==e.keyCode&&dialogclose(1)}function account_changeEmail(){meshserver.send({action:"changeemail",email:Q("dp2email").value})}function account_showDeleteAccount(){if(xxdialogMode)return!1;var e="Um dieses Konto zu löschen, geben Sie das Konto-Passwort in beide untenstehenden Eingabefelder ein und wählen Sie OK.<br /><br />";return e+="<form method=post><input type=hidden name=action value=deleteaccount /><input type=hidden name=authcookie value="+authCookie+" /><table style=margin-left:80px><tr>",e+="<td align=right>Passwort:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>",e+="</tr><tr><td align=right>Passwort:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>",e+="</tr></table><br /><div style=padding:10px;margin-bottom:4px>",e+="<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>",e+='<input id=account_dlgOkButton type=submit value=OK style="float:right;width:80px" onclick=dialogclose(1)>',setDialogMode(2,"Konto löschen",0,null,e+="</div><br /></form>"),account_validateDeleteAccount(),Q("apassword1").focus(),!1}function account_showChangePassword(){if(xxdialogMode)return!1;var e="Ändern Sie Ihr Kontopasswort, indem Sie das alte und das neue Passwort zweimal in die Felder unten eingeben.";if(e+="<br /><br />",e+="<table style=margin-left:60px>",e+="<tr><td align=right>"+nobreak("Altes Passwort:")+"</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b></b></td></tr>",e+="<tr><td align=right>"+nobreak("Neues Passwort:")+"</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>",e+="<tr><td align=right>"+nobreak("Neues Passwort:")+"</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>",65536&features&&(e+="<tr><td align=right>Passwort-Tipp:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>"),e+="</table>",passRequirements){var t=[],n=0;for(var i in passRequirements)"reset"!=i&&"hint"!=i&&(t.push(i+":"+passRequirements[i]),n++);0<n&&(e+="<br /><span style=font-size:x-small>Voraussetzungen: "+t.join(", ")+".</span>")}return setDialogMode(2,"Passwort ändern",3,account_showChangePasswordEx,e+="<br />"),Q("apassword0").focus(),account_validateNewPassword(),!1}function account_showChangePasswordEx(){if(Q("apassword1").value==Q("apassword2").value){var e={action:"changepassword",oldpass:Q("apassword0").value,newpass:Q("apassword1").value};65536&features&&(e.hint=Q("apasswordhint").value),meshserver.send(e)}}function account_createMesh(){if(xxdialogMode)return!1;if(4294967295!=userinfo.siteadmin&&0!=(64&userinfo.siteadmin))return setDialogMode(2,"Neue Gerätegruppe",1,null,"Dieses Konto besitzt keine Rechte um eine neue Gerätegruppe zu erzeugen."),!1;if(!0!==userinfo.emailVerified&&1==serverinfo.emailcheck&&4294967295!=userinfo.siteadmin)return setDialogMode(2,"Konto-Sicherheit",1,null,'Auf Geräte kann nicht zugegriffen werden, bis die E-Mail-Adresse verifiziert wurde. Dies wird für eine Passwort-Wiederherstellung benötigt. Gehen Sie auf den "Mein Konto"-Tab, um Ihre E-Mail-Adresse zu ändern und zu verifizieren.'),!1;if(262144&features&&!(1==userinfo.otpsecret||0<userinfo.otphkeys||0<userinfo.otpkeys||33554432&features&&67108864&features&&null!=userinfo.phone||8388608&features&&1==userinfo.otpekey))return setDialogMode(2,"Konto-Sicherheit",1,null,'Auf Geräte kann nicht zugegriffen werden, bis Zweifaktor-Authentifizierung eingeschaltet wurde. Dies wird als Sicherheitsmaßnahme vorausgesetzt. Gehen Sie auf den "Mein Konto"-Tab und sehen Sie sich die "Kontosicherheit"-Sektion an.'),!1;var e="Eine neue Gerätegruppe mit den folgenden Optionen erstellen.<br /><br />";return e+=addHtmlValue("Name","<input id=dp2meshname style=width:230px maxlength=64 onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate(event,1) />"),e+=addHtmlValue("Tippen","<div style=width:230px;margin:0;padding:0><select id=dp2meshtype style=width:100% onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate(event,2) ><option value=2>Mittels Software-Agent verwalten</option><option value=1>Nur Intel&reg; AMT, kein Agent</option></select></div>"),setDialogMode(2,"Neue Gerätegruppe",3,account_createMeshEx,e+=addHtmlValue("Beschreibung","<div style=width:230px;margin:0;padding:0><textarea id=dp2meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>")),account_validateMeshCreate(),Q("dp2meshname").focus(),!1}function account_validateMeshCreate(e,t){1==t&&null!=e&&"Eingabe"==e.key&&0<Q("dp2meshname").value.length&&Q("dp2meshtype").focus(),2==t&&null!=e&&"Eingabe"==e.key&&Q("dp2meshdesc").focus(),QE("idx_dlgOkButton",0<Q("dp2meshname").value.length)}function account_createMeshEx(e,t){meshserver.send({action:"createmesh",meshname:Q("dp2meshname").value,meshtype:Q("dp2meshtype").value,desc:Q("dp2meshdesc").value})}function account_validateDeleteAccount(){QE("account_dlgOkButton",0<Q("apassword1").value.length&&Q("apassword1").value==Q("apassword2").value)}function account_validateNewPassword(){var e="",t=0<Q("apassword0").value.length&&0<Q("apassword1").value.length&&Q("apassword1").value==Q("apassword2").value&&Q("apassword0").value!=Q("apassword1").value;if(65536&features&&Q("apasswordhint").value==Q("apassword1").value&&(t=!1),""!=Q("apassword1").value)if(null==passRequirements||""==passRequirements){var n=checkPasswordStrength(Q("apassword1").value);e=80<=n?"<span style=color:green>Stark<span>":60<=n?"<span style=color:blue>Gut<span>":"<span style=color:red>Schwach<span>"}else{0==checkPasswordRequirements(Q("apassword1").value,passRequirements)&&(t=!1,e="<span style=color:red>Richtlinie<span>")}QH("dxPassWarn",e),QE("idx_dlgOkButton",t)}function checkPasswordStrength(e){var t=0,n={},i=0,o={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e)return 0;for(var r=0;r<e.length;r++)n[e[r]]=(n[e[r]]||0)+1,t+=5/n[e[r]];for(var a in o)i+=1==o[a]?1:0;return parseInt(t+10*(i-1))}function checkPasswordRequirements(e,t){if(null==t||""==t||"object"!=typeof t)return!0;if(t.min&&e.length<t.min)return!1;if(t.max&&e.length>t.max)return!1;for(var n=0,i=0,o=0,r=0,a=0;a<e.length;a++)/\d/.test(e[a])&&n++,/[a-z]/.test(e[a])&&i++,/[A-Z]/.test(e[a])&&o++,/\W/.test(e[a])&&r++;return!(t.numeric&&n<t.numeric)&&(!(t.lower&&i<t.lower)&&(!(t.upper&&o<t.upper)&&!(t.nonalpha&&r<t.nonalpha)))}function updateMeshes(){var e="",t=0,n=0;for(i in meshes){1<t&&(e+="</tr><tr>",t=0),t++,n++;var o=GetMeshRights(meshes[i]),r="Partielle Rechte";4294967295==o?r="Gesamtadministrator":0==o&&(r="Keine Berechtigungen"),e+="<div onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:431px;height:50px;padding-top:1px;padding-bottom:1px;float:left><div style=float:left;width:30px;height:100%></div><div tabindex=0 style=height:100%;cursor:pointer onclick=gotoMesh('"+i+"') onkeypress=\"if (event.key=='Enter') gotoMesh('"+i+"')\"><div class=mi style=float:left;width:50px;height:50px></div><div style=height:100%><div class=g1></div><div class=e2 style=width:300px><div class=e1>"+EscapeHtml(meshes[i].name)+"</div><div>"+r+"</div></div><div class=g2 style=float:left></div></div></div></div>"}meshcount=n,QH("p2meshes",e),QV("p2noMeshFound",0==n)}function gotoMesh(e){return currentMesh=meshes[e],p20updateMesh(),go(20),!1}function server_showRestoreDlg(){if(xxdialogMode)return!1;var e="Server unter Verwendung einer Sicherungskopie wiederherstellen, <span style=color:red>Dies wird die existierenden Server-Daten löschen</span>. Fahren Sie nur fort, wenn Sie wissen, was Sie tun.<br /><br />";return e+='<form action="/restoreserver.ashx" enctype="multipart/form-data" method="post"><div>',e+="<input type=hidden name=auth value="+authCookie+">",e+='<input id=account_dlgFileInput type=file name=datafile style=width:100% accept=".zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed" onchange=account_validateServerRestore()>',e+="<input id=account_dlgCancelButton type=button value=Abbrechen style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>",e+="<input id=account_dlgOkButton type=submit value=OK style=float:right;width:80px onclick=dialogclose(1)>",setDialogMode(2,"Server wiederherstellen",0,null,e+="</div><br /><br /></form>"),account_validateServerRestore(),!1}function account_validateServerRestore(){QE("account_dlgOkButton",1==Q("account_dlgFileInput").files.length)}function server_showVersionDlg(){return xxdialogMode||(setDialogMode(2,"MeshCentral-Version",1,null,"Laden...","MeshCentralServerUpdate"),meshserver.send({action:"serverversion"})),!1}function server_showVersionDlgUpdate(){var e=Q("d2updateCheck1").checked,t=Q("d2updateCheck2").checked;QE("d2updateCheck1","Unbekannt"!=xxdialogTag.stable&&xxdialogTag.current!=xxdialogTag.stable&&0==t),QE("d2updateCheck2","Unbekannt"!=xxdialogTag.latest&&xxdialogTag.current!=xxdialogTag.latest&&0==e),QE("idx_dlgOkButton",e&&!t||!e&&t)}function server_showVersionDlgEx(e,t){Q("d2updateCheck1").checked&&meshserver.send({action:"serverupdate",tag:"stable",version:t.stable}),Q("d2updateCheck2").checked&&meshserver.send({action:"serverupdate"})}function server_showErrorsDlg(){return xxdialogMode||(setDialogMode(2,"MeshCentral-Fehler",1,null,"Laden...","MeshCentralServerErrors"),meshserver.send({action:"servererrors"})),!1}function server_showErrorsDlgUpdate(){QE("idx_dlgOkButton",Q("d2clearErrorsCheck").checked)}function server_showErrorsDlgEx(){meshserver.send({action:"serverclearerrorlog"})}function d2CopyServerErrorsToClip(){saveAs(new Blob([Q("d2ServerErrorsLogPre").innerText],{type:"application/octet-stream"}),"servererrors.txt")}function p20updateMesh(){if(null!=currentMesh){var e=GetMeshRights(currentMesh),t=EscapeHtml(currentMesh.name);0==t.length&&(t="<i>Kein(e)</i>"),0!=(1&e)&&(t='<span tabindex=0 title="Click here to edit the device group name" onclick=p20editmesh(1) onkeyup="if (event.key == \'Enter\') p20editmesh(1)" style=cursor:pointer>'+t+' <img class=hoverButton src="images/link5.png" /></span>'),QH("p20meshName",t);var n=format("Unbekannt #{0}",currentMesh.mtype);1==currentMesh.mtype&&(n="Nur Intel&reg; AMT, kein Agent"),2==currentMesh.mtype&&(n="Verwaltet mittels Software-Agent");var i="";if(0!=(8&args.hide)&&(i+=addHtmlValue("Name",t)),i+=addHtmlValue("Beschreibung",addLinkConditional(currentMesh.desc&&""!=currentMesh.desc?EscapeHtml(currentMesh.desc):"<i>Kein(e)</i>","p20editmesh(2)",0!=(1&e))),i+=addHtmlValue("Tippen",n),2==currentMesh.mtype){var o=[];currentMesh.flags&&(1&currentMesh.flags&&o.push("Auto-Entfernen"),2&currentMesh.flags&&o.push("Hostname synchronisieren")),""==(o=o.join(", "))&&(o="<i>Kein(e)</i>"),i+=addHtmlValue("Eigenschaften",addLinkConditional(o,"p20editmeshfeatures()",1&e))}if(2==currentMesh.mtype){o=[];var r=0;currentMesh.consent&&(r=currentMesh.consent),serverinfo.consent&&(r|=serverinfo.consent),64&r&&8&r?o.push("Desktop-Einverständnis & -Werkzeugleiste"):64&r?o.push("Desktop-Werkzeugleiste"):8&r?o.push("Desktop-Einverständnis"):1&r&&o.push("Desktop-Benachrichtigung"),16&r?o.push("Terminal-Einverständnis"):2&r&&o.push("Terminal-Benachrichtigung"),32&r?o.push("Dateien-Einverständnis"):4&r&&o.push("Dateien-Benachrichtigung"),7==r&&(o=["Immer benachrichtigen"]),56==(56&r)&&(o=["Immer nachfragen"]),""==(o=o.join(", "))&&(o="<i>Kein(e)</i>"),i+=addHtmlValue("Benutzereinwilligung",addLinkConditional(o,"p20editmeshconsent(1)",1&e))}var a=0,s=[];if(userinfo.links&&userinfo.links[currentMesh._id]&&userinfo.links[currentMesh._id].notify&&(a=userinfo.links[currentMesh._id].notify),2&a&&s.push("Verbinden"),4&a&&s.push("Trennen"),8&a&&s.push("Intel&reg; AMT"),0==s.length&&s.push("<i>Kein(e)</i>"),i+=addHtmlValue("Benachrichtigungen",addLink(s.join(", "),"p20editMeshNotify()")),16777216&features&&2==currentMesh.mtype){var l="<i>Kein(e)</i>",d=!1;null!=currentMesh.invite&&(d=!0,l=currentMesh.invite.codes.join(", ")),i+=addHtmlValue("Codes einladen",addLinkConditional(l,"p20editmeshInviteCode()",1&e||d))}var c="Keine Richtlinie";if(currentMesh.amt&&(1==currentMesh.amt.type?c="Deactivate Client Control Mode (CCM)":2==currentMesh.amt.type?(c="Einfacher Client Control Mode (CCM)",2==currentMesh.amt.cirasetup&&(c+=" + CIRA")):3==currentMesh.amt.type&&(c="Einfacher Admin Control Mode (ACM)",2==currentMesh.amt.cirasetup&&(c+=" + CIRA"))),i+=addHtmlValue("Intel&reg; AMT",addLinkConditional(c,"p20editMeshAmt()",1&e)),1&e&&(i+='<br><input type=button value=Notizen title="Zeige Notizen zu dieser Gerätegruppe" onclick=showNotes(false,"'+encodeURIComponentEx(currentMesh._id)+'") />'),i+="<br style=clear:both><br>",2&e&&(i+='<a href=# onclick="return p20showAddMeshUserDialog()" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzer hinzufügen</a>',null!=usergroups)){var u=0,p=!1;for(var m in usergroups)usergroups[m]._id.split("/")[1]==currentMesh._id.split("/")[1]&&(u++,null!=currentMesh.links&&null!=currentMesh.links[m]||(p=!0));0<u&&p&&(i+='<a href=# onclick="return p20showAddMeshUserDialog(2)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzergruppe hinzufügen</a>')}4&e&&(1==currentMesh.mtype&&(i+="<a href=# onclick='return addCiraDeviceToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Füge einen neuen Intel&reg;-AMT-Rechner hinzu, der sich im Internet befindet."><img src=images/icon-installmesh.png border=0 height=12 width=12> CIRA instrallieren</a>',i+="<a href=# onclick='return addDeviceToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Füge einen neuen Intel&reg;-AMT-Rechner hinzu, der sich im lokalen Netzwerk befindet."><img src=images/icon-installmesh.png border=0 height=12 width=12> Lokal installieren</a>',currentMesh.amt&&2==currentMesh.amt.type?i+="<a href=# onclick='return showCcmActivation(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Aktivierung von Intel AMT im Client Control Mode (CCM) durchführen."><img src=images/icon-installmesh.png border=0 height=12 width=12> Aktivierung</a>':currentMesh.amt&&3==currentMesh.amt.type&&0!=(1048576&features)&&(i+="<a href=# onclick='return showAcmActivation(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Aktivierung von Intel AMT im Admin Control Mode (ACM) durchführen."><img src=images/icon-installmesh.png border=0 height=12 width=12> Aktivierung</a>')),2==currentMesh.mtype&&(i+="<a href=# onclick='return addAgentToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Füge einen neuen Computer durch Installation des Mesh-Agenten zu dieser Gerätegruppe hinzu."><img src=images/icon-addnew.png border=0 height=12 width=12> Agenten hinzufügen</a>',i+="<a href=# onclick='return inviteAgentToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Laden Sie jemanden ein, den Mesh-Agenten für diese Gerätegruppe zu installieren."><img src=images/icon-addnew.png border=0 height=12 width=12> Einladen</a>')),i+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Benutzerberechtigungen</th><th scope=col style=text-align:left></th></tr>';var g=1,h=[];for(var m in currentMesh.links){var v=m.split("/")[2];currentMesh.links[m].name&&(v=currentMesh.links[m].name),m==userinfo._id&&(v=userinfo.name),null!=usergroups&&null!=usergroups[m]&&(v=usergroups[m].name),h.push({id:m,name:v,rights:currentMesh.links[m].rights})}for(var m in h.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0}),h){var f="",k=makeDeviceGroupRightsString(h[m].rights),b=2;h[m].id==userinfo._id||4294967295!=e&&0==(2&e)||(4294967295!=e&&4294967295==currentMesh.links[h[m].id].rights||(f="<a href=# onclick='return p20deleteUser(event,\""+encodeURIComponentEx(h[m].id)+'")\' title="Entziehe Benutzerrechte an dieser Gerätegruppe" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),k='<span tabindex=0 style=cursor:pointer onclick=p20viewuser("'+encodeURIComponentEx(h[m].id)+"\") onkeypress=\"if (event.key=='Enter') p20viewuser('"+encodeURIComponentEx(h[m].id)+"')\">"+k+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"),h[m].id.startsWith("ugrp/")&&(b=4);var x=EscapeHtml(decodeURIComponent(h[m].name));null!=usergroups&&h[m].id.startsWith("ugrp/")&&(x="<a tabindex=0 href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(h[m].id)+"\");haltEvent(event);'>"+x+"</a>"),null!=users&&h[m].id.startsWith("user/")&&(x="<a tabindex=0 href=# onclick='gotoUser(\""+encodeURIComponentEx(h[m].id)+"\");haltEvent(event);'>"+x+"</a>"),i+="<tr style="+(g%2==0?";background-color:#DDD":"")+'><td style=width:30%><div title="Benutzer" class=m'+b+"></div><div>&nbsp;"+x+"<div></div></div></td><td style=width:70%><div style=float:right>"+f+"</div><div>"+k+"</div></td></tr>",++g}i+="</tbody></table>",4294967295==e&&(i+="<div style=font-size:x-small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>Gruppe löschen</a></span></div>"),QH("p20info",i);var y="";if(0==(268435456&features)&&20<=xxcurrentView&&xxcurrentView<=29&&null!=currentMesh){for(var m in y="?viewmode="+xxcurrentView+"&gotomesh="+currentMesh._id.split("/")[2],urlargs)y+="&"+m+"="+urlargs[m];try{window.history.replaceState({},document.title,window.location.pathname+y)}catch(e){}}}}function p20editMeshAmt(){if(!xxdialogMode){var e="",t="";0!=(1048576&features)&&(t="<option value=3>Einfacher Admin Control Mode (ACM)</option>"),1==currentMesh.mtype?e+=addHtmlValue("Tippen","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>Keine Richtlinie</option><option value=2>Einfacher Client Control Mode (CCM)</option>"+t+"</select>"):e+=addHtmlValue("Tippen","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>Keine Richtlinie</option><option value=1>Client Control Mode (CCM) deaktivieren</option><option value=2>Einfacher Client Control Mode (CCM)</option>"+t+"</select>"),setDialogMode(2,"Intel&reg; AMT Regelwerk",3,p20editMeshAmtEx,e+="<div id=dp20amtpolicydiv></div>"),currentMesh.amt&&(Q("dp20amtpolicy").value=currentMesh.amt.type),p20editMeshAmtChange(),(currentMesh.amt&&2==currentMesh.amt.type||3==currentMesh.amt.type)&&(Q("dp20amtpolicypass").value=currentMesh.amt.password,2==currentMesh.amt.type&&null!=currentMesh.amt.badpass&&(Q("dp20amtbadpass").value=currentMesh.amt.badpass),0==(1024&features)&&(Q("dp20amtcira").value=currentMesh.amt.cirasetup)),dp20amtValidatePolicy()}}function p20editMeshAmtChange(){var e=Q("dp20amtpolicy").value,t="";2<=e&&(t=addHtmlValue("Passwort*","<input id=dp20amtpolicypass type=password style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() autocomplete=off />"),t+=addHtmlValue("Passwort*","<input id=dp20amtpolicypass2 type=password style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() autocomplete=off />"),2==e&&2==currentMesh.mtype&&(t+=addHtmlValue("Passwörter stimmen nicht überein","<select id=dp20amtbadpass style=width:230px><option value=0>Nichts tun</option><option value=1>Intel&reg; AMT reaktivieren</option></select>")),0==(1024&features)&&(t+=addHtmlValue('<span title="Client Initiated Remote Access">CIRA</span>',2==e?"<select id=dp20amtcira style=width:230px><option value=0>Don't configure</option><option value=1>Don't connect to server</option><option value=2>Mit Server verbinden</option></select>":"<select id=dp20amtcira style=width:230px><option value=0>Don't configure</option><option value=2>Mit Server verbinden</option></select>")),t+='<br/><span style="font-size:10px">* Frei lassen, um jedem Gerät ein zufälliges Passwort zuzuweisen.</span><br/>',2==currentMesh.mtype&&(2==e?(t+='<span style="font-size:10px">Diese Richtlinie hat keine Wirkung auf Intel&reg;-AMT-Geräte im ACM-Modus.</span><br/>',t+='<span style="font-size:10px">Dies ist keine sichere Richtlinie, da Agenten die Aktivierung durchführen.</span>'):t+='<span style="font-size:10px">Während der Aktivierung hat der Agent Zugriff auf das Administratorkennwort.</span>')),QH("dp20amtpolicydiv",t),setTimeout(dp20amtValidatePolicy,1)}function dp20amtValidatePolicy(){var e=!0,t=Q("dp20amtpolicy").value;if(2==t||3==t){var n=Q("dp20amtpolicypass").value;e=n===Q("dp20amtpolicypass2").value&&(""===n||passwordcheck(n))}QE("idx_dlgOkButton",e)}function p20editMeshAmtEx(){var e=parseInt(Q("dp20amtpolicy").value),t={type:e};2==e?(t={type:e,password:Q("dp20amtpolicypass").value},2==currentMesh.mtype&&(t.badpass=parseInt(Q("dp20amtbadpass").value)),t.cirasetup=0==(1024&features)?parseInt(Q("dp20amtcira").value):1):3==e&&((t={type:e,password:Q("dp20amtpolicypass").value}).cirasetup=0==(1024&features)?parseInt(Q("dp20amtcira").value):1),meshserver.send({action:"meshamtpolicy",meshid:currentMesh._id,amtpolicy:t})}function p20showDeleteMeshDialog(){if(xxdialogMode)return!1;var e=format("Möchten Sie die Gruppe {0} wirklich löschen? Das Löschen der Gerätegruppe wird auch alle Informationen über die Geräte innerhalb dieser Gruppe löschen.",EscapeHtml(currentMesh.name))+"<br /><br />";return setDialogMode(2,"Gruppe löschen",3,p20showDeleteMeshDialogEx,e+="<label><input id=p20check type=checkbox onchange=p20validateDeleteMeshDialog() />Bestätigen</label>"),p20validateDeleteMeshDialog(),!1}function p20validateDeleteMeshDialog(){QE("idx_dlgOkButton",Q("p20check").checked)}function p20showDeleteMeshDialogEx(e,t){meshserver.send({action:"deletemesh",meshid:currentMesh._id,meshname:currentMesh.name})}function p20editmesh(e){if(!xxdialogMode){var t=addHtmlValue("Name","<input id=dp20meshname style=width:230px maxlength=32 onchange=p20editmeshValidate() onkeyup=p20editmeshValidate(event) />");setDialogMode(2,"Gerätegruppe bearbeiten",3,p20editmeshEx,t+=addHtmlValue("Beschreibung","<div style=width:230px;margin:0;padding:0><textarea id=dp20meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>")),Q("dp20meshname").value=currentMesh.name,currentMesh.desc&&(Q("dp20meshdesc").value=currentMesh.desc),p20editmeshValidate(),2==e?Q("dp20meshdesc").focus():Q("dp20meshname").focus()}}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(e){QE("idx_dlgOkButton",0<Q("dp20meshname").value.length),e&&"Enter"==e.key&&Q("dp20meshdesc").focus()}function p20editmeshconsent(e){if(!xxdialogMode){var t="",n=0,i="";1==e&&(n=currentMesh.consent?currentMesh.consent:0,i="Gerätegruppen-Nutzereinwilligung bearbeiten"),2==e&&(n=currentUser.consent?currentUser.consent:0,i="Benutzereinwilligung bearbeiten"),3==e&&(n=currentNode.consent?currentNode.consent:0,i="Geräte-Benutzereinwilligung bearbeiten"),t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px"><b>Desktop</b></div>',t+="<div><label><input type=checkbox id=d20flag1 "+(1&n?"checked":"")+">Benutzer benachrichtigen</label></div>",t+="<div><label><input type=checkbox id=d20flag2 "+(8&n?"checked":"")+">Benutzereinwilligung abfragen</label></div>",t+="<div><label><input type=checkbox id=d20flag7 "+(64&n?"checked":"")+">Verbindungssymbolleiste anzeigen</label></div>",t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:8px"><b>Terminal</b></div>',t+="<div><label><input type=checkbox id=d20flag3 "+(2&n?"checked":"")+">Benutzer benachrichtigen</label></div>",t+="<div><label><input type=checkbox id=d20flag4 "+(16&n?"checked":"")+">Benutzereinwilligung abfragen</label></div>",t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:8px"><b>Dateien</b></div>',t+="<div><label><input type=checkbox id=d20flag5 "+(4&n?"checked":"")+">Benutzer benachrichtigen</label></div>",setDialogMode(2,i,3,p20editmeshconsentEx,t+="<div><label><input type=checkbox id=d20flag6 "+(32&n?"checked":"")+">Benutzereinwilligung abfragen</label></div>",e),serverinfo.consent&&(1&serverinfo.consent&&(Q("d20flag1").checked=!0),8&serverinfo.consent&&(Q("d20flag2").checked=!0),2&serverinfo.consent&&(Q("d20flag3").checked=!0),16&serverinfo.consent&&(Q("d20flag4").checked=!0),4&serverinfo.consent&&(Q("d20flag5").checked=!0),32&serverinfo.consent&&(Q("d20flag6").checked=!0),64&serverinfo.consent&&(Q("d20flag7").checked=!0),QE("d20flag1",!(1&serverinfo.consent)),QE("d20flag2",!(8&serverinfo.consent)),QE("d20flag3",!(2&serverinfo.consent)),QE("d20flag4",!(16&serverinfo.consent)),QE("d20flag5",!(4&serverinfo.consent)),QE("d20flag6",!(32&serverinfo.consent)),QE("d20flag7",!(64&serverinfo.consent)))}}function p20editmeshconsentEx(e,t){var n=0;Q("d20flag1").checked&&(n+=1),Q("d20flag2").checked&&(n+=8),Q("d20flag3").checked&&(n+=2),Q("d20flag4").checked&&(n+=16),Q("d20flag5").checked&&(n+=4),Q("d20flag6").checked&&(n+=32),Q("d20flag7").checked&&(n+=64),1==t&&meshserver.send({action:"editmesh",meshid:currentMesh._id,consent:n}),2==t&&meshserver.send({action:"edituser",id:currentUser._id,consent:n}),3==t&&meshserver.send({action:"changedevice",nodeid:currentNode._id,consent:n})}function p20editmeshfeatures(){if(!xxdialogMode){var e=currentMesh.flags?currentMesh.flags:0,t="<div><label><input type=checkbox id=d20flag1 "+(1&e?"checked":"")+">Gerät nach Trennung entfernen</label><br></div>";setDialogMode(2,"Gerätegruppenmerkmale bearbeiten",3,p20editmeshfeaturesEx,t+="<div><label><input type=checkbox id=d20flag2 "+(2&e?"checked":"")+">Server-Gerätename zu Hostname synchronisieren</label><br></div>")}}function p20editmeshfeaturesEx(){var e=0;Q("d20flag1").checked&&(e+=1),Q("d20flag2").checked&&(e+=2),meshserver.send({action:"editmesh",meshid:currentMesh._id,flags:e})}function p20showAddMeshUserDialog(e,t){if(xxdialogMode)return!1;var n="";if(null==e||5==e)null==t&&(n+=null==e?"Erlaube Benutzern, diese Gerätegruppe und die Geräte darin zu verwalten.":"Ermöglichen Sie Benutzern die Verwaltung dieses Geräts.",524288&features&&(n+=" Benutzer müssen sich an diesem Server anmelden, bevor sie einer Gerätegruppe hinzugefügt werden können."),n+="<br /><br />"),n+="<div style='position:relative'>",n+=addHtmlValue("User Identifiers",'<input id=dp20username style=width:230px maxlength=256 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() placeholder="user1, user2, user3" />'),n+="<div id=dp20usersuggest class=suggestionBox style='top:30px;left:130px;display:none'></div>",n+="</div><br>";else if(1==e){var i="";if(null==t){var o=getOrderedList(meshes,"name");for(var r in o)null!=currentUser.links&&null!=currentUser.links[o[r]._id]||(i+="<option value="+encodeURIComponentEx(o[r]._id)+">"+EscapeHtml(o[r].name)+"</option>")}else i+="<option value="+t+">"+EscapeHtml(meshes[decodeURIComponent(t)].name)+"</option>";n+=addHtmlValue("Gerätegruppe","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%"+(t?" disabled":"")+">"+i+"</select></div>")}else if(2==e){if(null==usergroups)return;i="";var a=getOrderedList(usergroups,"name");for(var r in a)currentMesh._id.split("/")[1]==a[r]._id.split("/")[1]&&(null!=currentMesh.links&&null!=currentMesh.links[a[r]._id]||(i+="<option value="+encodeURIComponentEx(a[r]._id)+">"+EscapeHtml(a[r].name)+"</option>"));n+=addHtmlValue("Benutzergruppe","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%>"+i+"</select></div>")}else if(6==e){if(null==usergroups)return;i="";if(null==t){a=getOrderedList(usergroups,"name");for(var r in a)currentNode._id.split("/")[1]==a[r]._id.split("/")[1]&&(null!=currentNode.links&&null!=currentNode.links[a[r]._id]||(i+="<option value="+encodeURIComponentEx(a[r]._id)+">"+EscapeHtml(a[r].name)+"</option>"))}else i+="<option value="+t+">"+EscapeHtml(usergroups[decodeURIComponent(t)].name)+"</option>";n+=addHtmlValue("Benutzergruppe","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%"+(t?" disabled":"")+">"+i+"</select></div>")}else if(3==e){i="";t=t&&decodeURIComponent(t);o=getOrderedList(meshes,"name");for(var r in o)null==t&&null!=currentUserGroup.links&&null!=currentUserGroup.links[o[r]._id]||(i+="<option value="+encodeURIComponentEx(o[r]._id)+(t==o[r]._id?" selected":" ")+">"+EscapeHtml(o[r].name)+"</option>");n+=addHtmlValue("Gerätegruppe","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog("+e+") id=dp2groupid style=width:100%>"+i+"</select></div>")}else if(4==e||7==e){i="";var s=null,l=null;null!=t&&null!=(l=getNodeFromId(decodeURIComponent(t)))&&(s=l.meshid);o=getOrderedList(meshes,"name");for(var r in o)null!=o[r].links[userinfo._id]&&7&o[r].links[userinfo._id].rights&&(null==s&&(s=o[r]._id),i+="<option value="+encodeURIComponentEx(o[r]._id)+(s==o[r]._id?" selected":" ")+">"+EscapeHtml(o[r].name)+"</option>");n+=addHtmlValue("Gerätegruppe","<div style=width:230px;margin:0;padding:0><select onchange=p20changeMeshAddMeshUserDialog("+e+") id=dp2meshid style=width:100%>"+i+"</select></div>"),i="";var d=getOrderedList(nodes,"name");for(var r in d)d[r].meshid==s&&(i+="<option value="+encodeURIComponentEx(d[r]._id)+(l==d[r]?" selected":" ")+">"+EscapeHtml(d[r].name)+"</option>");n+=addHtmlValue("Gerät","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog("+e+") id=dp2nodeid style=width:100%>"+i+"</select></div>")}else{var c=(e=decodeURIComponent(e)).split("/")[2];users&&users[e]&&(c=users[e].name),usergroups&&usergroups[e]&&(c=usergroups[e].name),userinfo._id==e&&(c=userinfo.name),e.startsWith("ugrp/")?n+=format("Gruppenberechtigungen für {0}.",c)+"<br /><br />":n+=format("Gruppenberechtigungen für Benutzer {0}.",c)+"<br /><br />"}var u=-1,p=4!=e&&5!=e&&6!=e&&7!=e;if(n+='<div style="height:120px;overflow-y:scroll;border:1px solid gray">',p&&(n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>Gesamtadministrator</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editmesh>Gerätegruppe bearbeiten</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20manageusers>Gerätegruppen-Benutzer verwalten</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20managecomputers>Gerätegruppen-Rechner verwalten</label><br>"),n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotecontrol>Fernsteuerung</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remoteview style=margin-left:12px>Nur entfernte Ansicht</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotelimitedinput style=margin-left:12px>Nur eingeschränkte Eingabe</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20nodesktop style=margin-left:12px>Kein Desktop-Zugriff</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noterminal style=margin-left:12px>Kein Terminalzugriff</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20nofiles style=margin-left:12px>Kein Dateizugriff</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noamt style=margin-left:12px>Kein Intel&reg; AMT</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshagentconsole>Mesh-Agent-Konsole</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshserverfiles>Server-Dateien</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20wakedevices>Geräte wecken</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editnotes>Geräte-Notizen bearbeiten</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20limitevents>Nur eigene Ereignisse anzeigen</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20chatnotify>Chat & Benachrichtigen</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20uninstall>Agenten deinstallieren</label><br>",n+="</div>",null==e)setDialogMode(2,"Benutzer zu Gerätegruppe hinzufügen",3,p20showAddMeshUserDialogEx,n),QE("p20fulladmin",4294967295==GetMeshRights(currentMesh)),Q("dp20username").focus();else if(1===e)setDialogMode(2,null==t?"Gerätegruppe-Berechtigungen hinzufügen":"Gerätegruppenberechtigungen bearbeiten",t?7:3,p20showAddMeshUserDialogEx,n,e),null!=t&&(u=meshes[decodeURIComponent(t)].links[currentUser._id].rights),4294967295==u&&(Q("p20fulladmin").checked=!0,u=-1);else if(2===e)setDialogMode(2,"Benutzergruppe hinzufügen",3,p20showAddMeshUserDialogEx,n,e),QE("p20fulladmin",4294967295==GetMeshRights(currentMesh));else if(3===e)setDialogMode(2,null==t?"Gerätegruppe hinzufügen":"Gerätegruppe bearbeiten",t?7:3,p20showAddMeshUserDialogEx,n,e),QE("dp2groupid",null==t),null!=t&&(u=currentUserGroup.links[decodeURIComponent(t)].rights),4294967295==u&&(Q("p20fulladmin").checked=!0,u=-1);else if(4===e)setDialogMode(2,null==t?"Geräteberechtigungen hinzufügen":"Geräteberechtigungen bearbeiten",t?7:3,p20showAddMeshUserDialogEx,n,e),QE("dp2meshid",null==t),QE("dp2nodeid",null==t);else if(7===e)setDialogMode(2,null==t?"Geräteberechtigungen hinzufügen":"Geräteberechtigungen bearbeiten",t?7:3,p20showAddMeshUserDialogEx,n,e),QE("dp2meshid",null==t),QE("dp2nodeid",null==t),null!=t&&(u=currentUserGroup.links[decodeURIComponent(t)].rights,QE("dp20username",!1));else if(5===e)setDialogMode(2,t?"Benutzergeräteberechtigungen bearbeiten":"Hinzufügen von Benutzergeräteberechtigungen",t?7:3,p20showAddMeshUserDialogEx,n,e),null!=t&&(t=decodeURIComponent(t),null!=users&&null!=users[t]?Q("dp20username").value=users[t].name:Q("dp20username").value=t.split("/")[2],u=currentNode.links[t].rights,QE("dp20username",!1)),Q("dp20username").focus();else if(6===e)setDialogMode(2,t?"Benutzergruppen-Geräteberechtigungen bearbeiten":"Benutzergruppen-Geräteberechtigungen hinzufügen",t?7:3,p20showAddMeshUserDialogEx,n,e),null!=t&&(u=currentNode.links[decodeURIComponent(t)].rights);else{e.startsWith("ugrp/")?setDialogMode(2,"Gerätegruppenberechtigungen bearbeiten",7,p20showAddMeshUserDialogEx,n,e):setDialogMode(2,"Benutzer-Gerätegruppenberechtigungen bearbeiten",7,p20showAddMeshUserDialogEx,n,e);GetMeshRights(currentMesh);4294967295==(u=GetMeshRights(currentMesh,e))&&(Q("p20fulladmin").checked=!0,u=-1),QE("p20fulladmin",4294967295==GetMeshRights(currentMesh))}return-1!=u&&(p&&(1&u&&(Q("p20editmesh").checked=!0),2&u&&(Q("p20manageusers").checked=!0),4&u&&(Q("p20managecomputers").checked=!0)),8&u&&(Q("p20remotecontrol").checked=!0,65536&u&&(Q("p20nodesktop").checked=!0),256&u&&(Q("p20remoteview").checked=!0),512&u&&(Q("p20noterminal").checked=!0),1024&u&&(Q("p20nofiles").checked=!0),2048&u&&(Q("p20noamt").checked=!0),4096&u&&(Q("p20remotelimitedinput").checked=!0)),16&u&&(Q("p20meshagentconsole").checked=!0),32&u&&(Q("p20meshserverfiles").checked=!0),64&u&&(Q("p20wakedevices").checked=!0),128&u&&(Q("p20editnotes").checked=!0),8192&u&&(Q("p20limitevents").checked=!0),16384&u&&(Q("p20chatnotify").checked=!0),32768&u&&(Q("p20uninstall").checked=!0)),p20validateAddMeshUserDialog(e),!1}function p20changeMeshAddMeshUserDialog(e){var t="",n=decodeURIComponent(Q("dp2meshid").value);for(var i in nodes)nodes[i].meshid==n&&(t+="<option value="+encodeURIComponentEx(nodes[i]._id)+">"+EscapeHtml(nodes[i].name)+"</option>");QH("dp2nodeid",t),p20validateAddMeshUserDialog(e)}function p20setname(e){e=decodeURIComponent(e);var t=Q("dp20username").value.split(",");for(var n in t)t[n]=t[n].trim();return t[t.length-1]=e,Q("dp20username").value=t.join(", "),p20validateAddMeshUserDialog(),!1}function p20validateAddMeshUserDialog(e){var t,n=!0;if(4===e){var i=0,o=decodeURIComponent(Q("dp2nodeid").value);""!=o&&null!=currentUser.links&&null!=currentUser.links[o]&&(i=currentUser.links[o].rights),Q("p20remotecontrol").checked=0!=(8&i),Q("p20meshagentconsole").checked=0!=(16&i),Q("p20meshserverfiles").checked=0!=(32&i),Q("p20wakedevices").checked=0!=(64&i),Q("p20editnotes").checked=0!=(128&i),Q("p20remoteview").checked=0!=(256&i),Q("p20noterminal").checked=0!=(512&i),Q("p20nofiles").checked=0!=(1024&i),Q("p20noamt").checked=0!=(2048&i),Q("p20remotelimitedinput").checked=0!=(4096&i),Q("p20limitevents").checked=0!=(8192&i),Q("p20chatnotify").checked=0!=(16384&i),Q("p20uninstall").checked=0!=(32768&i),Q("p20nodesktop").checked=0!=(65536&i),n=""!=o}if(Q("dp20username")){var r=Q("dp20username").value.split(",");for(var a in r){var s=r[a]=r[a].trim();0==s.length?n=!1:0<=s.indexOf('"')&&(n=!1)}var l=!1,d=!1;if(null!=users){var c=r[r.length-1].trim(),u=c.toLowerCase(),p=[];if(0<c.length){for(var a in users){var m=users[a]._id.split("/");if((null==currentMesh||currentMesh.domain==m[1])&&(null==currentNode||currentNode.domain==m[1])){if(m[2]===u){d=!0;break}if(0<=users[a].name.toLowerCase().indexOf(u)&&(p.push([users[a]._id,users[a].name]),8<=p.length))break}}if(0==d&&0<p.length){var g="";for(var a in p){var h=p[a][0],v=p[a][1];h.split("/")[2]==v.toLowerCase()?g+="<div class=suggestionBoxItem onclick='p20setname(\""+encodeURIComponentEx(h.split("/")[2])+"\")'>"+EscapeHtml(v)+"</div>":g+="<div class=suggestionBoxItem onclick='p20setname(\""+encodeURIComponentEx(h.split("/")[2])+"\")'><div>"+EscapeHtml(v)+"</div><div class=suggestionBoxSubItem>"+EscapeHtml(h.split("/")[2])+"</div></div>"}QH("dp20usersuggest",g),l=!0}}}QV("dp20usersuggest",l)}QE("idx_dlgOkButton",n),null!=Q("p20fulladmin")?(t=!Q("p20fulladmin").checked,QE("p20editmesh",t),QE("p20manageusers",t),QE("p20managecomputers",t)):t=""!=o,QE("p20remotecontrol",t),QE("p20meshagentconsole",t),QE("p20meshserverfiles",t),QE("p20wakedevices",t),QE("p20editnotes",t),QE("p20limitevents",t),QE("p20remoteview",t&&Q("p20remotecontrol").checked),QE("p20remotelimitedinput",t&&Q("p20remotecontrol").checked&&!Q("p20remoteview").checked),QE("p20nodesktop",t&&Q("p20remotecontrol").checked),QE("p20noterminal",t&&Q("p20remotecontrol").checked),QE("p20nofiles",t&&Q("p20remotecontrol").checked),QE("p20noamt",t&&Q("p20remotecontrol").checked),QE("p20chatnotify",t),QE("p20uninstall",t)}function p20showAddMeshUserDialogEx(e,t){var n=0;if(null!=Q("p20fulladmin")&&1==Q("p20fulladmin").checked?n=4294967295:(null!=Q("p20fulladmin")&&(1==Q("p20editmesh").checked&&(n+=1),1==Q("p20manageusers").checked&&(n+=2),1==Q("p20managecomputers").checked&&(n+=4)),1==Q("p20remotecontrol").checked&&(n+=8),1==Q("p20meshagentconsole").checked&&(n+=16),1==Q("p20meshserverfiles").checked&&(n+=32),1==Q("p20wakedevices").checked&&(n+=64),1==Q("p20editnotes").checked&&(n+=128),1==Q("p20remoteview").checked&&(n+=256),1==Q("p20nodesktop").checked&&(n+=65536),1==Q("p20noterminal").checked&&(n+=512),1==Q("p20nofiles").checked&&(n+=1024),1==Q("p20noamt").checked&&(n+=2048),1==Q("p20remotelimitedinput").checked&&(n+=4096),1==Q("p20limitevents").checked&&(n+=8192),1==Q("p20chatnotify").checked&&(n+=16384),1==Q("p20uninstall").checked&&(n+=32768)),0==(8&n)&&(256&n&&(n-=256),512&n&&(n-=512),1024&n&&(n-=1024),2048&n&&(n-=2048),4096&n&&(n-=4096),65536&n&&(n-=65536)),1===t){var i=decodeURIComponent(Q("dp2groupid").value);null!=(r=meshes[i])&&meshserver.send({action:"addmeshuser",meshid:i,meshname:r.name,userids:[currentUser._id],meshadmin:n,remove:2==e})}else if(2===t){var o=decodeURIComponent(Q("dp2groupid").value);null!=(r=meshes[currentMesh._id])&&meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:o,meshadmin:n,remove:2==e})}else if(3===t){var r;i=decodeURIComponent(Q("dp2groupid").value);null!=(r=meshes[i])&&meshserver.send({action:"addmeshuser",meshid:i,meshname:r.name,userids:[currentUserGroup._id],meshadmin:n,remove:2==e})}else if(4===t){null!=(c=getNodeFromId(d=decodeURIComponent(Q("dp2nodeid").value)))&&meshserver.send({action:"adddeviceuser",nodeid:d,nodename:c.name,userids:[currentUser._id],rights:n,remove:2==e})}else if(5===t){var a=Q("dp20username").value.split(","),s=[];for(var l in a)s.push(a[l].trim());meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,usernames:s,rights:n,remove:2==e})}else if(6===t){o=decodeURIComponent(Q("dp2groupid").value);null!=currentNode&&meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[o],rights:n,remove:2==e})}else if(7===t){var d,c;null!=(c=getNodeFromId(d=decodeURIComponent(Q("dp2nodeid").value)))&&meshserver.send({action:"adddeviceuser",nodeid:d,nodename:c.name,userids:[currentUserGroup._id],rights:n,remove:2==e})}else if(null==t){a=Q("dp20username").value.split(","),s=[];for(var l in a)s.push(a[l].trim());meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,usernames:s,meshadmin:n,remove:2==e})}else meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userids:[t],meshadmin:n,remove:2==e})}function p20viewuser(e){if(!xxdialogMode){var t=decodeURIComponent(e),n=GetMeshRights(currentMesh),i=GetMeshRights(currentMesh,t);if(userinfo._id!=t&&(4294967295==n||0!=(2&n)&&4294967295!=i))p20showAddMeshUserDialog(e);else{var o=[];4294967295==i?o.push("Gesamtadministrator (alle Rechte)"):(0!=(1&i)&&o.push("Gerätegruppe bearbeiten"),0!=(2&i)&&o.push("Gerätegruppen-Benutzer verwalten"),0!=(4&i)&&o.push("Gerätegruppen-Rechner verwalten"),0!=(8&i)&&o.push("Fernsteuerung"),0!=(16&i)&&o.push("Agent-Konsole"),0!=(32&i)&&o.push("Server-Dateien"),0!=(64&i)&&o.push("Geräte wecken"),0!=(128&i)&&o.push("Notizen bearbeiten"),0!=(8&i)&&0!=(256&i)&&o.push("Nur entfernte Ansicht"),0!=(8&i)&&0!=(65536&i)&&o.push("Kein Desktop"),0!=(8&i)&&0!=(512&i)&&o.push("Kein Terminal"),0!=(8&i)&&0!=(1024&i)&&o.push("Keine Dateien"),0!=(8&i)&&0!=(2048&i)&&o.push("Kein Intel&reg; AMT"),0!=(8&i)&&0!=(4096&i)&&0==(256&i)&&o.push("Eingeschränkte Eingabe"),0!=(8192&i)&&o.push("Nur eigene Ereignisse"),0!=(16384&i)&&o.push("Chat & Benachrichtigen"),0!=(32768&i)&&o.push("Deinstallation")),0==o.length&&o.push("Keine Berechtigungen");var r=t.split("/")[2];users&&users[t]&&(r=users[t].name),userinfo._id==t&&(r=userinfo.name);var a=1,s=addHtmlValue("Benutzername",EscapeHtml(decodeURIComponent(r)));t.split("/")[2]!=r&&(s+=addHtmlValue("Benutzeridentifikation",EscapeHtml(t.split("/")[2]))),s+=addHtmlValue("Berechtigungen",o.join(", ")),userinfo._id!=t&&(4294967295==n||0!=(2&n)&&4294967295!=i)&&(a+=4),setDialogMode(2,"Gerätegruppenbenutzer",a,p20viewuserEx,s,t)}}}function p20viewuserEx(e,t){if(2==e){var n=t.split("/")[2];users&&users[t]&&(n=users[t].name),usergroups&&usergroups[t]&&(n=usergroups[t].name),userinfo._id==t&&(n=userinfo.name),t.startsWith("user/")&&setDialogMode(2,"Benutzerberechtigungen entziehen",3,p20viewuserEx2,format('Bestätigen Sie den Entzug von Rechten für Benutzer "{0}"?',EscapeHtml(decodeURIComponent(n))),t),t.startsWith("ugrp/")&&setDialogMode(2,"Benutzergruppenberechtigungen entziehen",3,p20viewuserEx2,format('Bestätigen Sie den Entzug von Rechten für Benutzergruppe "{0}"?',EscapeHtml(decodeURIComponent(n))),t)}}function p20deleteUser(e,t){return haltEvent(e),p20viewuserEx(2,decodeURIComponent(t)),!1}function p20viewuserEx2(e,t){meshserver.send({action:"removemeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:t})}function p20editmeshInviteCode(){if(xxdialogMode)return!1;var e,t=GetMeshRights(currentMesh),n=serverinfo.name;(-1!=n.indexOf(".")&&0==(2&features)||(n=window.location.hostname),1==serverinfo.https)?e="https://"+n+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"invite":e="http://"+n+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"invite";if(1&t){var i="Wenn diese Option aktiviert ist, können Einladungscodes von jedem Benutzer verwendet werden, um Geräte über den folgenden öffentlichen Link mit dieser Gerätegruppe zu verbinden:<br /><br />";i+='<div style=width:100%;text-align:center><a target=_blank href="'+e+'">'+e+"</a></div><br />",i+="<div style=margin-bottom:5px><label><input id=agentJoinCheck type=checkbox onclick=p20editmeshInviteCodeValidate() />Einladungscodes aktivieren</label></div>",i+=addHtmlValue("Codes einladen",'<input id=agentInviteCode style=width:236px onkeyup=p20editmeshInviteCodeValidate() placeholder="code1, code2, code3" />'),setDialogMode(2,"Codes einladen",3,p20editmeshInviteCodeEx,i+=addHtmlValue("Installationstyp","<select id=agentInviteType style=width:236px><option value=0>Hintergrund und interaktiv</option><option value=2>Nur Hintergrund</option><option value=1>Nur interaktiv</option></select>")),null!=currentMesh.invite&&(Q("agentJoinCheck").checked=!0,Q("agentInviteCode").value=currentMesh.invite.codes.join(", "),Q("agentInviteType").value=3&currentMesh.invite.flags),p20editmeshInviteCodeValidate()}else{i="Einladungscodes können von jedem verwendet werden, um Geräte über den folgenden öffentlichen Link mit dieser Gerätegruppe zu verbinden:<br /><br />";i+='<div style=width:100%;text-align:center><a target=_blank href="'+e+'">'+e+"</a></div><br />",i+=addHtmlValue("Codes einladen",currentMesh.invite.codes.join(", ")),setDialogMode(2,"Codes einladen",1,null,i+=addHtmlValue("Installationstyp",["Hintergrund und interaktiv","Nur Hintergrund","Nur interaktiv"][3&currentMesh.invite.flags]))}}function p20editmeshInviteCodeValidate(){var e=!0,t=Q("agentInviteCode").value.split(",");for(var n in t)t[n]=t[n].trim(),""==t[n]&&(e=!1);QE("agentInviteCode",Q("agentJoinCheck").checked),QE("agentInviteType",Q("agentJoinCheck").checked),QE("idx_dlgOkButton",0==Q("agentJoinCheck").checked||e)}function p20editmeshInviteCodeEx(){if(1==Q("agentJoinCheck").checked){var e=Q("agentInviteCode").value.split(",");for(var t in e)e[t]=e[t].trim();meshserver.send({action:"editmesh",meshid:currentMesh._id,invite:{codes:e,flags:parseInt(Q("agentInviteType").value)}})}else meshserver.send({action:"editmesh",meshid:currentMesh._id,invite:"*"})}function p20editMeshNotify(){if(xxdialogMode)return!1;var e=0;userinfo.links&&userinfo.links[currentMesh._id]&&userinfo.links[currentMesh._id].notify&&(e=userinfo.links[currentMesh._id].notify);return"<div><label><input id=p20notifyIntelDeviceConnect type=checkbox />Geräteverbindungen.</label></div>","<div><label><input id=p20notifyIntelDeviceDisconnect type=checkbox />Gerätetrennungen.</label></div>","<div><label><input id=p20notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT Desktop- und Seriell-Ereignisse.</label></div>",setDialogMode(2,"Benachrichtungseinstellungen",3,p20editMeshNotifyEx,"Benachrichtigungseinstellungen müssen ebenfalls in den Kontoeinstellungen eingeschaltet sein.<br /><br /><div><label><input id=p20notifyIntelDeviceConnect type=checkbox />Geräteverbindungen.</label></div><div><label><input id=p20notifyIntelDeviceDisconnect type=checkbox />Gerätetrennungen.</label></div><div><label><input id=p20notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT Desktop- und Seriell-Ereignisse.</label></div>"),Q("p20notifyIntelDeviceConnect").checked=2&e,Q("p20notifyIntelDeviceDisconnect").checked=4&e,Q("p20notifyIntelAmtKvmActions").checked=8&e,!1}function p20editMeshNotifyEx(){var e=0;e+=Q("p20notifyIntelDeviceConnect").checked?2:0,e+=Q("p20notifyIntelDeviceDisconnect").checked?4:0,e+=Q("p20notifyIntelAmtKvmActions").checked?8:0,meshserver.send({action:"changemeshnotify",meshid:currentMesh._id,notify:e})}function setupMeshSummaryStats(){var n=Chart.controllers.doughnut.prototype.draw;Chart.controllers.doughnut=Chart.controllers.doughnut.extend({draw:function(){n.apply(this,arguments);var e=this.chart.chart.ctx,t=e.fill;e.fill=function(){e.save(),e.shadowColor="blue",e.shadowBlur=10,e.shadowOffsetX=2,e.shadowOffsetY=2,t.apply(this,arguments),e.restore()}}}),window.meshPowerChart=new Chart(document.getElementById("meshPowerChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#20F","#40D","#60B","#809","#A07","#C05"]}]},options:{responsive:!0,legend:{position:"none"},animation:{animateScale:!0,animateRotate:!0},layout:{padding:{left:10,right:10,top:10,bottom:10}}}}),window.meshOsChart=new Chart(document.getElementById("meshOsChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#20F","#40D","#60B","#809","#A07","#C05"]}]},options:{responsive:!0,legend:{position:"none"},animation:{animateScale:!0,animateRotate:!0},layout:{padding:{left:10,right:10,top:10,bottom:10}}}}),window.meshConnChart=new Chart(document.getElementById("meshConnChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#20F","#40D","#60B","#809","#A07","#C05"]}],labels:["Getrennt","Agent","Intel AMT","Agent + Intel AMT"]},options:{responsive:!0,legend:{position:"none"},animation:{animateScale:!0,animateRotate:!0},layout:{padding:{left:10,right:10,top:10,bottom:10}}}})}function p21updateMesh(){if(null!=currentMesh){var e=GetMeshRights(currentMesh),t=EscapeHtml(currentMesh.name);0==t.length&&(t="<i>Kein(e)</i>"),0!=(1&e)&&(t='<span tabindex=0 title="Click here to edit the device group name" onclick=p20editmesh(1) onkeyup="if (event.key == \'Enter\') p20editmesh(1)" style=cursor:pointer>'+t+' <img class=hoverButton src="images/link5.png" /></span>'),QH("p21meshName",t);var n={},i={},o=[0,0,0,0],r=!1,a=!1,s=!1;for(var l in nodes)nodes[l].meshid==currentMesh._id&&(nodes[l].agent&&(r=!0,null==n[nodes[l].agent.id]?n[nodes[l].agent.id]=1:n[nodes[l].agent.id]++),nodes[l].pwr&&(a=!0,null==i[nodes[l].pwr]?i[nodes[l].pwr]=1:i[nodes[l].pwr]++),0==nodes[l].conn?(s=!0,o[0]++):0!=(6&nodes[l].conn)?(s=!0,0!=(1&nodes[l].conn)?o[3]++:o[2]++):0!=(1&nodes[l].conn)&&(s=!0,o[1]++));var d=[],c=[],u=[],p=[];for(var l in n)d.push(n[l]),c.push(agentsStr[l]);for(var l in i)u.push(i[l]),p.push(powerStatetable[l]);window.meshPowerChart.config.data.datasets[0].data=u,window.meshPowerChart.config.data.labels=p,window.meshPowerChart.update(),2==currentMesh.mtype&&(window.meshOsChart.config.data.datasets[0].data=d,window.meshOsChart.config.data.labels=c,window.meshOsChart.update()),window.meshConnChart.config.data.datasets[0].data=o,window.meshConnChart.update();var m="",g=0;if(0<u.length){var h=[];for(var l in i)h.push([powerStatetable[l],i[l]]);for(var l in h.sort(function(e,t){return-(e[1]-t[1])}),m+='<table style="margin-top:10px;color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Energiezustände</th><th scope=col style=text-align:left></th></tr>',h)m+="<tr style="+(++g%2==0?"background-color:#DDD":"")+"><td><divclass=m2></div><div>&nbsp;"+h[l][0]+"<div></div></div></td><td><div style=float:right>"+h[l][1]+" </div><div></div></td></tr>";m+="</tbody></table>"}if(0<d.length&&2==currentMesh.mtype){g=0;var v=[];for(var l in n)v.push([agentsStr[l],n[l]]);for(var l in v.sort(function(e,t){return-(e[1]-t[1])}),m+='<table style="margin-top:10px;color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Agent-Typen</th><th scope=col style=text-align:left></th></tr>',v)m+="<tr style="+(++g%2==0?"background-color:#DDD":"")+"><td><divclass=m2></div><div>&nbsp;"+v[l][0]+"<div></div></div></td><td><div style=float:right>"+v[l][1]+" </div><div></div></td></tr>";m+="</tbody></table>"}if(s){var f=[];for(l=g=0;l<4;l++)f.push([["Getrennt","Agent","Intel AMT","Agent + Intel AMT"][l],o[l]]);f.sort(function(e,t){return-(e[1]-t[1])}),m+='<table style="margin-top:10px;color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Konnektivität</th><th scope=col style=text-align:left></th></tr>';for(l=0;l<4;l++)0<f[l][1]&&(m+="<tr style="+(++g%2==0?"background-color:#DDD":"")+"><td><divclass=m2></div><div>&nbsp;"+f[l][0]+"<div></div></div></td><td><div style=float:right>"+f[l][1]+" </div><div></div></td></tr>");m+="</tbody></table>"}""==m&&(m="<i>Keine Geräte in dieser Gerätegruppe.</i>"),QH("p21info",m),QS("meshPowerChartDiv").display=a?"inline-block":"none",QS("meshOsChartDiv").display=2==currentMesh.mtype&&r?"inline-block":"none",QS("meshConnChartDiv").display=s?"inline-block":"none"}}var sortorder,filetreelocation=[];function updateFiles(){if(QV("MainMenuMyFiles",0==(8&features)),0==(8&features)){for(var e,t="",n="",i='<a href=# style=cursor:pointer onclick="return p5folderup(0)">Wurzel</a>',o="Root",r=filetree,a=1,s=[],l=filetreelinkpath,d=[],c=document.getElementsByName("fc"),u=0;u<c.length;u++)c[u].checked&&d.push(c[u].value);for(var u in filetreelinkpath="",filetreelocation){if(null==r.f||null==r.f[filetreelocation[u]])break;if(s.push(filetreelocation[u]),o+=" / "+filetreelocation[u],1==a){var p=filetreelocation[u].split("/");e=(""+window.location).split("?")[0]+p[0]+"files/"+p[2],filetreelinkpath+=filetreelocation[u]}else""!=filetreelinkpath&&(filetreelinkpath+="/"+filetreelocation[u],2<a&&(e+="/"+filetreelocation[u]));i+=' / <a href=# style=cursor:pointer onclick="return p5folderup('+a+')">'+(null!=(r=r.f[filetreelocation[u]]).n?r.n:filetreelocation[u])+"</a>",a++}filetreelocation=s;var m=o.toLowerCase().startsWith("root / "+userinfo._id+" / public"),g=p5sort_files(r.f);for(var u in g){var h,v=g[u],f=v.n;h=70<(h=f).length?'<span title="'+EscapeHtml(f)+'">'+EscapeHtml(f.substring(0,70))+"...</span>":EscapeHtml(f),f=EscapeHtml(f);var k="";if(null!=v.d)k=printDateTime(new Date(v.d))+"&nbsp;";var b="";null!=v.s&&(b=getFileSizeStr(v.s));var x="";if(v.t<3||4==v.t){x='<div class=filelist file=999><input file=999 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value="'+f+'">&nbsp;<span style=float:right title="">'+(1==v.t||4==v.t?p5getQuotabar(v):"")+"</span><span><div class=fileIcon"+v.t+' onclick=p5folderset("'+encodeURIComponentEx(v.nx)+'")></div><a href=# style=cursor:pointer onclick=\'return p5folderset("'+encodeURIComponentEx(v.nx)+"\")'>"+h+"</a></span></div>"}else{var y=h,w="";m&&(w='<img src="images/link2.png" style=cursor:pointer title="Öffentlichen Link anzeigen" onclick=\'return p5showPublicLink("'+e+"/"+encodeURIComponentEx(v.nx)+'?download=1")\' width=10 height=10 /> <img src="images/link4.png" title="Link in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(e+"/"+encodeURIComponentEx(v.nx)+"?download=1")+'") width=10 height=10>'),0<v.s&&(y=w+' <a rel="noreferrer noopener" target="_blank" download href="downloadfile.ashx?link='+encodeURIComponentEx(filetreelinkpath+"/"+v.nx)+'">'+h+"</a>"),x='<div class=filelist file=3><input file=3 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value="'+v.nx+'">&nbsp;<span class=fsize>'+k+"</span><span style=float:right>"+b+"</span><span><div class=fileIcon"+v.t+"></div>"+y+"</span></div>"}v.t<3?t+=x:n+=x}if(QH("p5rightOfButtons",p5getQuotabar(r)),QH("p5files",t+n),QH("p5currentpath",i),QE("p5FolderUp",0!=filetreelocation.length),QV("p5PublicShare",m),l==filetreelinkpath){c=document.getElementsByName("fc");for(u=0;u<c.length;u++)c[u].checked=0<=d.indexOf(c[u].value)}p5setActions()}}function getNiceSize(e){return e<=0?"Speicher-Begrenzung überschritten":e<2048?format("{0} Bytes verbleibend",e):e<2097152?format("{0} Kilobytes verbleibend",Math.round(e/1024)):e<2147483648?format("{0} Megabytes verbleibend",Math.round(e/1024/1024)):format("{0} Gigabytes verbleibend",Math.round(e/1024/1024/1024))}function getNiceSize2(e){return e<=0?"Kein(e)":e<2048?format("{0} B",e):e<2097152?format("{0} kB",Math.round(e/1024)):e<2147483648?format("{0} MB",Math.round(e/1024/1024)):format("{0} GB",Math.round(e/1024/1024/1024))}function p5getQuotabar(e){for(;1<e.t&&4!=e.t;)e=e.parent;if(1!=e.t&&4!=e.t||null==e.maxbytes)return"";var t=Math.floor(e.s/1024),n=e.maxbytes-e.s;return'<span title="'+(1<e.c?format("{0}k in {1} Dateien. {2}k maximal",t,e.c,Math.floor(e.maxbytes/1024/1024)):format("{0}k in 1 Datei. {1}k maximal",t,Math.floor(e.maxbytes/1024/1024)))+'">'+getNiceSize(n)+" <progress style=height:10px;width:100px value="+e.s+" max="+e.maxbytes+" /></span>"}function p5showPublicLink(e){return setDialogMode(2,"Öffentlicher Link",1,null,'<input type=text style=width:350px value="'+e+'" readonly /> <img src="images/link4.png" title="Link in Zwischenablage kopieren" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(e)+'") width=10 height=10>'),!1}function p5sort_filename(e,t){return e.ln>t.ln?1*sortorder:e.ln<t.ln?-1*sortorder:0}function p5sort_timestamp(e,t){return e.d>t.d?1*sortorder:e.d<t.d?-1*sortorder:0}function p5sort_bysize(e,t){return e.s==t.s?p5sort_filename(e,t):(e.s-t.s)*sortorder}function p5sort_files(e){var t=[],n=Q("p5sortdropdown").value;for(var i in e)e[i].nx=i,null==e[i].n&&(e[i].n=i),e[i].ln=e[i].n.toLowerCase(),t.push(e[i]);return sortorder=1,3<n&&(sortorder=-1,n-=3),1==n?t.sort(p5sort_filename):2==n?t.sort(p5sort_bysize):3==n&&t.sort(p5sort_timestamp),t}function p5setActions(){var e=getFileSelCount(),t=getFileCount(),n=getFileSelCount(!1);QE("p5DeleteFileButton",0<e&&0<filetreelocation.length),QE("p5NewFolderButton",0<filetreelocation.length),QE("p5UploadButton",0<filetreelocation.length),QE("p5RenameFileButton",1==e&&0<filetreelocation.length),QE("p5SelectAllButton",0<t),Q("p5SelectAllButton").value=0<e?"Auswahl aufheben":"Alle auswählen",QE("p5CutButton",0<n&&e==n),QE("p5CopyButton",0<n&&e==n),QE("p5PasteButton",null!=p5clipboard&&0<p5clipboard.length&&0<filetreelocation.length)}function getFileSelCount(e){for(var t=0,n=document.getElementsByName("fc"),i=0;i<n.length;i++)!n[i].checked||0==e&&"3"!=n[i].attributes.file.value||t++;return t}function getFileSelDirCount(){for(var e=0,t=document.getElementsByName("fc"),n=0;n<t.length;n++)t[n].checked&&"999"==t[n].attributes.file.value&&e++;return e}function getFileCount(){return document.getElementsByName("fc").length}function p5selectallfile(){for(var e=0==getFileSelCount(),t=document.getElementsByName("fc"),n=0;n<t.length;n++)t[n].checked=e;p5setActions()}function setupBackPointers(e){if(null!=e.f){var t=0,n=0;for(var i in e.f)setupBackPointers(e.f[i]),(e.f[i].parent=e).f[i].s&&(t+=e.f[i].s),e.f[i].c&&(n+=e.f[i].c),3==e.f[i].t&&n++;e.s=t,e.c=n}return e}function getFileSizeStr(e){return 1==e?"1 Byte":format("{0} Bytes",e)}function p5folderup(e){if(null==e)filetreelocation.pop();else for(;filetreelocation.length>e;)filetreelocation.pop();return updateFiles(),!1}function p5folderset(e){return filetreelocation.push(decodeURIComponent(e)),updateFiles(),!1}function p5createfolder(){setDialogMode(2,"Neuer Ordner",3,p5createfolderEx,"<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% />"),focusTextBox("p5renameinput"),p5fileNameCheck()}function p5createfolderEx(){meshserver.send({action:"fileoperation",fileop:"createfolder",path:filetreelocation,newfolder:Q("p5renameinput").value})}function p5deletefile(){var e=getFileSelCount(),t=0<getFileSelDirCount()?"<br /><br /><label><input type=checkbox id=p5recdeleteinput>Rekursiv Löschen</label><br>":"<input type=checkbox id=p5recdeleteinput style='display:none'>";setDialogMode(2,"Löschen",3,p5deletefileEx,1<e?format("{0} ausgewählte Elemente löschen?",e)+t:"Ausgewähltes Element löschen?"+t)}function p5deletefileEx(){for(var e=[],t=document.getElementsByName("fc"),n=0;n<t.length;n++)t[n].checked&&e.push(t[n].value);meshserver.send({action:"fileoperation",fileop:"delete",path:filetreelocation,delfiles:e,rec:Q("p5recdeleteinput").checked})}function p5renamefile(){for(var e,t=document.getElementsByName("fc"),n=0;n<t.length;n++)t[n].checked&&(e=t[n].value);setDialogMode(2,"Umbenennen",3,p5renamefileEx,'<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% value="'+e+'" />',{action:"fileoperation",fileop:"rename",path:filetreelocation,oldname:e}),focusTextBox("p5renameinput"),p5fileNameCheck()}function p5renamefileEx(e,t){t.newname=Q("p5renameinput").value,meshserver.send(t)}function p5fileNameCheck(e){var t=isFilenameValid(Q("p5renameinput").value);QE("idx_dlgOkButton",t),1==t&&e&&13==e.keyCode&&dialogclose(1)}var isFilenameValid=function(){var t=/^[^\\/:\*\?"<>\|]+$/,n=/^\./,i=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function(e){return t.test(e)&&!n.test(e)&&!i.test(e)&&"."!=e[0]}}();function p5uploadFile(){setDialogMode(2,"Datei hochladen",3,p5uploadFileEx,'<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value="'+encodeURIComponentEx(filetreelinkpath)+'" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="p5updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value='+authCookie+" /><input type=submit id=p5loginSubmit style=display:none /><span id=p5confirmOverwriteSpan style=display:none><br /><label><input type=checkbox id=p5confirmOverwrite onchange=\"p5updateUploadDialogOk('p5uploadinput')\" />Bestätigen Sie das Überschreiben?</label></span></form>"),p5updateUploadDialogOk("p5uploadinput")}function p5uploadFileEx(){Q("p5loginSubmit").click()}function p5updateUploadDialogOk(){var e=Q("p5uploadinput").files,t=[];for(var n in e)null!=e[n].size&&0!=e[n].size&&t.push(e[n]);var i=filetree,o=[],r=0;for(var n in filetreelocation)null!=i.f&&null!=i.f[filetreelocation[n]]&&(i=i.f[filetreelocation[n]]);if(QE("idx_dlgOkButton",0<e.length),0<e.length){if(null!=i.f){for(var n in i.f)o.push(n);for(n=0;n<e.length;n++)0<=o.indexOf(e[n].name)&&r++}QV("p5confirmOverwriteSpan",0<r),0<r?QE("idx_dlgOkButton",Q("p5confirmOverwrite").checked):(Q("p5confirmOverwrite").checked=!1,QE("idx_dlgOkButton",!0))}}var p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;function p5copyFile(e){var t=document.getElementsByName("fc");p5clipboard=[],p5clipboardCut=e,p5clipboardFolder=Clone(filetreelocation);for(var n=0;n<t.length;n++)t[n].checked&&"3"==t[n].attributes.file.value&&(console.log("yy",t[n].value),p5clipboard.push(t[n].value));p5updateClipview()}function p5pasteFile(){var e="";null!=p5clipboard&&0<p5clipboard.length&&(e=format("Bestätigen Sie das {0} von {1} Einträgen{2} an diesen Ort?",0==p5clipboardCut?"copy":"move",p5clipboard.length,1<p5clipboard.length?"s":"")),setDialogMode(2,"Einfügen",3,p5pasteFileEx,e)}function p5pasteFileEx(){meshserver.send({action:"fileoperation",fileop:0==p5clipboardCut?"copy":"move",scpath:p5clipboardFolder,path:filetreelocation,names:p5clipboard}),p5folderup(999),1==p5clipboardCut&&(p5clipboardFolder=p5clipboard=null,p5clipboardCut=0,p5updateClipview())}function p5updateClipview(){var e="";null!=p5clipboard&&0<p5clipboard.length&&(e=format("Halte {0} Einträge{1} zum {2}",p5clipboard.length,1<p5clipboard.length?"s":"",0==p5clipboardCut?"kopieren":"verschieben")+', <a href=# onclick="return p5clearClip()" style=cursor:pointer>Leeren</a>.'),QH("p5bottomstatus",e),p5setActions()}function p5clearClip(){return p5clipboardFolder=p5clipboard=null,p5clipboardCut=0,p5updateClipview(),!1}function p5fileDragDrop(e){if(!xxdialogMode&&(haltEvent(e),QV("bigfail",!1),QV("bigok",!1),null!=e.dataTransfer)){var t=[];for(var n in e.dataTransfer.files)null!=e.dataTransfer.files[n].size&&0!=e.dataTransfer.files[n].size&&t.push(e.dataTransfer.files[n]);if(0!=t.length){var i=filetree,o=[],r=0;for(var n in filetreelocation)null!=i.f&&null!=i.f[filetreelocation[n]]&&(i=i.f[filetreelocation[n]]);if(null!=i.f){for(var n in i.f)o.push(n);for(n=0;n<e.dataTransfer.files.length;n++)0<=o.indexOf(e.dataTransfer.files[n].name)&&r++}0==r?p5PerformUpload(1,t):setDialogMode(2,"Datei hochladen",3,p5PerformUpload,format(1==r?"Das Hochladen wird 1 Datei überschreiben. Fortfahren?":"Das Hochladen wird {0} Dateien überschreiben. Fortfahren?",r),t)}}}function p5PerformUpload(e,t){var n=0;p5uploadFile();try{Q("p5uploadinput").files=t}catch(e){n=1}if(0==n&&p5uploadFileEx(),setDialogMode(0),1==n){if(0==filetreelocation.length)return;for(var i=[],o=[],r=[],a=[],s=t.length,l=0,d=0;d<t.length;d++)l+=t[d].size;if(13e5<l)return void p5uploadFile();for(d=0;d<t.length;d++){var c=new FileReader,u=t[d];i.push(u.name),o.push(u.size),r.push(u.type),c.onload=function(e){a.push(e.target.result),0==--s&&(Q("p5fileDragName").value=i.join("*"),Q("p5fileDragSize").value=o.join("*"),Q("p5fileDragType").value=r.join("*"),Q("p5fileDragData").value=a.join("*"),Q("p5fileDragLink").value=encodeURIComponentEx(filetreelinkpath),Q("p5fileDragAuthCookie").value=authCookie,Q("p5loginSubmit2").click())},c.readAsDataURL(u)}}}var p5dragtimer=null;function p5fileDragOver(e){if(!xxdialogMode){haltEvent(e),null!=p5dragtimer&&(clearTimeout(p5dragtimer),p5dragtimer=null);var t=!0;0==filetreelocation.length&&(t=!1),QV("bigok",t),QV("bigfail",!t)}}function p5fileDragLeave(e){xxdialogMode||(haltEvent(e),"p5filetable"!=e.target.id?(QV("bigfail",!1),QV("bigok",!1)):p5dragtimer=setTimeout(function(){QV("bigfail",!1),QV("bigok",!1),p5dragtimer=null},10))}function eventMouseHover(e,t){e.children[1].classList.remove("g1s"),e.children[2].classList.remove("style10s"),e.children[3].classList.remove("g2s"),1==t&&(e.children[1].classList.add("g1s"),e.children[2].classList.add("style10s"),e.children[3].classList.add("g2s"))}function eventsUpdate(){var e="",t=null;for(var n in events){var i=events[n],o=new Date(i.time);if(i.msg){null==i.h&&(i.h=Math.random()),printDate(o)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(o))+"</td></tr>");var r="si3";"ugrp"==i.etype&&(r="m4"),"user"==i.etype&&(r="m2"),"server"==i.etype&&(r="si3");var a=EscapeHtml(i.msg).split("(R)").join("&reg;");if(i.nodeid){var s=getNodeFromId(i.nodeid);null!=s&&(r="si"+s.icon,a="<a href=# onclick='gotoDevice(\""+i.nodeid+"\",10);haltEvent(event);'>"+EscapeHtml(s.name)+"</a> &rarr; "+a)}i.username&&(a=2&userinfo.siteadmin&&i.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(i.userid)+"\");haltEvent(event);'>"+EscapeHtml(i.username)+"</a> &rarr; "+a:EscapeHtml(i.username)+" &rarr; "+a),"relay"!=i.etype&&"relaylog"!=i.action||(r="relayIcon16"),e+="<tr onclick=showEventDetails("+i.h+",2)  onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+r+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(o)+" - "+a+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>Keine Ereignisse vorhanden</i><br><br>"),QH("p3events",e)}function refreshEvents(){meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)})}function p3showDownloadEventsDialog(e){if(!xxdialogMode){var t="Die Ereignisliste in einem der folgenden Dateiformate herunterladen.<br /><br />";t+=addHtmlValue("CSV-Format",'<a href=# style=cursor:pointer onclick="return p3downloadEventsDialogCSV('+e+')">eventslist.csv</a>'),setDialogMode(2,"Ereignisliste exportieren",1,null,t+=addHtmlValue("JSON-Format",'<a href=# style=cursor:pointer onclick="return p3downloadEventsDialogJSON('+e+')">eventslist.json</a>'),e)}}function p3downloadEventsDialogCSV(e){var t,n;for(var i in 1==e&&(n=currentDeviceEvents),2==e&&(n=events),3==e&&(n=currentUserEvents),t="utc, Zeit, Typ, Aktion, Benutzer, Gerät, Nachricht\r\n",n){var o="";if(n[i].nodeid){var r=getNodeFromId(n[i].nodeid);r&&r.name&&(o=r.name)}t+='"'+n[i].time+'","'+printDateTime(new Date(n[i].time))+'","'+n[i].etype+'","'+(null!=n[i].action?n[i].action:"")+'","'+(null!=n[i].username?n[i].username:"")+'","'+EscapeHtml(o)+'","'+(null!=n[i].msg?n[i].msg:"").split(",").join(" -")+'"\r\n'}return saveAs(new Blob([t],{type:"application/octet-stream"}),"eventslist.csv"),!1}function p3downloadEventsDialogJSON(e){var t,n=[];for(var i in 1==e&&(t=currentDeviceEvents),2==e&&(t=events),3==e&&(t=currentUserEvents),t)n.push(events[i]);return saveAs(new Blob([JSON.stringify(n,null,2)],{type:"application/octet-stream"}),"eventslist.json"),!1}function updateUsers(){if(QV("UserNewAccountButton",0==(4&features)&&0==serverinfo.domainauth),null!=users&&0==(4&features)){var e=[],t=100,n=0;for(var i in users)e.push(users[i]);e.sort(nameSort);var o=Q("UserSearchInput").value.toLowerCase(),r=o;o.startsWith("email:")?(o=null,r=r.substring(6)):o.startsWith("name:")?(r=null,o=o.substring(5)):o.startsWith("e:")?(o=null,r=r.substring(2)):o.startsWith("n:")&&(r=null,o=o.substring(2));var a="<table class=p3usersTable cellpadding=0 cellspacing=0>",s=!0;a+="<th>Name<th style=width:80px>Gerätegruppen<th style=width:120px>"+nobreak("Letzter Zugriff")+"<th style=width:120px>Berechtigungen";var l=[],d=document.getElementsByClassName("UserCheckbox");for(i=0;i<d.length;i++)d[i].checked&&l.push(d[i].value);for(var i in e){var c=e[i],u=null;null!=wssessions&&(u=wssessions[c._id]),null!=u&&(null!=o&&(""==o||0<=c.name.toLowerCase().indexOf(o))||null!=r&&null!=c.email&&0<=c.email.toLowerCase().indexOf(r))&&(0<t?(s&&(a+="<tr><td class=userTableHeader colspan=4>Benutzer online",s=!1),a+=addUserHtml(c,u),t--):n++)}for(var i in s=!0,e){c=e[i],u=null;null!=wssessions&&(u=wssessions[c._id]),null==u&&(null!=o&&(""==o||0<=c.name.toLowerCase().indexOf(o))||null!=r&&null!=c.email&&0<=c.email.toLowerCase().indexOf(r))&&(0<t?(s&&(a+="<tr><td class=userTableHeader colspan=4>Benutzer offline",s=!1),a+=addUserHtml(c,u),t--):n++)}a+="</table>",1==n?a+="<br />1 weiterer Benutzer nicht angezeigt, Suchfeld verwenden um weitere Benutzer zu suchen...<br />":1<n&&(a+="<br />"+format("{0} weitere Benutzer nicht angezeigt, Suchfeld verwenden um weitere Benutzer zu suchen...",n)+"<br />"),100==t&&(a+="<br />Keine Benutzer gefunden.<br />"),QH("p3users",a),d=document.getElementsByClassName("UserCheckbox");var p=encodeURIComponentEx(userinfo._id);for(i=0;i<d.length;i++)d[i].checked=0<=l.indexOf(d[i].value)&&d[i].value!=p;p3updateInfo(),null!=currentUser&&30==xxcurrentView&&gotoUser(encodeURIComponentEx(currentUser._id),!0)}else QH("p3users","")}function addUserHtml(e,t){var n="",i=" gray",o="",r=e._id!=userinfo._id,a="",s="";null!=t?(i="",r&&(o='<span style=float:right;margin-top:1px;margin-right:4px title=Chat><a href=# onclick=userChat(event,"'+encodeURIComponentEx(e._id)+'","'+encodeURIComponentEx(e.name)+"\")><img src='images/icon-chat.png' height=16 width=16 style=padding-top:2px /></a></span>",o+="<span style=float:right;margin-top:1px;margin-left:4px;margin-right:4px title=Notify><a href=# onclick='return showUserAlertDialog(event,\""+encodeURIComponentEx(e._id)+"\")'><img src='images/icon-notify.png' height=16 width=16 style=padding-top:2px /></a></span>"),a+=nobreak(1==t?"1 Sitzung":format("{0} Sitzungen",t))):e.login&&(a+='<span title="'+format("Letzte Anmeldung: {0}",printDateTime(new Date(1e3*e.login)))+'">'+printDate(new Date(1e3*e.login))+"</span>"),r&&(s+="<a href=# style=cursor:pointer onclick='return showUserAdminDialog(event,\""+encodeURIComponentEx(e._id)+"\")'>"),null!=e.siteadmin&&0!=(32&e.siteadmin)&&4294967295!=e.siteadmin&&(s+="Gesperrt,&nbsp;"),s+="<span title='Server-Berechtigungen'>";var l=4294967071&e.siteadmin;null==e.siteadmin||0==l?s+="Benutzer":8==l?s+="Benutzer + Dateien":4294967295==e.siteadmin?s+="Administrator":s+=0!=(2&l)?"Verwalter":"Partiell",null!=e.siteadmin&&4294967295!=e.siteadmin&&0!=(192&e.siteadmin)&&(s+="*"),s+="</span>",r&&(s+="</a>");var d=0;if(e.links)for(var c in e.links)c.startsWith("mesh/")&&d++;var u=EscapeHtml(e.name),p="";if(1==serverinfo.emailcheck&&(p=1!=e.emailVerified?' <b style=color:red title="E-Mail ist nicht verifiziert">&#x2717;</b>':' <b style=color:green title="E-Mail ist bestätigt">&#x2713</b>'),null!=e.email&&(0==(2097152&features)||e.email.toLowerCase()!=e.name.toLowerCase()?u+=', <a href="mailto:'+e.email+"\" '>"+e.email+"</a>"+p:u+=' <a href="mailto:'+e.email+'" \'><img src="images/mail12.png" height=9 width=12 title="E-Mail an Benutzer senden" style="margin-top:2px" /></a>'+p),null!=serverinfo.crossDomain){var m=e._id.split("/")[1];""!=m&&(u+=", <span style=color:#26F>"+m+"</span>")}return(0<e.otpsecret||0<e.otphkeys||1==e.otpekey&&8388608&features||null!=e.phone&&67108864&features)&&(u+=' <img src="images/key12.png" height=12 width=11 title="Zweifaktorauthentifizierung eingeschaltet" style="margin-top:2px" />'),null!=e.phone&&(u+=' <img src="images/phone12.png" height=12 width=7 title="Verified phone number" style="margin-top:2px" />'),null!=e.siteadmin&&0!=(32&e.siteadmin)&&4294967295!=e.siteadmin&&(u+=' <img src="images/padlock12.png" height=12 width=8 title="Konto ist gesperrt" style="margin-top:2px" />'),n+="<tr tabindex=0 onmouseover=userMouseHover(this,1) onmouseout=userMouseHover(this,0) onkeypress=\"if (event.key=='Enter') gotoUser('"+encodeURIComponentEx(e._id)+"')\"><td>",n+="<div class=bar>",n+="<div class=baricon><input class=UserCheckbox value="+encodeURIComponentEx(e._id)+" onclick=p3updateInfo() type=checkbox"+(e._id==userinfo._id?" disabled":"")+'></div><div style=cursor:pointer onclick=gotoUser("'+encodeURIComponentEx(e._id)+'",false,event)>',n+='<div class=baricon><div class="m2'+i+'"></div></div>',n+="<div class=g1></div><div class=g2></div><div>",n+="<div><span>"+u+"</span>"+o+"</div></div><td style=text-align:center>"+d+"<td style=text-align:center>"+a+"<td style=text-align:center>"+s}function p3updateInfo(){for(var e=document.getElementsByClassName("UserCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;QE("UsersGroupActionButton",0<t),Q("UsersSelectAllButton").value=0<t?"Auswahl aufheben":"Alle auswählen"}function p3usersSelectallButtonFunction(){for(var e=encodeURIComponentEx(userinfo._id),t=document.getElementsByClassName("UserCheckbox"),n=0,i=0;i<t.length;i++)!0===t[i].checked&&n++;for(i=0;i<t.length;i++)t[i].checked=0==n&&t[i].value!=e;p3updateInfo()}function p3usersGroupActionFunction(){for(var e=document.getElementsByClassName("UserCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;if(0!=t){var i="Wählen Sie eine Operation für die Durchführung auf alle ausgewählten Benutzer.<br /><br />";setDialogMode(2,"Gruppenaktion",3,p3usersGroupActionFunctionEx,i+=addHtmlValue("Vorgang","<select style=width:240px id=d3groupop><option value=1>Konto sperren</option><option value=2>Konto entsperren</option><option value=3>Konto löschen</option></select>"))}}function p3usersGroupActionFunctionEx(){for(var e=document.getElementsByClassName("UserCheckbox"),t=[],n=0;n<e.length;n++)!0===e[n].checked&&t.push(decodeURIComponent(e[n].value));var i=Q("d3groupop").value;if(1==i)for(var n in t){0==(32&(r=null==(o=users[t[n]]).siteadmin?0:o.siteadmin))&&(r+=32,meshserver.send({action:"edituser",id:o._id,siteadmin:r}))}else if(2==i)for(var n in t){var o,r;0!=(32&(r=null==(o=users[t[n]]).siteadmin?0:o.siteadmin))&&(r-=32,meshserver.send({action:"edituser",id:o._id,siteadmin:r}))}else if(3==i){"<label><input id=d3check type=checkbox onchange=p3usersGroupActionFunctionDelCheck() />Bestätigen</label>",setDialogMode(2,"Konten löschen",3,p3groupActionFunctionDelExec,"Bestätigen Sie das Löschen der gewählten Konten?<br /><br /><label><input id=d3check type=checkbox onchange=p3usersGroupActionFunctionDelCheck() />Bestätigen</label>"),QE("idx_dlgOkButton",!1)}}function p3usersGroupActionFunctionDelCheck(){QE("idx_dlgOkButton",Q("d3check").checked)}function p3groupActionFunctionDelExec(e){for(var t=document.getElementsByClassName("UserCheckbox"),n=[],i=0;i<t.length;i++)!0===t[i].checked&&n.push(decodeURIComponent(t[i].value));for(var i in n){var o=users[n[i]];meshserver.send({action:"deleteuser",userid:o._id,username:o.name})}}function userMouseHover(e,t){var n=e.children[0].children[0].children[1];n.children[1].classList.remove("g1s"),n.children[2].classList.remove("g2s"),e.children[0].children[0].classList.remove("sbar"),1==t&&(n.children[1].classList.add("g1s"),n.children[2].classList.add("g2s"),e.children[0].children[0].classList.add("sbar"))}function userMouseHover2(e,t){var n=e.children[0].children[0];n.children[2].classList.remove("g1s"),n.children[3].classList.remove("g2s"),e.children[0].children[0].classList.remove("sbar"),1==t&&(n.children[2].classList.add("g1s"),n.children[3].classList.add("g2s"),e.children[0].children[0].classList.add("sbar"))}function userChat(e,t,n){haltEvent(e);var i="/messenger?id=meshmessenger/"+t+"/"+encodeURIComponentEx(userinfo._id)+"&title="+n;return null!=authCookie&&""!=authCookie&&(i+="&auth="+authCookie),window.open(i,"meshmessenger:"+t),meshserver.send({action:"meshmessenger",userid:decodeURIComponent(t)}),!1}function showSendSMS(e){xxdialogMode||(setDialogMode(2,"Send SMS",3,showSendSMSEx,"<textarea id=d2smsText maxlength=160 style=background-color:#fcf3cf;width:100%;height:100px;resize:none onKeyUp=showSendSMSValidate()></textarea><span style=font-size:10px><span>",e),Q("d2smsText").focus(),showSendSMSValidate())}function showSendSMSValidate(){QE("idx_dlgOkButton",0<Q("d2smsText").value.length)}function showSendSMSEx(e,t){0<Q("d2smsText").value.length&&meshserver.send({action:"smsuser",userid:decodeURIComponent(t),msg:Q("d2smsText").value})}function showSendEmail(e){if(!xxdialogMode){'<textarea id=d2emailText maxlength=10000 style="background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:auto" onKeyUp=showSendEmailValidate()></textarea>',setDialogMode(2,"Send Email",3,showSendEmailEx,'<input id=d2emailSubject style=background-color:#fcf3cf;width:100% placeholder="Subject"></input><textarea id=d2emailText maxlength=10000 style="background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:auto" onKeyUp=showSendEmailValidate()></textarea>',e),Q("d2emailSubject").focus(),showSendEmailValidate()}}function showSendEmailValidate(){QE("idx_dlgOkButton",0<Q("d2emailSubject").value.length&&0<Q("d2emailText").value.length)}function showSendEmailEx(e,t){0<Q("d2emailText").value.length&&meshserver.send({action:"emailuser",userid:decodeURIComponent(t),subject:Q("d2emailSubject").value,msg:Q("d2emailText").value})}function showUserAlertDialog(e,t){if(!xxdialogMode)return haltEvent(e),setDialogMode(2,format("{0} benachrichtigen",EscapeHtml(users[decodeURIComponent(t)].name)),3,showUserAlertDialogEx,'Sende eine Textbenachrichtigung an diesen Benutzer.<textarea id=d2notifyText maxlength=2048 style="width:100%;height:184px;resize:none"></textarea>',t),Q("d2notifyText").focus(),!1}function showUserAlertDialogEx(e,t){meshserver.send({action:"notifyuser",userid:decodeURIComponent(t),msg:Q("d2notifyText").value})}function p4batchAccountCreate(){if(!xxdialogMode){setDialogMode(2,"Benutzerkonten-Import",3,p4batchAccountCreateEx,'Erzeuge viele Konten auf einmal durch Import einer JSON-Datei mit dem folgenden Format:<br /><pre>[\r\n {"user":"x1","pass":"x","email":"x1@x"},\r\n {"user":"x2","pass":"x","resetNextLogin":true}\r\n]</pre><input style=width:370px type=file id=d4importFile accept=".json" onchange=p4batchAccountCreateValidate() />'),QE("idx_dlgOkButton",!1)}}function p4batchAccountCreateValidate(){QE("idx_dlgOkButton",null!=Q("d4importFile").value)}function p4batchAccountCreateEx(){var e=new FileReader;e.onload=function(e){var t=null;try{t=JSON.parse(e.target.result)}catch(e){return void setDialogMode(2,"Benutzerkonten-Import",1,null,format("Ungültige JSON-Datei: {0}.",e))}if(null!=t&&Array.isArray(t)){var n=!0;for(var i in t)("string"!=typeof t[i].user||t[i].user.length<1||64<t[i].user.length)&&(n=!1),("string"!=typeof t[i].pass||t[i].pass.length<1||256<t[i].pass.length)&&(n=!1),0==checkPasswordRequirements(t[i].pass,passRequirements)&&(n=!1),null!=t[i].email&&("string"!=typeof t[i].email||t[i].email.length<1||128<t[i].email.length)&&(n=!1);0==n?setDialogMode(2,"Benutzerkonten-Import",1,null,"Ungültiges JSON-Dateiformat."):meshserver.send({action:"adduserbatch",users:t})}else setDialogMode(2,"Benutzerkonten-Import",1,null,"Ungültiges JSON-Dateiformat.")},e.readAsText(Q("d4importFile").files[0])}function p4downloadUserInfo(){if(!xxdialogMode){var e="Die Benutzerliste in einem der folgenden Dateiformate herunterladen.<br /><br />";e+=addHtmlValue("CSV-Format","<a href=# style=cursor:pointer onclick='return p4downloadUserInfoCSV()'>userlist.csv</a>"),setDialogMode(2,"Benutzerlistenexport",1,null,e+=addHtmlValue("JSON-Format","<a href=# style=cursor:pointer onclick='return p4downloadUserInfoJSON()'>userlist.json</a>"))}}function p4downloadUserInfoCSV(){var e="ID, Name, E-Mail, Erstellung, Lastlogin, Gruppen, Authfaktoren\r\n";for(var t in users){var n=!1,i=[];(0<users[t].otpsecret||0<users[t].otphkeys)&&(n=!0,0<users[t].otpsecret&&i.push("AuthApp"),0<users[t].otphkeys&&i.push("SecurityKey"),0<users[t].otpkeys&&i.push("BackupCodes")),e+='"'+users[t]._id+'","'+users[t].name+'","'+(users[t].email?users[t].email:"")+'","'+(users[t].creation?new Date(1e3*users[t].creation):"")+'","'+(users[t].login?new Date(1e3*users[t].login):"")+'","'+(users[t].groups?users[t].groups.join(","):"")+'","'+(n?i.join(","):"")+'"\r\n'}return saveAs(new Blob([e],{type:"application/octet-stream"}),"userlist.csv"),!1}function p4downloadUserInfoJSON(){var e=[];for(var t in users)e.push(users[t]);return saveAs(new Blob([JSON.stringify(e,null,2)],{type:"application/octet-stream"}),"userlist.json"),!1}function showUserBroadcastDialog(e){if(!xxdialogMode){setDialogMode(2,"Rundruf-Nachricht",3,showUserBroadcastDialogEx,'Eine Nachricht an alle verbundenen Benutzer senden.<textarea id=broadcastMessage value="" maxlength="256"/></textarea>',e?decodeURIComponent(e):null),Q("broadcastMessage").focus()}}function showUserBroadcastDialogEx(e,t){meshserver.send({action:"userbroadcast",msg:Q("broadcastMessage").value,target:t})}function showCreateNewAccountDialog(){if(!xxdialogMode){var e="";if(serverinfo.crossDomain){var t="<select style=width:240px id=p4domain>";for(var n in serverinfo.crossDomain)t+="<option value="+n+">"+(""==serverinfo.crossDomain[n]?"Default":EscapeHtml(serverinfo.crossDomain[n]))+"</option>";e+=addHtmlValue("Domain",t+="</select>")}if(0==(2097152&features)&&(e+=addHtmlValue("<span id=p4hname>Benutzername</span>","<input id=p4name maxlength=64 autocomplete=username onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />")),e+=addHtmlValue("<span id=p4hemail>E-Mail</span>",'<input id=p4email maxlength=256 autocomplete="email" inputmode="email" onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />'),e+=addHtmlValue("<span id=p4hp1>Passwort</span>",'<input id=p4pass1 type=password maxlength=256 autocomplete="new-password" onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />'),e+=addHtmlValue("<span id=p4hp2>Passwort</span>",'<input id=p4pass2 type=password maxlength=256 autocomplete="new-password" onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />'),e+="<div><label><input id=p4randomPassword onchange=showCreateNewAccountDialogValidate() type=checkbox />Das Passwort randomisieren.</label></div>",e+="<div><label><input id=p4removeEvents onchange=showCreateNewAccountDialogValidate() type=checkbox />Alle vorhergehenden Ereignisse für diese Benutzer-ID entfernen.</label></div>",e+="<div><label><input id=p4resetNextLogin onchange=showCreateNewAccountDialogValidate() type=checkbox />Passwort beim nächsten Login zurücksetzen.</label></div>",serverinfo.emailcheck&&(e+="<div><label><input id=p4verifiedEmail onchange=showCreateNewAccountDialogValidate() type=checkbox />E-Mail ist bestätigt.</label></div>",e+="<div><label><input id=p4invitationEmail type=checkbox title=Email verified and forced password reset required. />Sende Einladungs-E-Mail.</label></div>"),passRequirements){var i=[],o=0;for(var n in passRequirements)"reset"!=n&&"hint"!=n&&(i.push(n+":"+passRequirements[n]),o++);0<o&&(e+="<div style=font-size:x-small;padding:6px>"+format("Voraussetzungen: {0}.",i.join(", "))+"</div>")}setDialogMode(2,"Konto erstellen",3,showCreateNewAccountDialogEx,e),showCreateNewAccountDialogValidate(),0==(2097152&features)?Q("p4name").focus():Q("p4email").focus()}}function showCreateNewAccountDialogValidate(){var e=validateEmail(Q("p4email").value),t=!0,n=0<Q("p4pass1").value.length&&Q("p4pass1").value==Q("p4pass2").value&&checkPasswordRequirements(Q("p4pass1").value,passRequirements);0==(2097152&features)&&(t=!Q("p4name")||0<Q("p4name").value.length&&-1==Q("p4name").value.indexOf(" "),QS("p4hname").color=t?"black":"#7b241c"),QS("p4hemail").color=e?"black":"#7b241c",serverinfo.emailcheck&&(QE("p4verifiedEmail",e),QE("p4invitationEmail",e&&Q("p4resetNextLogin").checked&&Q("p4verifiedEmail").checked),0==e&&(Q("p4verifiedEmail").checked=!1),0!=Q("p4resetNextLogin").checked&&0!=Q("p4verifiedEmail").checked||(Q("p4invitationEmail").checked=!1)),QE("p4pass1",!Q("p4randomPassword").checked),QE("p4pass2",!Q("p4randomPassword").checked),QS("p4hp1").color=n||Q("p4randomPassword").checked?"black":"#7b241c",QS("p4hp2").color=n||Q("p4randomPassword").checked?"black":"#7b241c";var i=t&e;0==Q("p4randomPassword").checked&&(i&=n),QE("idx_dlgOkButton",i)}function showCreateNewAccountDialogEx(){var e={action:"adduser",username:0==(2097152&features)?Q("p4name").value:Q("p4email").value,email:Q("p4email").value,pass:Q("p4pass1").value,resetNextLogin:Q("p4resetNextLogin").checked,randomPassword:Q("p4randomPassword").checked,removeEvents:Q("p4removeEvents").checked};serverinfo.emailcheck&&(e.emailVerified=Q("p4verifiedEmail").checked,e.emailInvitation=Q("p4invitationEmail").checked),serverinfo.crossDomain&&(e.domain=serverinfo.crossDomain[parseInt(Q("p4domain").value)]),meshserver.send(e)}function showUserGroupDialog(e,t){if(!xxdialogMode){haltEvent(e),t=decodeURIComponent(t);var n=users[t.toLowerCase()],i="";null!=n.groups&&(i=n.groups.join(", "));var o="Geben Sie eine durch Kommas getrennte Liste der Namen der Verwaltungsbereiche ein.<br /><br />";return setDialogMode(2,"Administrative Bereiche",3,showUserGroupDialogEx,o+=addHtmlValue("Bereiche",'<input id=dp4usergroups style=width:230px value="'+i+'" placeholder="Name1, Name2, Name3" maxlength=256 onchange=p4validateUserGroups() onkeyup=p4validateUserGroups() />'),n),focusTextBox("dp4usergroups"),p4validateUserGroups(),!1}}function p4validateUserGroups(){var e=Q("dp4usergroups").value,t=0,n=e.indexOf('"')+e.indexOf("/")+e.indexOf(">")+e.indexOf("<")+e.indexOf("'"),i=e.split(",");for(var o in i)0==i[o].trim().length&&t++;QE("idx_dlgOkButton",""==e||-5==n&&t<1)}function showUserGroupDialogEx(e,t){var n=Q("dp4usergroups").value.split(","),i=[];for(var o in n){var r=n[o].trim();0<r.length&&i.push(r)}meshserver.send({action:"edituser",id:t._id,groups:i})}function showUserAdminDialog(e,t){if(!xxdialogMode){haltEvent(e),t=decodeURIComponent(t);var n=users[t.toLowerCase()];if(null!=n){var i=userinfo._id==n._id;return"<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>Server-Dateien</label>, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 id=ua_fileaccessquota>k max, leer für Standard<br><hr/>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>Gesamtadministrator</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>Server-Datensicherung</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>Server-Wiederherstellung</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>Server-Aktualisierungen</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>Benutzer verwalten</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusergroups>Benutzergruppen verwalten</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_managerecordings>Manage Recordings</label><br>","<hr/></div><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_lockedaccount>Konto sperren</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nonewgroups>Keine neuen Gerätegruppen</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nomeshcmd>Keine Werkzeuge (MeshCmd/Router)</label><br>","</div>",setDialogMode(2,"Server-Berechtigungen",2+(i?0:1),showUserAdminDialogEx,"<div><div id=d2AdminPermissions><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>Server-Dateien</label>, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 id=ua_fileaccessquota>k max, leer für Standard<br><hr/><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>Gesamtadministrator</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>Server-Datensicherung</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>Server-Wiederherstellung</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>Server-Aktualisierungen</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>Benutzer verwalten</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusergroups>Benutzergruppen verwalten</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_managerecordings>Manage Recordings</label><br><hr/></div><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_lockedaccount>Konto sperren</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nonewgroups>Keine neuen Gerätegruppen</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nomeshcmd>Keine Werkzeuge (MeshCmd/Router)</label><br></div>",n),n.siteadmin&&0!=n.siteadmin&&(Q("ua_fulladmin").checked=4294967295==n.siteadmin,Q("ua_serverbackup").checked=4294967295!=n.siteadmin&&0!=(1&n.siteadmin),Q("ua_manageusers").checked=4294967295!=n.siteadmin&&0!=(2&n.siteadmin),Q("ua_serverrestore").checked=4294967295!=n.siteadmin&&0!=(4&n.siteadmin),Q("ua_fileaccess").checked=4294967295!=n.siteadmin&&0!=(8&n.siteadmin),Q("ua_serverupdate").checked=4294967295!=n.siteadmin&&0!=(16&n.siteadmin),Q("ua_lockedaccount").checked=4294967295!=n.siteadmin&&0!=(32&n.siteadmin),Q("ua_nonewgroups").checked=4294967295!=n.siteadmin&&0!=(64&n.siteadmin),Q("ua_nomeshcmd").checked=4294967295!=n.siteadmin&&0!=(128&n.siteadmin),Q("ua_manageusergroups").checked=4294967295!=n.siteadmin&&0!=(256&n.siteadmin),Q("ua_managerecordings").checked=4294967295!=n.siteadmin&&0!=(512&n.siteadmin)),QE("ua_fulladmin",!i&&4294967295==userinfo.siteadmin),QE("ua_serverbackup",!i&&4294967295==userinfo.siteadmin),QE("ua_manageusers",!i&&4294967295==userinfo.siteadmin),QE("ua_manageusergroups",!i&&4294967295==userinfo.siteadmin),QE("ua_managerecordings",!i&&4294967295==userinfo.siteadmin),QE("ua_serverrestore",!i&&4294967295==userinfo.siteadmin),QE("ua_fileaccess",!i&&4294967295==userinfo.siteadmin),QE("ua_fileaccessquota",!i&&4294967295==userinfo.siteadmin),QE("ua_serverupdate",!i&&4294967295==userinfo.siteadmin),QV("d2AdminPermissions",4294967295==userinfo.siteadmin),QE("ua_lockedaccount",!i&&2&userinfo.siteadmin&&4294967295!=n.siteadmin&&userinfo._id!=n._id),QE("ua_nonewgroups",!i&&2&userinfo.siteadmin&&4294967295!=n.siteadmin&&userinfo._id!=n._id),QE("ua_nomeshcmd",!i&&2&userinfo.siteadmin&&4294967295!=n.siteadmin&&userinfo._id!=n._id),Q("ua_fileaccessquota").value=null!=n.quota?n.quota/1024:"",showUserAdminDialogValidate(),!1}}}function showUserAdminDialogValidate(){4294967295==userinfo.siteadmin&&(QE("ua_serverbackup",!Q("ua_fulladmin").checked),QE("ua_manageusers",!Q("ua_fulladmin").checked),QE("ua_serverrestore",!Q("ua_fulladmin").checked),QE("ua_fileaccess",!Q("ua_fulladmin").checked),QE("ua_serverupdate",!Q("ua_fulladmin").checked),QE("ua_lockedaccount",!Q("ua_fulladmin").checked),QE("ua_nonewgroups",!Q("ua_fulladmin").checked),QE("ua_nomeshcmd",!Q("ua_fulladmin").checked),QE("ua_manageusergroups",!Q("ua_fulladmin").checked&&Q("ua_manageusers").checked),QE("ua_fileaccessquota",Q("ua_fileaccess").checked&&!Q("ua_fulladmin").checked),QE("ua_managerecordings",!Q("ua_fulladmin").checked))}function showUserAdminDialogEx(e,t){var n=0,i=parseInt(Q("ua_fileaccessquota").value);1==Q("ua_fulladmin").checked?n=4294967295:(1==Q("ua_serverbackup").checked&&(n+=1),1==Q("ua_manageusers").checked&&(n+=2),1==Q("ua_serverrestore").checked&&(n+=4),1==Q("ua_fileaccess").checked&&(n+=8),1==Q("ua_serverupdate").checked&&(n+=16),1==Q("ua_lockedaccount").checked&&(n+=32),1==Q("ua_nonewgroups").checked&&(n+=64),1==Q("ua_nomeshcmd").checked&&(n+=128),1==Q("ua_manageusergroups").checked&&(n+=256),1==Q("ua_managerecordings").checked&&(n+=512));var o={action:"edituser",id:t._id,siteadmin:n};0==isNaN(i)&&(o.quota=1024*i),meshserver.send(o)}function onUserSearchInputChanged(){masterUpdate(16384)}function updateUserGroups(){var e=[],t="";if(usergroups)for(var n in usergroups)e.push(usergroups[n]);e.sort(nameSort);var i=[],o=document.getElementsByClassName("UserGroupCheckbox");for(n=0;n<o.length;n++)o[n].checked&&i.push(o[n].value);if(0==e.length)t+="<br />Keine Gruppen gefunden.<br />",QV("DuplicateUserGroupButton",!1);else{for(var n in t+="<table class=p3usersTable cellpadding=0 cellspacing=0>",t+="<th>Name<th style=width:80px>Benutzer<th style=width:80px>Gerätegruppen<th style=width:80px>Geräte",e)t+=addUserGroupHtml(e[n]);t+="</table>",QV("DuplicateUserGroupButton",!0)}QH("p50groups",t),o=document.getElementsByClassName("UserGroupCheckbox");for(n=0;n<o.length;n++)o[n].checked=0<=i.indexOf(o[n].value);p50updateInfo(),null!=currentUserGroup&&51==xxcurrentView&&gotoUserGroup(encodeURIComponentEx(currentUserGroup._id),!0)}function addUserGroupHtml(e){var t=0,n=0,i=0;if(e.links)for(var o in e.links)o.startsWith("user/")&&t++,o.startsWith("mesh/")&&n++,o.startsWith("node/")&&i++;var r=EscapeHtml(e.name);if(null!=serverinfo.crossDomain){var a=e._id.split("/")[1];""!=a&&(r+=", <span style=color:#26F>"+EscapeHtml(a)+"</span>")}var s="<tr tabindex=0 onmouseover=userMouseHover2(this,1) onmouseout=userMouseHover2(this,0) onkeypress=\"if (event.key=='Enter') gotoUserGroup('"+encodeURIComponentEx(e._id)+"')\"><td style=cursor:pointer>";return s+="<div class=bar style=width:100%>",s+="<div class=baricon><input class=UserGroupCheckbox value="+encodeURIComponentEx(e._id)+" onclick=p50updateInfo() type=checkbox></div>",s+='<div class=baricon onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")><div class=m4></div></div>',s+='<div class=g1 onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")></div><div class=g2 onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")></div>',s+='<div onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")><span style=font-size:16px>'+r+"</span></div></div><td style=text-align:center>"+t+"<td style=text-align:center>"+n+"<td style=text-align:center>"+i}function p50updateInfo(){for(var e=document.getElementsByClassName("UserGroupCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;QE("UsersGroupsGroupActionButton",0<t),Q("UsersGroupsSelectAllButton").value=0<t?"Auswahl aufheben":"Alle auswählen"}function p50usersSelectallButtonFunction(){for(var e=encodeURIComponentEx(userinfo._id),t=document.getElementsByClassName("UserGroupCheckbox"),n=0,i=0;i<t.length;i++)!0===t[i].checked&&n++;for(i=0;i<t.length;i++)t[i].checked=0==n&&t[i].value!=e;p50updateInfo()}function p50usersGroupActionFunction(){for(var e=document.getElementsByClassName("UserGroupCheckbox"),t=0,n=0;n<e.length;n++)!0===e[n].checked&&t++;if(0!=t){var i="Wählen Sie eine Operation für die Durchführung auf alle ausgewählten Benutzer.<br /><br />";setDialogMode(2,"Gruppenaktion",3,p50usersGroupActionFunctionEx,i+=addHtmlValue("Vorgang","<select style=width:240px id=d50groupop><option value=1>Gruppe löschen</option></select>"))}}function p50usersGroupActionFunctionEx(){for(var e=document.getElementsByClassName("UserGroupCheckbox"),t=[],n=0;n<e.length;n++)!0===e[n].checked&&t.push(decodeURIComponent(e[n].value));if(1==Q("d50groupop").value){"<label><input id=d3check type=checkbox onchange=p50usersGroupActionFunctionDelCheck() />Bestätigen</label>",setDialogMode(2,"Benutzergruppen löschen",3,p50groupActionFunctionDelExec,"Bestätigen Sie das Löschen der gewählten Benutzergruppen?<br /><br /><label><input id=d3check type=checkbox onchange=p50usersGroupActionFunctionDelCheck() />Bestätigen</label>"),QE("idx_dlgOkButton",!1)}}function p50usersGroupActionFunctionDelCheck(){QE("idx_dlgOkButton",Q("d3check").checked)}function p50groupActionFunctionDelExec(e){for(var t=document.getElementsByClassName("UserGroupCheckbox"),n=0;n<t.length;n++)!0===t[n].checked&&meshserver.send({action:"deleteusergroup",ugrpid:decodeURIComponent(t[n].value)})}function showCreateUserGroupDialog(e){if(!xxdialogMode){var t="",n="";if(2==e){if(usergroups)for(var i in usergroups)n+="<option value="+encodeURIComponentEx(i)+">"+EscapeHtml(usergroups[i].name)+"</option>";t+=addHtmlValue("Benutzergruppe","<div style=width:230px;margin:0;padding:0><select id=dp4groupid style=width:100%>"+n+"</select></div>")}if(1==e&&serverinfo.crossDomain){n="<select style=width:240px id=p4domain>";for(var i in serverinfo.crossDomain)n+="<option value="+i+">"+(""==serverinfo.crossDomain[i]?"Default":EscapeHtml(serverinfo.crossDomain[i]))+"</option>";t+=addHtmlValue("Domain",n+="</select>")}t+=addHtmlValue("Name","<input id=p4name maxlength=64 onchange=showCreateUserGroupDialogValidate() onkeyup=showCreateUserGroupDialogValidate() />"),setDialogMode(2,1==e?"Benutzergruppe erstellen":"Dupliziere Benutzergruppe",3,showCreateUserGroupDialogEx,t+=addHtmlValue("Beschreibung",'<textarea id=p4desc value="" style=width:230px;height:60px;resize:none maxlength=1024 /></textarea>'),e),showCreateUserGroupDialogValidate(),Q("p4name").focus()}}function showCreateUserGroupDialogValidate(){QE("idx_dlgOkButton",0<Q("p4name").value.length)}function showCreateUserGroupDialogEx(e,t){var n={action:"createusergroup",name:Q("p4name").value,desc:Q("p4desc").value};2==t&&(n.clone=decodeURIComponent(Q("dp4groupid").value)),1==t&&serverinfo.crossDomain&&(n.domain=serverinfo.crossDomain[parseInt(Q("p4domain").value)]),meshserver.send(n)}var currentUserGroup=null;function gotoUserGroup(e,t){if(!xxdialogMode||t){var n=currentUserGroup=usergroups?usergroups[decodeURIComponent(e)]:null;if(null!=n){var i=EscapeHtml(n.name);0==i.length&&(i="<i>Kein(e)</i>"),0!=(256&userinfo.siteadmin)&&(i='<span tabindex=0 title="Click here to edit the user group name" onclick=p51editgroup(1) onkeyup="if (event.key == \'Enter\') p51editgroup(1)" style=cursor:pointer>'+i+' <img class=hoverButton src="images/link5.png" /></span>'),QH("p51groupName",i);var o=0,r=0,a=0;if(n.links)for(var s in n.links)s.startsWith("user/")&&o++,s.startsWith("mesh/")&&r++,s.startsWith("node/")&&a++;var l=n.desc;l=null==l||""==l?"<i>Kein(e)<i>":EscapeHtml(l);var d="<div style=min-height:80px><table style=width:100%>";if(0!=(8&args.hide)&&(d+="<br />"+addDeviceAttribute("Name",i)),null!=serverinfo.crossDomain||0!=debugmode){var c=n._id.split("/")[1];d+=addDeviceAttribute("Domain",""!=c?EscapeHtml(c):"<i>Default</i>"),d+=addDeviceAttribute("Group Identifier",EscapeHtml(n._id))}0!=(256&userinfo.siteadmin)?d+=addDeviceAttribute("Beschreibung","<span onclick=p51editgroup(2) style=cursor:pointer>"+l+' <img class=hoverButton src="images/link5.png" /></span>'):d+=addDeviceAttribute("Beschreibung",l),d+=addDeviceAttribute("Benutzer",o),d+=addDeviceAttribute("Gerätegruppen",r),d+=addDeviceAttribute("Geräte",a),d+="</table></div><br />",0!=(256&userinfo.siteadmin)&&(d+='<input type=button value="Rundruf" title="Sende eine Mitteilung an alle Benutzer in dieser Gruppe." onclick=showUserBroadcastDialog("'+encodeURIComponentEx(n._id)+'") />'),QH("p51group",d),d="<br />",0!=(256&userinfo.siteadmin)&&(d+='<a href=# onclick="return p51showAddUserDialog()" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzer hinzufügen</a>'),d+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Gruppenmitglieder</th><th scope=col style=text-align:left></th></tr>';var u=1,p=[];for(var s in currentUserGroup.links)if(0!=s.startsWith("user/")){var m=s.split("/")[2];currentUserGroup.links[s].name&&(m=currentUserGroup.links[s].name),s==userinfo._id&&(m=userinfo.name),p.push({id:s,name:m,rights:currentUserGroup.links[s].rights})}for(var s in p.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0}),p){var g="<a href=# onclick='return p51deleteUser(event,\""+encodeURIComponentEx(p[s].id)+'")\' title="Entziehe Benutzerrechte an dieser Gerätegruppe" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',h=EscapeHtml(decodeURIComponent(p[s].name));null!=users&&(h="<a href=# onclick='gotoUser(\""+encodeURIComponentEx(p[s].id)+"\");haltEvent(event);'>"+h+"</a>"),d+="<tr "+(u%2==0?"style=background-color:#DDD":"")+'><td><div title="Benutzer" class=m2></div><div>&nbsp;'+h+"<div></div></div></td><td><div style=float:right>"+g+"</div></td></tr>",++u}1==u&&(d+="<tr><td><div style=padding:6px>&nbsp;<i>Keine Mitglieder</i><div></div></div></td><td></td></tr>"),d+="</tbody></table><br />";var v=0,f=!(u=1);for(var s in meshes)currentUserGroup._id.split("/")[1]==meshes[s]._id.split("/")[1]&&(v++,null!=currentUserGroup.links&&null!=currentUserGroup.links[s]||(f=!0));if(0<v&&f&&(d+='<a href=# onclick="return p20showAddMeshUserDialog(3)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Gerätegruppe hinzufügen</a>'),d+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Gemeinsame Gerätegruppen</th><th scope=col style=text-align:left></th></tr>',currentUserGroup.links){var k=[];for(var s in currentUserGroup.links)s.startsWith("mesh/")&&null!=meshes[s]&&k.push(meshes[s]);for(var s in k=getOrderedList(k,"name")){var b=0,x=k[s],y=(g="",makeDeviceGroupRightsString(currentUserGroup.links[x._id].rights));userinfo.links&&null!=userinfo.links[x._id]&&null!=userinfo.links[x._id].rights&&(b=userinfo.links[x._id].rights);var w="<i>Unbekannte Gerätegruppe</i>";x&&(w="<a href=# onclick='gotoMesh(\""+x._id+"\");haltEvent(event);'>"+x.name+"</a>"),0!=(2&b)&&(g="<a href=# onclick='return p51removeMeshFromUserGroup(event,\""+encodeURIComponentEx(x._id)+'")\' title="Benutzergruppenrechte an dieser Gerätegruppe entfernen" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',y='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(3,"'+encodeURIComponentEx(x._id)+'")>'+y+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"),d+="<tr "+(++u%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="Gerätegruppe" class=m99></div><div>&nbsp;'+w+"<div></div></div></td><td style=width:70%><div style=float:right>"+g+"</div><div>"+y+"</div></td></tr>"}}if(1==u&&(d+="<tr><td><div style=padding:6px>&nbsp;<i>Keine gemeinsamen Gerätegruppen</i><div></div></div></td><td></td></tr>"),d+="</tbody></table>",u=1,d+="<br />",currentUserGroup._id.split("/")[1]==userinfo._id.split("/")[1]&&(d+='<a href=# onclick="return p20showAddMeshUserDialog(7)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Gerät hinzufügen</a>'),d+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Allgemeine Geräte</th><th scope=col style=text-align:left></th></tr>',currentUserGroup.links){var S=[];for(var s in currentUserGroup.links){if(s.startsWith("node/"))null!=(D=getNodeFromId(s))&&S.push(D)}for(var s in S=getOrderedList(S,"name")){var D=S[s],C=(g="",y=makeUserDeviceRightsString(currentUserGroup.links[D._id].rights),b=GetNodeRights(D),"<i>Unbekanntes Gerät</i>");D&&(C="<a href=# onclick='gotoDevice(\""+D._id+"\");haltEvent(event);'>"+D.name+"</a>"),0!=(2&b)&&(g="<a href=# onclick='return p51removeDeviceFromUserGroup(event,\""+encodeURIComponentEx(D._id)+'")\' title="Benutzergruppenrechte an diesem Gerät entziehen" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',y='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(7,"'+encodeURIComponentEx(D._id)+'")>'+y+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"),d+="<tr "+(++u%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="Gerätegruppe" class=m99></div><div>&nbsp;'+C+"<div></div></div></td><td style=width:70%><div style=float:right>"+g+"</div><div>"+y+"</div></td></tr>"}}1==u&&(d+="<tr><td><div style=padding:6px>&nbsp;<i>Keine Geräte gemeinsam</i><div></div></div></td><td></td></tr>"),d+="</tbody></table>",0!=(256&userinfo.siteadmin)&&(d+="<div style=font-size:x-small;text-align:right><span><a href=# onclick=p51showDeleteUserGroupDialog() style=cursor:pointer>Benutzergruppe löschen</a></span></div>"),QH("p51group2",d),go(51);var M="";if(0==(268435456&features)&&51<=xxcurrentView&&xxcurrentView<=59&&null!=currentUserGroup){for(var s in M="?viewmode="+xxcurrentView+"&gotougrp="+(serverinfo.crossDomain?currentUserGroup._id:currentUserGroup._id.split("/")[2]),urlargs)M+="&"+s+"="+urlargs[s];try{window.history.replaceState({},document.title,window.location.pathname+M)}catch(e){}}}else 51==xxcurrentView&&(setDialogMode(0),go(50))}}function p51removeDeviceFromUserGroup(e,t){if(!xxdialogMode){var n=getNodeFromId(decodeURIComponent(t));null!=n&&setDialogMode(2,"Geräteberechtigungen entfernen",3,p51removeDeviceFromUserGroupEx,format('Bestätigen Sie den Entzug von Zugriffsrechten für Gerät "{0}"?',n.name),n._id)}}function p51removeDeviceFromUserGroupEx(e,t){meshserver.send({action:"adddeviceuser",nodeid:t,userids:[currentUserGroup._id],rights:0,remove:!0})}function p51removeMeshFromUserGroup(e,t){if(!xxdialogMode){var n=meshes[decodeURIComponent(t)];null!=n&&setDialogMode(2,"Gerätegruppenberechtigungen entfernen",3,p51removeMeshFromUserGroupEx,format('Bestätigen Sie den Entzug von Zugriffsrechten für Gerätegruppe  "{0}"?',n.name),n._id)}}function p51removeMeshFromUserGroupEx(e,t){meshserver.send({action:"removemeshuser",meshid:t,userid:currentUserGroup._id})}function p51editgroup(e){if(!xxdialogMode){var t=addHtmlValue("Name","<input id=dp51name style=width:230px maxlength=32 onchange=p51editgroupValidate() onkeyup=p51editgroupValidate(event) />");setDialogMode(2,"Benutzergruppe bearbeiten",3,p51editgroupEx,t+=addHtmlValue("Beschreibung","<div style=width:230px;margin:0;padding:0><textarea id=dp51desc maxlength=1024 style=width:100%;resize:none></textarea></div>")),Q("dp51name").value=currentUserGroup.name,currentUserGroup.desc&&(Q("dp51desc").value=currentUserGroup.desc),p51editgroupValidate(),2==e?Q("dp51desc").focus():Q("dp51name").focus()}}function p51editgroupEx(){meshserver.send({action:"editusergroup",ugrpid:currentUserGroup._id,name:Q("dp51name").value,desc:Q("dp51desc").value})}function p51editgroupValidate(e){QE("idx_dlgOkButton",0<Q("dp51name").value.length),e&&"Enter"==e.key&&Q("dp51desc").focus()}function p51showDeleteUserGroupDialog(){if(xxdialogMode)return!1;var e=format("Benutzergruppe {0} löschen?",EscapeHtml(currentUserGroup.name))+"<br /><br />";return setDialogMode(2,"Benutzergruppe löschen",3,p51showDeleteUserGroupDialogEx,e+="<label><input id=p51check type=checkbox onchange=p51validateDeleteGroupDialog() />Bestätigen</label>"),p51validateDeleteGroupDialog(),!1}function p51validateDeleteGroupDialog(){QE("idx_dlgOkButton",Q("p51check").checked)}function p51showDeleteUserGroupDialogEx(e,t){meshserver.send({action:"deleteusergroup",ugrpid:currentUserGroup._id})}function p51deleteUser(e,t){return haltEvent(e),p51viewuserEx(2,decodeURIComponent(t)),!1}function p51viewuserEx(e,t){if(2==e){var n=t.split("/")[2];users&&users[t]&&(n=users[t].name),userinfo._id==t&&(n=userinfo.name),setDialogMode(2,"Benutzermitgliedschaft entziehen",3,p51viewuserEx2,format('Bestätigen Sie den Mitgliedschaftsentzug für Benutzer "{0}"?',EscapeHtml(decodeURIComponent(n))),t)}}function p51viewuserEx2(e,t){meshserver.send({action:"removeuserfromusergroup",ugrpid:currentUserGroup._id,userid:t})}function p51showAddUserDialog(){if(xxdialogMode)return!1;var e="Erlaube Benutzern, diese Gerätegruppe und die Geräte darin zu verwalten.";return 524288&features&&(e+=" Benutzer müssen sich an diesem Server anmelden, bevor sie einer Gerätegruppe hinzugefügt werden können."),e+="<br /><br /><div style='position:relative'>",e+=addHtmlValue("User Identifiers",'<input id=dp51username style=width:230px maxlength=32 onchange=p51validateAddUserDialog() onkeyup=p51validateAddUserDialog() placeholder="user1, user2, user3" />'),e+="<div id=dp51usersuggest class=suggestionBox style='top:30px;left:130px;display:none'></div>",setDialogMode(2,"Benutzer zu Benutzergruppe hinzufügen",3,p51showAddUserDialogEx,e+="</div><br>"),Q("dp51username").focus(),p51validateAddUserDialog(),!1}function p51setname(e){e=decodeURIComponent(e);var t=Q("dp51username").value.split(",");for(var n in t)t[n]=t[n].trim();return t[t.length-1]=e,Q("dp51username").value=t.join(", "),p51validateAddUserDialog(),!1}function p51validateAddUserDialog(){var e=!0;if(Q("dp51username")){var t=Q("dp51username").value.split(",");for(var n in t){var i=t[n]=t[n].trim();0==i.length?e=!1:0<=i.indexOf('"')&&(e=!1)}var o=!1,r=!1;if(null!=users){var a=t[t.length-1].trim(),s=a.toLowerCase(),l=[];if(0<a.length){for(var n in users){var d=users[n]._id.split("/");if(currentUserGroup.domain==d[1]&&d[2]===s){r=!0;break}if(0<=users[n].name.toLowerCase().indexOf(s)&&currentUserGroup.domain==d[1]&&(l.push([users[n]._id,users[n].name]),8<=l.length))break}if(0==r&&0<l.length){var c="";for(var n in l){var u=l[n][0],p=l[n][1];u.split("/")[2]==p.toLowerCase()?c+="<div class=suggestionBoxItem onclick='p51setname(\""+encodeURIComponentEx(u.split("/")[2])+"\")'>"+EscapeHtml(p)+"</div>":c+="<div class=suggestionBoxItem onclick='p51setname(\""+encodeURIComponentEx(u.split("/")[2])+"\")'><div>"+EscapeHtml(p)+"</div><div class=suggestionBoxSubItem>"+EscapeHtml(u.split("/")[2])+"</div></div>"}QH("dp51usersuggest",c),o=!0}}}QV("dp51usersuggest",o)}QE("idx_dlgOkButton",e)}function p51showAddUserDialogEx(e,t){if(null==t){var n=Q("dp51username").value.split(","),i=[];for(var o in n)i.push(n[o].trim());meshserver.send({action:"addusertousergroup",ugrpid:currentUserGroup._id,usernames:i})}else meshserver.send({action:"addusertousergroup",ugrpid:currentUserGroup._id,usernames:[t.split("/")[2]]})}var currentUser=null;function gotoUser(e,t,n){if((!xxdialogMode||t)&&(null==n||null==n.originalTarget||null==n.originalTarget.href)){var i=currentUser=users[decodeURIComponent(e)];if(null==i)return setDialogMode(0),void go(4);QH("p30userName",i.name),QH("p31userName",i.name);var o=i._id==userinfo._id,r=0;null!=wssessions&&wssessions[i._id]&&(r=wssessions[i._id]),Q("MainUserImage").classList.remove("gray"),0==r&&Q("MainUserImage").classList.add("gray");var a=i._id.split("/")[2];a.startsWith("~twitter:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/twitter64.png"):a.startsWith("~google:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/google64.png"):a.startsWith("~github:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/github64.png"):a.startsWith("~reddit:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/reddit64.png"):a.startsWith("~azure:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/azure64.png"):a.startsWith("~jumpcloud:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/jumpcloud64.png"):a.startsWith("~intel:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/intel64.png"):a.startsWith("~:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/generic64.png"):QV("p30userAuthServiceLogo",!1);var s=[],l="";null!=i.siteadmin&&0!=(32&i.siteadmin)&&4294967295!=i.siteadmin&&(l='<img src="images/padlock12.png" height=12 width=8 title="Konto ist gesperrt" style="margin-top:2px" /> ',s.push("Gesperrtes Konto")),null==i.siteadmin||0==(4294967071&i.siteadmin)?s.push("Keine Serverberechtigungen"):8==i.siteadmin?s.push("Zugriff auf Server-Dateien"):4294967295==i.siteadmin?s.push("Gesamtadministrator"):s.push("Partielle Rechte"),null!=i.siteadmin&&4294967295!=i.siteadmin&&0!=(192&i.siteadmin)&&s.push("Einschränkungen");var d="<div style=min-height:80px><table style=width:100%>";0!=(8&args.hide)&&(d+="<br />"+addDeviceAttribute("Name",i.name));var c=i.email?EscapeHtml(i.email):"<i>Nicht gesetzt</i>",u="";if(serverinfo.emailcheck&&(u=1==i.emailVerified?'<b style=color:green;cursor:pointer title="E-Mail ist bestätigt">&#x2713</b> ':'<b style=color:red;cursor:pointer title="E-Mail nicht bestätigt">&#x2717;</b> '),serverinfo.crossDomain||0!=debugmode){var p=i._id.split("/")[1];d+=addDeviceAttribute("Domain",""!=p?EscapeHtml(p):"<i>Default</i>"),d+=addDeviceAttribute("Benutzeridentifikation",EscapeHtml(i._id))}else i.name.toLowerCase()!=i._id.split("/")[2]&&(d+=addDeviceAttribute("Benutzeridentifikation",EscapeHtml(i._id.split("/")[2])));4294967295!=i.siteadmin||4294967295==userinfo.siteadmin?d+=addDeviceAttribute("E-Mail",u+c+' <a href="mailto:'+i.email+'" \'><img class=hoverButton src="images/link1.png" /></a> <img class=hoverButton style=cursor:pointer src="images/link5.png" onclick=p30showUserEmailChangeDialog(event,"'+e+'") />'):d+=addDeviceAttribute("E-Mail",u+c+' <a href="mailto:'+i.email+'" \'><img class=hoverButton src="images/link1.png" /></a>'),(33554432&features||null!=i.phone)&&(d+=addDeviceAttribute("Phone Number",(i.phone?i.phone:"<i>Kein(e)</i>")+' <img class=hoverButton style=cursor:pointer src="images/link5.png" onclick=p30editPhone() />')),d+=addDeviceAttribute("Server-Rechte",l+s.join(", ")+" <img style=cursor:pointer class=hoverButton onclick='return showUserAdminDialog(event,\""+e+'")\' src="images/link5.png" />'),i.quota&&(d+=addDeviceAttribute("Server-Kontingent",EscapeHtml(parseInt(i.quota)/1024)+" k")),d+=addDeviceAttribute("Erzeugung",printDateTime(new Date(1e3*i.creation))),i.login&&(d+=addDeviceAttribute("Letzte Anmeldung",printDateTime(new Date(1e3*i.login)))),-1==i.passchange?d+=addDeviceAttribute("Passwort","Wird bei der nächsten Anmeldung geändert."):i.passchange&&(d+=addDeviceAttribute("Passwort",format("Letzte Änderung: {0}",printDateTime(new Date(1e3*i.passchange)))));var m=0,g="<i>Kein(e)<i>";if(i.links){for(var h in i.links)h.startsWith("mesh/")&&m++;1==m?g="1 Gruppe":1<m&&(g=format("{0} Gruppen",m))}if(d+=addDeviceAttribute("Gerätegruppen",g),4294967295==userinfo.siteadmin||2&userinfo.siteadmin){var v="<i>Kein(e)</i>";if(i.groups)for(var h in v="",i.groups)v+='<span class="tagSpan">'+i.groups[h]+"</span>";d+=addDeviceAttribute("Admin-Bereiche",addLinkConditional(v,'showUserGroupDialog(event,"'+e+'")',4294967295==userinfo.siteadmin||null==userinfo.groups&&userinfo._id!=i._id&&4294967295!=i.siteadmin))}var f=[],k=0;i.consent&&(k=i.consent),serverinfo.consent&&(k|=serverinfo.consent),64&k&&8&k?f.push("Desktop-Einverständnis & -Werkzeugleiste"):64&k?f.push("Desktop-Werkzeugleiste"):8&k?f.push("Desktop-Einverständnis"):1&k&&f.push("Desktop-Benachrichtigung"),16&k?f.push("Terminal-Einverständnis"):2&k&&f.push("Terminal-Benachrichtigung"),32&k?f.push("Dateien-Einverständnis"):4&k&&f.push("Dateien-Benachrichtigung"),7==k&&(f=["Immer benachrichtigen"]),56==(56&k)&&(f=["Immer nachfragen"]),""==(f=f.join(", "))&&(f="<i>Kein(e)</i>"),d+=addDeviceAttribute("Benutzereinwilligung",addLinkConditional(f,"p20editmeshconsent(2)",!0));var b=0;if(0<i.otpsecret||0<i.otphkeys){b=1;var x=[];0<i.otpsecret&&x.push("Authentifizierungsanwendung"),0<i.otphkeys&&x.push("Sicherheitsschlüssel"),0<i.otpkeys&&x.push("Sicherungscodes"),null!=i.phone&&67108864&features&&x.push("SMS"),d+=addDeviceAttribute("Sicherheit",'<img src="images/key12.png" height=12 width=11 title="Zweifaktorauthentifizierung eingeschaltet" style="margin-top:2px" /> '+x.join(", "))}d+="</table></div><br />",d+='<input type=button value="Notizen" title="Zeige Notizen zu diesem Benutzer" onclick=showNotes(false,"'+e+'") />',i.phone&&33554432&features&&(d+='<input type=button value="SMS" title="Send a SMS message to this user" onclick=showSendSMS("'+e+'") />'),"string"==typeof i.email&&!0===i.emailVerified&&64&features&&(d+='<input type=button value="E-Mail" title="Send a email message to this user" onclick=showSendEmail("'+e+'") />'),!o&&0<r&&(d+='<input type=button value="Benachrichtigen" title="Sende Benutzerbenachrichtigung" onclick=showUserAlertDialog(event,"'+e+'") />'),QH("p30html",d),drawUserPermissions();var y=null!=userinfo.siteadmin&&2&userinfo.siteadmin&&4294967295!=i.siteadmin||4294967295==userinfo.siteadmin;d="<div style=float:right;font-size:x-small>",y&&(d+="<a href=# style=cursor:pointer onclick='return p30showDeleteUserDialog()' title=\"Entfernen Sie diesen Benutzer\">Benutzer löschen</a>"),d+="</div><div style=font-size:x-small>",y&&0==(524288&features)&&"~"!=i._id.split("/")[2][0]&&(d+="<a href=# style=cursor:pointer onclick='return p30showUserChangePassDialog("+b+')\' title="Ändern Sie das Passwort für diesen Benutzer">Passwort ändern</a>'),d+="</div><br>",QH("p30html3",d),d="",1==r?d="1 aktive Sitzung":1<r&&(d=format("{0} aktive Sitzungen",r)),QH("MainUserState",d),go(30),QH("p31events",""),refreshUsersEvents();var w="";if(0==(268435456&features)&&30<=xxcurrentView&&xxcurrentView<=39&&null!=currentUser){for(var h in w="?viewmode="+xxcurrentView+"&gotouser="+(serverinfo.crossDomain?currentUser._id:currentUser._id.split("/")[2]),urlargs)w+="&"+h+"="+urlargs[h];try{window.history.replaceState({},document.title,window.location.pathname+w)}catch(e){}}}}function p30editPhone(){if(!xxdialogMode){var e='<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>';e+="<td style=width:100%;text-align:center>SMS capable phone number for this user.<br />Leave blank for none.",setDialogMode(2,"Phone Notifications",3,p30editPhoneEx,e+='<br /><br /><div style=width:100%;text-align:center>Phone number: <input type=tel pattern="[0-9]" autocomplete="tel" value="'+(currentUser.phone?currentUser.phone:"")+'" inputmode="tel" maxlength=18 id=d2phoneinput onKeyUp=p30editPhoneValidate() onkeypress="if (event.key==\'Enter\') p30editPhoneValidate(1)"></div></table>',"verifyPhone"),Q("d2phoneinput").focus(),p30editPhoneValidate()}}function p30editPhoneValidate(e){var t=""==Q("d2phoneinput").value||isPhoneNumber(Q("d2phoneinput").value);QE("idx_dlgOkButton",t),1==e&&t&&dialogclose(1)}function p30editPhoneEx(){meshserver.send({action:"edituser",id:currentUser._id,phone:Q("d2phoneinput").value})}function p30showUserEmailChangeDialog(e){if(xxdialogMode)return!1;var t="";return t+=addHtmlValue("E-Mail","<input id=dp30email style=width:230px maxlength=32 onchange=p30validateEmail() onkeyup=p30validateEmail() />"),serverinfo.emailcheck&&(t+=addHtmlValue("Status","<select id=dp30verified style=width:230px onchange=p30validateEmail()><option value=0>Nicht verifiziert</option><option value=1>Verifiziert</option></select>")),setDialogMode(2,format("E-Mail für {0} ändern",EscapeHtml(currentUser.name)),3,p30showUserEmailChangeDialogEx,t),Q("dp30email").focus(),Q("dp30email").value=currentUser.email?currentUser.email:"",serverinfo.emailcheck&&(Q("dp30verified").value=currentUser.emailVerified?1:0),p30validateEmail(),!1}function p30validateEmail(){var e=Q("dp30email").value,t=e.split("@");t=2==t.length&&0<t[0].length&&1<t[1].split(".").length&&2<t[1].length&&e.length<1024&&(e!=userinfo.email||1==serverinfo.emailcheck&&Q("dp30verified").value!=(userinfo.emailVerified?1:0)),QE("idx_dlgOkButton",t)}function p30showUserEmailChangeDialogEx(){var e={action:"edituser",id:currentUser._id,email:Q("dp30email").value};serverinfo.emailcheck&&(e.emailVerified=1==Q("dp30verified").value),meshserver.send(e)}function p30showUserChangePassDialog(e){if(!xxdialogMode){var t="";if(t+=addHtmlValue("Passwort","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>"),t+=addHtmlValue("Passwort","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>"),65536&features&&(t+=addHtmlValue("Passwort-Tipp","<input id=p4hint type=text style=width:230px maxlength=256></input>")),passRequirements){var n=[],i=0;for(var o in passRequirements)"reset"!=o&&"hint"!=o&&(n.push(o+":"+passRequirements[o]),i++);0<i&&(t+="<div style=font-size:x-small;padding:6px>"+format("Voraussetzungen: {0}.",n.join(", "))+"</div>")}t+="<div><label><input id=p4resetNextLogin type=checkbox />Passwort beim nächsten Login zurücksetzen.</label></div>",1==e&&(t+="<div><label><input id=p4twoFactorRemove type=checkbox />Alle Zweifaktorauthentifizierung entfernen.</label></div>"),setDialogMode(2,format("Passwort für {0} ändern",EscapeHtml(currentUser.name)),3,p30showUserChangePassDialogEx,t,e),p30showUserChangePassDialogValidate(),Q("p4pass1").focus(),-1==currentUser.passchange&&(Q("p4resetNextLogin").checked=!0)}}function p30showUserChangePassDialogValidate(){var e=!0;""==Q("p4pass1").value&&""==Q("p4pass2").value||(Q("p4pass1").value!=Q("p4pass2").value?e=!1:passRequirements&&0==checkPasswordRequirements(Q("p4pass1").value,passRequirements)&&(e=!1)),QE("idx_dlgOkButton",e)}function p30showUserChangePassDialogEx(e,t){var n=!1;if(1==t&&1==Q("p4twoFactorRemove").checked&&(n=!0),Q("p4pass1").value==Q("p4pass2").value){var i={action:"changeuserpass",userid:currentUser._id,pass:Q("p4pass1").value,removeMultiFactor:n,resetNextLogin:Q("p4resetNextLogin").checked};65536&features&&(i.hint=Q("p4hint").value),meshserver.send(i)}}function p30showDeleteUserDialog(){xxdialogMode||(setDialogMode(2,format("Benutzer {0} löschen",EscapeHtml(currentUser.name)),3,p30showDeleteUserDialogEx,format("Löschen von Benutzer {0} bestätigen?",EscapeHtml(currentUser.name))+"<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />Bestätigen</label>"),p10validateDeleteNodeDialog())}function p30showDeleteUserDialogEx(){meshserver.send({action:"deleteuser",userid:currentUser._id,username:currentUser.name})}function drawUserPermissions(){var e=1,t="",n=0,i=!1;for(var o in meshes)meshes[o]._id.split("/")[1]==currentUser._id.split("/")[1]&&(n++,null!=currentUser.links&&null!=currentUser.links[o]||(i=!0));if(0<n&&i&&(t+='<a href=# onclick="return p20showAddMeshUserDialog(1)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Gerätegruppe hinzufügen</a>'),t+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Gemeinsame Gerätegruppen</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var r=[];for(var o in currentUser.links)o.startsWith("mesh/")&&null!=meshes[o]&&r.push(meshes[o]);for(var o in r=getOrderedList(r,"name")){var a=0,s=r[o],l="",d=makeDeviceGroupRightsString(h=currentUser.links[s._id].rights);if(null!=s){userinfo.links&&null!=userinfo.links[s._id]&&null!=userinfo.links[s._id].rights&&(a=userinfo.links[s._id].rights);var c="<i>Unbekannte Gerätegruppe</i>";s&&(c="<a href=# onclick='gotoMesh(\""+s._id+"\");haltEvent(event);'>"+EscapeHtml(s.name)+"</a>"),currentUser._id!=userinfo._id&&0!=(2&a)&&(l="<a href=# onclick='return p30removeMeshFromUser(event,\""+encodeURIComponentEx(s._id)+'")\' title="Entziehe Benutzerrechte an dieser Gerätegruppe" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',d='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(1,"'+encodeURIComponentEx(s._id)+'")>'+d+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"),t+="<tr "+(++e%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="Gerätegruppe" class=m99></div><div>&nbsp;'+c+"<div></div></div></td><td style=width:70%><div style=float:right>"+l+"</div><div>"+d+"</div></td></tr>"}}}if(1==e&&(t+="<tr><td><div style=padding:6px>&nbsp;<i>Keine gemeinsamen Gerätegruppen</i><div></div></div></td><td></td></tr>"),t+="</tbody></table>",null!=usergroups){if(e=1,t+="<br />",0!=(256&userinfo.siteadmin)){var u=0,p=!1;for(var o in usergroups)usergroups[o]._id.split("/")[1]==currentUser._id.split("/")[1]&&(u++,null!=currentUser.links&&null!=currentUser.links[o]||(p=!0));0<u&&p&&(t+='<a href=# onclick="return p30showAddUserGroupDialog()" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Benutzergruppe hinzufügen</a>')}if(t+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Benutzergruppenmitgliedschaft</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var m=[];for(var o in currentUser.links)o.startsWith("ugrp/")&&null!=usergroups[o]&&m.push(usergroups[o]);for(var o in m=getOrderedList(m,"name")){var g=m[o],h=currentUser.links[m[o]._id].rights,v=(l="","<i>Unbekannte Benutzergruppe</i>");null!=g&&(v=EscapeHtml(g.name),null!=usergroups&&(v="<a href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(m[o]._id)+"\");haltEvent(event);'>"+v+"</a>")),0!=(256&userinfo.siteadmin)&&(l="<a href=# onclick='return p30RemoveUserGroup(event,\""+encodeURIComponentEx(m[o]._id)+'")\' title="Benutzergruppenmitgliedschaft entziehen" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),t+="<tr "+(++e%2==0?"style=background-color:#DDD":"")+'><td><div title="Benutzergruppe" class=m4></div><div>&nbsp;'+v+"<div></div></div></td><td><div style=float:right>"+l+"</div></td></tr>"}}1==e&&(t+="<tr><td><div style=padding:6px>&nbsp;<i>Keine Benutzergruppenmitgliedschaften</i><div></div></div></td><td></td></tr>"),t+="</tbody></table>"}if(e=1,t+="<br />",currentUser._id.split("/")[1]==userinfo._id.split("/")[1]&&(t+='<a href=# onclick="return p20showAddMeshUserDialog(4)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Gerät hinzufügen</a>'),t+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>Allgemeine Geräte</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var f=[];for(var o in currentUser.links){if(o.startsWith("node/"))null!=(k=getNodeFromId(o))&&f.push(k)}for(var o in f.sort(nameSort),f){var k=f[o];h=currentUser.links[k._id].rights,l="",a=GetNodeRights(k);userinfo.links&&null!=userinfo.links[o]&&null!=userinfo.links[o].rights&&(a=userinfo.links[o].rights);var b=k?EscapeHtml(k.name):"<i>Unbekanntes Gerät</i>";0!=(2&a)&&(l="<a href=# onclick='return p30removeNodeFromUser(event,\""+encodeURIComponentEx(k._id)+'")\' title="Entziehe Benutzerrechte an dieser Gerätegruppe" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',d='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(4,"'+encodeURIComponentEx(k._id)+'")>'+makeUserDeviceRightsString(h)+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"),b="<a href=# onclick='gotoDevice(\""+k._id+"\",10);haltEvent(event);'>"+b+"</a>",t+="<tr "+(++e%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="Gerät" class=si'+k.icon+"></div><div>&nbsp;"+b+"<div></div></div></td><td style=width:70%><div style=float:right>"+l+"</div><div>"+d+"</div></td></tr>"}}1==e&&(t+="<tr><td><div style=padding:6px>&nbsp;<i>Keine Geräte gemeinsam</i><div></div></div></td><td></td></tr>"),t+="</tbody></table>",QH("p30html2",t)}function p30removeNodeFromUser(e,t){if(!xxdialogMode){var n=getNodeFromId(decodeURIComponent(t));setDialogMode(2,"Geräteberechtigungen entfernen",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:t._id,nodename:t.name,userids:[currentUser._id],rights:0,remove:!0})},format('Bestätigen Sie den Entzug von Zugriffsrechten für Gerät "{0}"?',n.name),n)}}function p30removeUserFromNode(e,n){if(!xxdialogMode){var t=null,i="";(n=decodeURIComponent(n)).startsWith("user/")?(users&&null!=(t=users[n])&&(i=t.name),setDialogMode(2,"Benutzerberechtigungen entziehen",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[n],rights:0,remove:!0})},i?format('Bestätigen Sie den Entzug von Zugriffsrechten für Benutzer "{0}"?',i):"Bestätigen Sie den Entzug von Zugriffsrechten?",t)):n.startsWith("ugrp/")&&(usergroups&&null!=(t=usergroups[n])&&(i=t.name),setDialogMode(2,"Benutzergruppenberechtigungen entziehen",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[n],rights:0,remove:!0})},i?format('Bestätigen Sie den Entzug von Zugriffsrechten für Benutzergruppe "{0}"?',i):"Bestätigen Sie den Entzug von Zugriffsrechten?",t))}}function p30RemoveUserGroup(e,t){if(!xxdialogMode&&null!=usergroups){var n=decodeURIComponent(t),i=usergroups[n];setDialogMode(2,"Benutzergruppenmitgliedschaft entziehen",3,p30RemoveUserGroupEx,format('Bestätigen Sie den Mitgliedschaftsentzug für Benutzergruppe "{0}"?',null!=i?EscapeHtml(i.name):"<i>Unbekannt</i>"),n)}}function p30RemoveUserGroupEx(e,t){meshserver.send({action:"removeuserfromusergroup",ugrpid:t,userid:currentUser._id})}function p30showAddUserGroupDialog(){if(!xxdialogMode&&null!=usergroups){var e="";for(var t in usergroups)usergroups[t]._id.split("/")[1]==currentUser._id.split("/")[1]&&(null!=currentUser.links&&null!=currentUser.links[t]||(e+="<option value="+encodeURIComponentEx(t)+">"+EscapeHtml(usergroups[t].name)+"</option>"));return setDialogMode(2,"Mitgliedschaft hinzufügen",3,p30showAddUserGroupDialogEx,addHtmlValue("Benutzergruppe","<div style=width:230px;margin:0;padding:0><select id=dp2groupid style=width:100%>"+e+"</select></div>")),Q("dp2groupid").focus(),!1}}function p30showAddUserGroupDialogEx(){meshserver.send({action:"addusertousergroup",ugrpid:decodeURIComponent(Q("dp2groupid").value),usernames:[currentUser._id.split("/")[2]]})}function p30removeMeshFromUser(e,t){if(!xxdialogMode){var n=meshes[decodeURIComponent(t)];null!=n&&setDialogMode(2,"Gerätegruppenberechtigungen entfernen",3,p30removeMeshFromUserEx,format('Bestätigen Sie den Entzug von Zugriffsrechten für Gerätegruppe  "{0}"?',n.name),n._id)}}function p30removeMeshFromUserEx(e,t){meshserver.send({action:"removemeshuser",meshid:t,userid:currentUser._id})}var currentUserEvents=null;function userEventsUpdate(){if(null!=currentUser){var e="",t=null;for(var n in currentUserEvents){var i=currentUserEvents[n],o=new Date(i.time);if(i.msg){null==i.h&&(i.h=Math.random()),printDate(o)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(o))+"</td></tr>");var r="si3";"user"==i.etype&&(r="m2"),"server"==i.etype&&(r="si3");var a=EscapeHtml(i.msg).split("(R)").join("&reg;");if(i.nodeid){var s=getNodeFromId(i.nodeid);null!=s&&(r="si"+s.icon,a="<a href=# onclick='gotoDevice(\""+i.nodeid+"\",10);haltEvent(event);'>"+EscapeHtml(s.name)+"</a> &rarr; "+a)}i.username&&i.username!=currentUser.name&&(a=2&userinfo.siteadmin&&i.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(i.userid)+"\");haltEvent(event);'>"+EscapeHtml(i.username)+"</a> &rarr; "+a:EscapeHtml(i.username)+" &rarr; "+a),"relay"!=i.etype&&"relaylog"!=i.action||(r="relayIcon16"),e+="<tr onclick=showEventDetails("+i.h+",3)  onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+r+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(o)+" - "+a+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>Keine Ereignisse vorhanden</i><br><br>"),QH("p31events",e)}}function refreshUsersEvents(){meshserver.send({action:"events",limit:parseInt(p31limitdropdown.value),user:currentUser.name})}var d3filetreelinkpath,p52recordings=null;function updateRecordings(){for(var e=[],t=document.getElementsByClassName("RecordingCheckbox"),n=0;n<t.length;n++)t[n].checked&&e.push(t[n].value);var i="<table class=p3usersTable cellpadding=0 cellspacing=0>";if(i+="<th>Session<th style=width:110px>"+nobreak("Start Time")+"<th style=width:110px>Dauer<th style=width:110px>Größe",null!=p52recordings){var o=null;for(var n in p52recordings){var r=p52recordings[n],a=printDate(new Date(r.time));a!=o&&(i+="<tr><td class=userTableHeader colspan=4>"+(o=a)),i+=addRecordingHtml(n,r)}}i+="</table>",QH("p52recordings",i),t=document.getElementsByClassName("RecordingCheckbox");for(n=0;n<t.length;n++)t[n].checked=0<=e.indexOf(t[n].value);p52updateInfo()}function addRecordingHtml(e,t){var n="";t.lengthTime&&(n=pad2(Math.floor(t.lengthTime/3600))+":"+pad2(Math.floor(t.lengthTime%3600/60))+":"+pad2(Math.floor(t.lengthTime%60)));var i=printTime(new Date(t.time));t.sessionStart&&(i=printTime(new Date(t.sessionStart)));var o="";t.size&&(o=format("{0} kB",Math.round(t.size/1024)));var r="<i>Unbekannt</i>";t.name&&t.meshname&&(r=null!=meshes[t.meshid]?"<a href=# onclick='gotoMesh(\""+t.meshid+"\")'>"+EscapeHtml(t.meshname)+"</a> - <a href=# onclick='gotoDevice(\""+t.nodeid+"\",10)'>"+EscapeHtml(t.name)+"</a>":EscapeHtml(t.meshname)+" - "+EscapeHtml(t.name));if(null!=t.userids&&0<t.userids.length)if(1<t.userids.length)r+=" - "+format("{0} users",t.userids.length);else{var a=null;null!=users&&(a=users[t.userids[0]]),r+=null!=a?" - <a href=# onclick='gotoUser(\""+t.userids[0]+"\")'>"+EscapeHtml(a.name)+"</a>":" - "+EscapeHtml(t.userids[0].split("/")[2])}var s="",l="m0";1==t.present&&(l="m1",s="<div style=cursor:pointer;float:right><a href=recordings.ashx?file="+encodeURIComponentEx(t.filename)+' download><img src=images/link4.png height=10 width=10 title="Download Recording" download></a>&nbsp;</div>');var d="<tr tabindex=0 onmouseover=userMouseHover2(this,1) onmouseout=userMouseHover2(this,0) onkeypress=\"if (event.key=='Enter') showRecordingDialog(event,'"+e+"')\"><td style=cursor:pointer>";return d+="<div class=bar style=width:100%>",d+="<div></div>",d+='<div class=baricon onclick=showRecordingDialog(event,"'+e+'")><div class='+l+"></div></div>",d+='<div class=g1 onclick=showRecordingDialog(event,"'+e+'")></div><div class=g2 onclick=showRecordingDialog("'+e+'")></div>',d+='<div onclick=showRecordingDialog(event,"'+e+'")>'+s+"<div style=font-size:16px>"+r+"</div></div></div><td style=text-align:center>"+i+"<td style=text-align:center>"+n+"<td style=text-align:center>"+o}function showRecordingDialog(e,t){if(!xxdialogMode&&"IMG"!=e.target.tagName&&"A"!=e.target.tagName){var n=p52recordings[t],i="";if(n.protocol){var o="Unbekannt";1==n.protocol&&(o="Terminal"),2==n.protocol&&(o="Desktop"),5==n.protocol&&(o="Dateien"),100==n.protocol&&(o="Intel AMT WSMAN"),101==n.protocol&&(o="Intel AMT Redirection"),i+=addHtmlValue4("Protokoll",o)}if(i+=addHtmlValue4("Status",1==n.present?"Present on server":"Not on server"),n.name&&(i+=addHtmlValue4("Gerätename",EscapeHtml(n.name))),n.meshname&&(i+=addHtmlValue4("Gerätegruppe",EscapeHtml(n.meshname))),n.size&&(i+=addHtmlValue4("Größe",format("{0} Bytes",n.size))),n.startTime&&(i+=addHtmlValue4("Start Time",printTime(new Date(n.startTime)))),n.time&&(i+=addHtmlValue4("End Time",printTime(new Date(n.time)))),n.lengthTime&&(i+=addHtmlValue4("Dauer",pad2(Math.floor(n.lengthTime/3600))+":"+pad2(Math.floor(n.lengthTime%3600/60))+":"+pad2(Math.floor(n.lengthTime%60)))),1==n.multiplex&&(i+=addHtmlValue4("Multiplexor","Enabled")),n.userids)for(var t in n.userids)i+=addHtmlValue4("Benutzer",n.userids[t].split("/")[2]);setDialogMode(2,"Recording Details",9,null,i)}}function refreshRecodings(){meshserver.send({action:"recordings",limit:1e3})}function openRecodringPlayer(){xxdialogMode||window.open(window.location.origin+"{{{domainurl}}}player.htm","meshcentral-deskplayer")}function p52updateInfo(){for(var e=document.getElementsByClassName("RecordingCheckbox"),t=0;t<e.length;t++)!0===e[t].checked&&0}function d3init(){Q("d3localFile").value="",d3modechange()}function d3modechange(){var e=Q("d3uploadMode").value;QV("d3localmode",1==e),QV("d3servermode",2==e),1==e?d3setActions():d3updatefiles()}var d3filetreelocation=[];function d3updatefiles(){if(1!=Q("d3uploadMode").value){for(var e="",t="",n=filetree,i=1,o=[],r=[],a=document.getElementsByName("fc"),s=0;s<a.length;s++)a[s].checked&&r.push(a[s].value);for(var s in d3filetreelinkpath="",d3filetreelocation){if(null==n.f||null==n.f[d3filetreelocation[s]])break;if(o.push(d3filetreelocation[s]),1==i){var l=d3filetreelocation[s].split("/");publicPath=window.location+l[0]+"files/"+l[2],d3filetreelocation[s]===userinfo._id?d3filetreelinkpath+="self":d3filetreelinkpath+=l[0]+"/"+l[2]}else""!=d3filetreelinkpath&&(d3filetreelinkpath+="/"+d3filetreelocation[s],2<i&&(publicPath+="/"+d3filetreelocation[s]));n=n.f[d3filetreelocation[s]],i++}d3filetreelocation=o;var d=p5sort_files(n.f);for(var s in d){var c,u=d[s],p=u.n;c=70<(c=p).length?'<span title="'+EscapeHtml(p)+'">'+EscapeHtml(p.substring(0,70))+"...</span>":EscapeHtml(p),p=EscapeHtml(p);var m="";null!=u.s&&(m=getFileSizeStr(u.s));var g="";if(u.t<3){g='<div class=filelist file=999><span style=float:right title=""></span><span><div class=fileIcon'+u.t+' onclick=d3folderset("'+encodeURIComponentEx(u.nx)+'")></div>&nbsp;<a href=# style=cursor:pointer onclick=\'return d3folderset("'+encodeURIComponentEx(u.nx)+"\")'>"+c+"</a></span></div>"}else{var h=c;g='<div class=filelist file=3><input style=float:left name=fcx class=fcb type=checkbox onchange=d3setActions() value="'+u.nx+'">&nbsp;<span style=float:right>'+m+"</span><span><div class=fileIcon"+u.t+"></div>"+h+"</span></div>"}u.t<3?e+=g:t+=g}QH("d3serverfiles",e+t),QE("p3FolderUp",0<d3filetreelocation.length),d3setActions()}}function d3folderset(e){return d3filetreelocation.push(decodeURIComponent(e)),d3updatefiles(),!1}function d3folderup(e){if(null==e)d3filetreelocation.pop();else for(;d3filetreelocation.length>e;)d3filetreelocation.pop();d3updatefiles()}function d3getFileSel(){for(var e=[],t=document.getElementsByName("fcx"),n=0;n<t.length;n++)t[n].checked&&e.push(t[n].value);return e}function d3setActions(){1==Q("d3uploadMode").value?QE("idx_dlgOkButton",0<Q("d3localFile").value.length):QE("idx_dlgOkButton",1==d3getFileSel().length)}var notifications=[];function clickNotificationIcon(e){1==e?QV("notifiyBox",!0):0==e?QV("notifiyBox",!1):QV("notifiyBox","none"==QS("notifiyBox").display),drawNotifications()}function setNotificationCount(e){parseInt(Q("notificationCount").innerHTML)!=e&&(QH("notificationCount",e),QS("notificationCount")["background-color"]=0==e?"lightblue":"orange",QV("notificationCount",0<e))}function drawNotifications(){var e=getstore("notifications",0),t="";if(0==notifications.length)t="<div style=margin:5px>Derzeit gibt es keine Benachrichtigungen</div>";else for(var n in notifications){var i=notifications[n],o="",r=new Date(i.time),a=0;if(null!=i.title&&(o="<b>"+i.title+"</b>: "),null!=i.nodeid){var s=getNodeFromId(i.nodeid);null!=s&&(a=s.icon,o=16&e?"<b>"+meshes[s.meshid].name+" / "+s.name+"</b>: ":"<b>"+s.name+"</b>: ")}t+='<div title="'+format("Aufgetreten am/um {0}",printDateTime(r))+'" id="notifyx'+i.id+'" class=notification style="cursor:pointer;border-top:1px solid '+(""==t?"transparent":"orange")+'">',a&&(t+="<div class=j"+a+' onclick="notificationSelected('+i.id+')" style=margin:5px;float:left></div>'),t+='<div onclick="notificationDelete('+i.id+')" class=unselectable title="Löschen Sie diese Benachrichtigung" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected('+i.id+')" style=margin:5px>'+o+i.text+"</div></div>"}var l="";1<notifications.length&&(l='<div id="notifyRemoveAll" onclick="deleteAllNotifications()" style="cursor:pointer;border-top:1px solid orange;margin:5px;color:orange;text-align:right;padding-right:3px">Alles leeren</div>'),QH("notifiyBox",'<div class=customScroll style="max-height:170px;overflow-y:auto;margin:5px">'+t+"</div>"+l)}function notificationSelected(e,t){var n=-1;for(var i in notifications)notifications[i].id==e&&(n=i);-1!=n&&(notificationSelectedEx(notifications[n],e),t&&notifications[n]&&(notifications[n].notification&&(notifications[n].notification.close(),delete notifications[n].notification),notificationDelete(e)))}function notificationSelectedEx(e,t){null!=e.nodeid?"desktop"==e.tag?gotoDevice(e.nodeid,12):"terminal"==e.tag?gotoDevice(e.nodeid,11):"files"==e.tag?gotoDevice(e.nodeid,13):"intelamt"==e.tag?gotoDevice(e.nodeid,14):"console"==e.tag?gotoDevice(e.nodeid,15):gotoDevice(e.nodeid,10):null!=e.tag&&e.tag.startsWith("meshmessenger/")&&(window.open("/messenger?id="+e.tag+"&title="+encodeURIComponentEx(e.username),e.tag.split("/")[2]),notificationDelete(t))}function notificationDelete(e){var t=-1,n=Q("notifyx"+e);if(null!=n){for(var i in notifications)notifications[i].id==e&&(t=i);if(-1!=t&&(meshserver.send({action:"intersession",subaction:"removeNotify",id:e}),notifications[t].notification&&(notifications[t].notification.close(),delete notifications[t].notification),notifications.splice(t,1),n.parentNode.removeChild(n),setNotificationCount(notifications.length),0==notifications.length&&QV("notifiyBox",!1),1==notifications.length&&QV("notifyRemoveAll",!1),0<notifications.length&&0==t)){var o=notifications[0];QS("notifyx"+o.id)["border-top"]="1px solid transparent"}}}function addNotification(e){null==e.time&&(e.time=Date.now()),null==e.id&&(e.id=Math.random()),notifications.unshift(e),setNotificationCount(notifications.length),clickNotificationIcon(!0);var t=getstore("notifications",0);1&t&&Q("chimes").play();var n=null;if(Notification&&"granted"==Notification.permission){var i=e.text.split("&reg;").join("").split("<b>").join("").split("</b>").join("").split("<br />").join("\r\n");if(e.nodeid){var o=getNodeFromId(e.nodeid);o&&(n=16&t?new Notification("{{{title}}} - "+meshes[o.meshid].name+" - "+o.name,{tag:e.tag,body:i,icon:"/images/notify/icons128-"+o.icon+".png"}):new Notification("{{{title}}} - "+o.name,{tag:e.tag,body:i,icon:"/images/notify/icons128-"+o.icon+".png"}))}else{null==e.icon&&(e.icon=0);var r=e.title;r=null==r?"":" - "+e.title,n=new Notification("{{{title}}}"+r,{tag:e.tag,body:i,icon:"/images/notify/icons128-"+e.icon+".png"})}n.id=e.id,n.xtag=e.tag,n.nodeid=e.nodeid,n.username=e.username,n.onclick=function(e){notificationSelected(e.target.id,!0)},e.notification=n}}function deleteAllNotifications(){notifications=[],setNotificationCount(0),drawNotifications(),QV("notifiyBox",!1)}function setupGeneralServerStats(){window.serverStatCpu=new Chart(document.getElementById("serverCpuChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Verwendet","Frei"]},options:{events:[],responsive:!0,legend:{position:"none"},animation:{animateScale:!0,animateRotate:!0},width:"60px"}}),window.serverStatMemory=new Chart(document.getElementById("serverMemoryChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Verwendet","Frei"]},options:{events:[],responsive:!0,legend:{position:"none"},animation:{animateScale:!0,animateRotate:!0},width:"60px"}})}var lastServerStats=null;function updateGeneralServerStats(e){if(null!=e?lastServerStats=e:e=lastServerStats,null!=e){var t={ServerState:"Server-Zustand",AgentErrorCounters:"Agent-Fehlerzähler",UnknownGroup:"Unbekannte Gruppe",InvalidPKCSsignature:"Ungültige PKCS-Signatur",InvalidRSAsiguature:"Ungültige RSA-Signatur",InvalidJSON:"Ungültiges JSON",UnknownAction:"Unbekannte Aktion",BadWebCertificate:"Ungültiges Web-Zertifikat",BadSignature:"Ungültige Unterschrift",MaxSessionsReached:"Maximale Sitzungen erreicht",UnknownDeviceGroup:"Unbekannte Gerätegruppe",InvalidDeviceGroupType:"Ungültiger Gerätegruppentyp",DuplicateAgent:"Agent-Duplikat",ConnectedIntelAMT:"Verbinden per Intel&reg; AMT",RelayErrors:"Weiterleitungsfehler",UserAccounts:"Benutzerkonten",DeviceGroups:"Gerätegruppen",AgentSessions:"Agent-Sitzungen",ConnectedUsers:"Verbundene Benutzer",UsersSessions:"Benutzersitzungen",RelaySessions:"Weiterleitungssitzungen",RelayCount:"Weiterleitungsanzahl"};if("object"==typeof e.cpuavg){var n=Math.min(e.cpuavg[0],1);window.serverStatCpu.config.data.datasets[0].data=[n,1-n],QH("serverCpuChartText",'<div style=margin-bottom:5px>CPU-Auslastung</div><div><b title="CPU-Auslastung der vergangenen Minute">'+Math.round(100*e.cpuavg[0])/100+'</b>, <b title="CPU-Auslastung der vergangenen 5 Minuten">'+Math.round(100*e.cpuavg[1])/100+'</b>, <b title="CPU-Auslastung der vergangenen 15 Minuten">'+Math.round(100*e.cpuavg[2])/100+"</b></div>"),QS("serverCpuChartView").display="inline-block",window.serverStatCpu.update()}"number"==typeof e.totalmem&&"number"==typeof e.freemem&&(window.serverStatMemory.config.data.datasets[0].data=[e.totalmem-e.freemem,e.freemem],QH("serverMemoryChartText","<div style=margin-bottom:5px>Speicher</div><div><b>"+getNiceSize2(e.freemem)+"</b> frei, <b>"+getNiceSize2(e.totalmem)+"</b> gesamt</div>"),QS("serverMemoryChartView").display="inline-block",window.serverStatMemory.update());var i="<div style=width:100% cellpadding=0 cellspacing=0>";if("object"==typeof e.values)for(var o in e.values)for(var r in i+="<div class=userTableHeader style=margin-bottom:4px;width:200px>"+(t[o]?t[o]:o)+"</div>",e.values[o])i+="<div style=display:inline-block><table class=serverStateTableCell><tr><td class=h1></td><td><span>"+(t[r]?t[r]:r)+"</span><span style=float:right>"+e.values[o][r]+"</span></td><td class=h2></td></tr></table></div>";i+="</div>",QH("serverStatsTable",i)}}var serverTimelineStats=null,serverTimelineConfig={type:"line",data:{labels:[],datasets:[{label:"",backgroundColor:"rgba(255, 99, 132, .5)",borderColor:"rgb(255, 99, 132)",data:[],fill:!0}]},options:{animation:!1,responsive:!0,maintainAspectRatio:!1,elements:{line:{cubicInterpolationMode:"monotone"}},scales:{xAxes:[{type:"time",time:{tooltipFormat:"ll HH:mm"},display:!0,scaleLabel:{display:!1,labelString:""}}],yAxes:[{type:"linear",display:!0,scaleLabel:{display:!0,labelString:""}}]}}};function refreshServerTimelineStats(e){meshserver.send({action:"servertimelinestats",hours:720})}function pastDate(e){var t=new Date;return t.setTime(t.getTime()-36e5*e),t}function setServerTimelineStats(e){serverTimelineStats=e,updateServerTimelineStats()}function addServerTimelineStats(e){if(null!=serverTimelineStats){serverTimelineStats.push(e);var t=Q("p40type").value;0==t?(serverTimelineConfig.data.datasets[0].data.push({x:e.time,y:e.conn.ca}),serverTimelineConfig.data.datasets[1].data.push({x:e.time,y:e.conn.cu}),serverTimelineConfig.data.datasets[2].data.push({x:e.time,y:e.conn.us}),serverTimelineConfig.data.datasets[3].data.push({x:e.time,y:e.conn.rs}),null!=e.conn.am&&serverTimelineConfig.data.datasets[4].data.push({x:e.time,y:e.conn.am})):1==t&&(serverTimelineConfig.data.datasets[0].data.push({x:e.time,y:e.mem.external/1048576}),serverTimelineConfig.data.datasets[1].data.push({x:e.time,y:e.mem.heapUsed/1048576}),serverTimelineConfig.data.datasets[2].data.push({x:e.time,y:e.mem.heapTotal/1048576}),serverTimelineConfig.data.datasets[3].data.push({x:e.time,y:e.mem.rss/1048576})),updateServerTimelineHours()}}function updateServerTimelineHours(){serverTimelineConfig.options.scales.yAxes[0].type=Q("p40log").checked?"logarithmic":"linear",serverTimelineConfig.options.scales.xAxes[0].time={min:pastDate(Q("p40time").value)},window.serverMainStats.update()}function setupServerTimelineStats(){window.serverMainStats=new Chart(document.getElementById("serverMainStats").getContext("2d"),serverTimelineConfig)}function updateServerTimelineStats(){var e,t=Q("p40type").value,n=pastDate(Q("p40time").value);if(serverTimelineConfig.options.scales.xAxes[0].time={min:n},0==t){serverTimelineConfig.options.scales.yAxes[0].scaleLabel.labelString="Verbindungsanzahl",e={labels:[pastDate(0),n],datasets:[{label:"Agenten",data:[],backgroundColor:"rgba(158, 151, 16, .1)",borderColor:"rgb(158, 151, 16)",fill:!0},{label:"Benutzer",data:[],backgroundColor:"rgba(16, 84, 158, .1)",borderColor:"rgb(16, 84, 158)",fill:!0},{label:"Benutzersitzungen",data:[],backgroundColor:"rgba(255, 99, 132, .1)",borderColor:"rgb(255, 99, 132)",fill:!0},{label:"Weiterleitungssitzungen",data:[],backgroundColor:"rgba(39, 158, 16, .1)",borderColor:"rgb(39, 158, 16)",fill:!0},{label:"Intel AMT",data:[],backgroundColor:"rgba(134, 16, 158, .1)",borderColor:"rgb(134, 16, 158)",fill:!0}]};for(var i=0;i<serverTimelineStats.length;i++){new Date(serverTimelineStats[i].time);1==serverTimelineStats[i].first&&(e.datasets[0].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[1].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[2].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[3].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[4].data.push({x:serverTimelineStats[i].time-1,y:NaN})),serverTimelineStats[i].conn&&(e.datasets[0].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].conn.ca}),e.datasets[1].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].conn.cu}),e.datasets[2].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].conn.us}),e.datasets[3].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].conn.rs}),null!=serverTimelineStats[i].conn.am&&e.datasets[4].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].conn.am}))}}else if(1==t){serverTimelineConfig.options.scales.yAxes[0].scaleLabel.labelString="Megabyte",e={labels:[pastDate(0),n],datasets:[{label:"Extern",data:[],backgroundColor:"rgba(158, 151, 16, .1)",borderColor:"rgb(158, 151, 16)",fill:!0},{label:"Heap verwendet",data:[],backgroundColor:"rgba(16, 84, 158, .1)",borderColor:"rgb(16, 84, 158)",fill:!0},{label:"Heap gesamt",data:[],backgroundColor:"rgba(255, 99, 132, .1)",borderColor:"rgb(255, 99, 132)",fill:!0},{label:"RSS",data:[],backgroundColor:"rgba(39, 158, 16, .1)",borderColor:"rgb(39, 158, 16)",fill:!0}]};for(i=0;i<serverTimelineStats.length;i++)1==serverTimelineStats[i].first&&(e.datasets[0].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[1].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[2].data.push({x:serverTimelineStats[i].time-1,y:NaN}),e.datasets[3].data.push({x:serverTimelineStats[i].time-1,y:NaN})),e.datasets[0].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].mem.external/1048576}),e.datasets[1].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].mem.heapUsed/1048576}),e.datasets[2].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].mem.heapTotal/1048576}),e.datasets[3].data.push({x:serverTimelineStats[i].time,y:serverTimelineStats[i].mem.rss/1048576})}serverTimelineConfig.data=e,window.serverMainStats.update()}function p40downloadEvents(){for(var e="Zeit, conn.agent, conn.users, conn.usersessions, conn.relaysession, conn.intelamt, mem.external, mem.heapused, mem.heaptotal, mem.rss\r\n",t=0;t<serverTimelineStats.length;t++)serverTimelineStats[t].conn&&serverTimelineStats[t].mem&&(e+=new Date(serverTimelineStats[t].time)+", "+serverTimelineStats[t].conn.ca+", "+serverTimelineStats[t].conn.cu+", "+serverTimelineStats[t].conn.us+", "+serverTimelineStats[t].conn.rs+", "+(serverTimelineStats[t].conn.am?serverTimelineStats[t].conn.am:"")+", "+serverTimelineStats[t].mem.external+", "+serverTimelineStats[t].mem.heapUsed+", "+serverTimelineStats[t].mem.heapTotal+", "+serverTimelineStats[t].mem.rss+"\r\n");saveAs(new Blob([e],{type:"application/octet-stream"}),"ServerStats.csv")}var xxdialogMode,xxdialogFunc,xxdialogButtons,xxdialogTag,serverTrace=[],serverTraceSources=[];function displayServerTrace(){var e="",t=parseInt(Q("p41limitdropdown").value);for(var n in serverTrace.length>t&&serverTrace.splice(t),serverTrace)e+="<div class=traceEvent>"+EscapeHtml(new Date(serverTrace[n].time).toLocaleTimeString())+" - <b>"+EscapeHtml(serverTrace[n].source.toUpperCase())+"</b>: "+EscapeHtml(serverTrace[n].args.join(", "))+"</div>";QH("p41events",e)}function clearServerTracing(){serverTrace=[],displayServerTrace()}function setServerTracing(){var e="";e+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:5px"><b>Kernserver</b></div>',e+="<div><label><input type=checkbox id=p41c1 "+(0<=serverTraceSources.indexOf("cookie")?"checked":"")+">Cookie-Kodierer</label></div>",e+="<div><label><input type=checkbox id=p41c2 "+(0<=serverTraceSources.indexOf("dispatch")?"checked":"")+">Nachrichten-Verteiler</label></div>",e+="<div><label><input type=checkbox id=p41c3 "+(0<=serverTraceSources.indexOf("main")?"checked":"")+">Hauptserver-Nachrichten</label></div>",e+="<div><label><input type=checkbox id=p41c4 "+(0<=serverTraceSources.indexOf("peer")?"checked":"")+">MeshCentral-Serverpeering</label></div>",e+="<div><label><input type=checkbox id=p41c15 "+(0<=serverTraceSources.indexOf("agent")?"checked":"")+">Mesh-Agent-Datenverkehr</label></div>",e+="<div><label><input type=checkbox id=p41c14 "+(0<=serverTraceSources.indexOf("agentupdate")?"checked":"")+">Mesh-Agent-Aktualisierung</label></div>",e+="<div><label><input type=checkbox id=p41c16 "+(0<=serverTraceSources.indexOf("cert")?"checked":"")+">Server-Zertifikat</label></div>",e+="<div><label><input type=checkbox id=p41c17 "+(0<=serverTraceSources.indexOf("db")?"checked":"")+">Server-Datenbank</label></div>",e+="<div><label><input type=checkbox id=p41c18 "+(0<=serverTraceSources.indexOf("email")?"checked":"")+">Email/SMS Traffic</label></div>",e+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:5px"><b>Webserver</b></div>',e+="<div><label><input type=checkbox id=p41c5 "+(0<=serverTraceSources.indexOf("web")?"checked":"")+">Webserver</label></div>",e+="<div><label><input type=checkbox id=p41c6 "+(0<=serverTraceSources.indexOf("webrequest")?"checked":"")+">Webserver-Anfragen</label></div>",e+="<div><label><input type=checkbox id=p41c7 "+(0<=serverTraceSources.indexOf("relay")?"checked":"")+">Websocket-Weiterleitung</label></div>",e+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:5px"><b>Intel AMT</b></div>',e+="<div><label><input type=checkbox id=p41c9 "+(0<=serverTraceSources.indexOf("webrelay")?"checked":"")+">Verbindungsweiterleitung</label></div>",e+="<div><label><input type=checkbox id=p41c10 "+(0<=serverTraceSources.indexOf("mps")?"checked":"")+">CIRA-Server</label></div>",setDialogMode(2,"Server-Tracing",7,setServerTracingEx,e+="<div><label><input type=checkbox id=p41c11 "+(0<=serverTraceSources.indexOf("mpscmd")?"checked":"")+">CIRA-Serverbefehle</label></div>")}function setServerTracingEx(e){var t=[],n=["cookie","dispatch","main","peer","web","webrequest","relay","webrelaydata","webrelay","mps","mpscmd","swarm","swarmcmd","agentupdate","agent","cert","db","email"];if(1==e)for(var i=1;i<19;i++)try{Q("p41c"+i).checked&&t.push(n[i-1])}catch(e){}meshserver.send({action:"traceinfo",traceSources:t})}function p41downloadServerTrace(){var e="Zeit, Quelle, Nachricht\r\n";for(var t in serverTrace)e+='"'+new Date(serverTrace[t].time).toLocaleTimeString()+'","'+serverTrace[t].source+'","'+serverTrace[t].args.join(", ")+'"\r\n';return saveAs(new Blob([e],{type:"application/octet-stream"}),"servertrace.csv"),!1}var xxcurrentView=-1;function setDialogMode(e,t,n,i,o,r){setSessionActivity(),QV("uiMenu",!1),xxdialogMode=e,xxdialogFunc=i,xxdialogButtons=n,xxdialogTag=r,QS("dialog").width=QS("dialog").top=QS("dialog").left=QS("dialog").right=QS("dialog").bottom=null,QE("idx_dlgOkButton",!0),QV("idx_dlgOkButton",1&n),QV("idx_dlgCancelButton",2&n),QV("id_dialogclose",2&n||8&n),QV("idx_dlgDeleteButton",4&n),QV("idx_dlgButtonBar",7&n),t&&QH("id_dialogtitle",t);for(var a=1;a<24;a++)QV("dialog"+a,a==e);QV("dialog",e),o&&(2==e?QH("id_dialogOptions",o):QH("id_dialogMessage",o))}function dialogclose(e){setSessionActivity();var t=xxdialogFunc,n=xxdialogButtons,i=xxdialogTag;setDialogMode(),(8&n||e)&&t&&t(e,i)}function center(){setSessionActivity(),11==xxcurrentView?deskAdjust():10==xxcurrentView?masterUpdate(256):1==xxcurrentView&&masterUpdate(4)}function messagebox(e,t){setSessionActivity(),QH("id_dialogMessage",t),setDialogMode(1,e,1)}function statusbox(e,t){setSessionActivity(),QH("id_dialogMessage",t),setDialogMode(1,e)}function goBack(){setSessionActivity(),xxdialogMode||0==goBackStack.length||(fullscreen&&deskToggleFull(),go(goBackStack.pop()),goBackStack.pop())}function go(e,t){if(null!=pluginHandler&&pluginHandler.callHook("goPageStart",e,t),setSessionActivity(),!xxdialogMode)if(QV("uiMenu",!1),t&&1==t.shiftKey&&15!=e&&""=="{{{currentNode}}}".toLowerCase())10<=e&&e<=19?currentNode&&window.open(window.location.origin+"{{{domainurl}}}?gotonode="+currentNode._id.split("/")[2]+"&viewmode="+e+"&hide=16","meshcentral:"+currentNode._id):20<=e&&e<=29?currentMesh&&window.open(window.location.origin+"{{{domainurl}}}?gotomesh="+currentMesh._id.split("/")[2]+"&viewmode="+e+"&hide=16","meshcentral:"+currentMesh._id):30<=e&&e<=39?currentUser&&window.open(window.location.origin+"{{{domainurl}}}?gotouser="+(serverinfo.crossDomain?currentUser._id:currentUser._id.split("/")[2])+"&viewmode="+e+"&hide=16","meshcentral:"+currentUser._id):50<=e&&e<=59?currentUserGroup&&window.open(window.location.origin+"{{{domainurl}}}?gotougrp="+(serverinfo.crossDomain?currentUserGroup._id:currentUserGroup._id.split("/")[2])+"&viewmode="+e+"&hide=16","meshcentral:"+currentUserGroup._id):window.open(window.location.origin+"{{{domainurl}}}?viewmode="+e+"&hide=0","meshcentral:"+e);else if(xxcurrentView!=e){xxcurrentView<0||e<10?goBackStack=[]:50!=xxcurrentView&&Math.floor(xxcurrentView/10)==Math.floor(e/10)||goBackStack.push(xxcurrentView),11==xxcurrentView&&null!=desktop&&null!=desktop.m.recordedData&&deskRecordSession(),(4==e&&0==(2&userinfo.siteadmin)||0!=(4&features))&&(e=52);for(var n=0;n<53;n++)QV("p"+n,n==e);if(xxcurrentView=e,fullscreen&&deskToggleFull(),0==(268435456&features)&&0<xxcurrentView){var i="";for(var n in 10<=xxcurrentView&&xxcurrentView<=19?null!=currentNode&&(i="?viewmode="+xxcurrentView+"&gotonode="+currentNode._id.split("/")[2]):20<=xxcurrentView&&xxcurrentView<=29?null!=currentMesh&&(i="?viewmode="+xxcurrentView+"&gotomesh="+currentMesh._id.split("/")[2]):30<=xxcurrentView&&xxcurrentView<=39?null!=currentUser&&(i="?viewmode="+xxcurrentView+"&gotouser="+(serverinfo.crossDomain?currentUser._id:currentUser._id.split("/")[2])):51<=xxcurrentView&&xxcurrentView<=51?null!=currentUserGroup&&null!=currentUserGroup._id&&(i="?viewmode="+xxcurrentView+"&gotougrp="+(serverinfo.crossDomain?currentUserGroup._id:currentUserGroup._id.split("/")[2])):1<xxcurrentView&&(i="?viewmode="+xxcurrentView),urlargs)i+=(""==i?"?":"&")+n+"="+urlargs[n];try{window.history.replaceState({},document.title,window.location.pathname+i)}catch(e){}}var o=["MainMenuMyDevices","MainMenuMyAccount","MainMenuMyEvents","MainMenuMyFiles","MainMenuMyUsers","MainMenuMyServer"];for(var n in o)QC(o[n]).remove("fullselect"),QC(o[n]).remove("semiselect");var r=["LeftMenuMyDevices","LeftMenuMyAccount","LeftMenuMyEvents","LeftMenuMyFiles","LeftMenuMyUsers","LeftMenuMyServer"];for(var n in r)QC(r[n]).remove("lbbuttonsel"),QC(r[n]).remove("lbbuttonsel2");var a=e<9?"fullselect":"semiselect",s=e<9||115==e||40==e||41==e||42==e?"lbbuttonsel2":"lbbuttonsel",l=0;0<goBackStack.length&&(l=goBackStack[goBackStack.length-1]),1==e||1==l||0==l&&10<=e&&e<20?(QC("MainMenuMyDevices").add(a),QC("LeftMenuMyDevices").add(s)):2==e||2==l||0==l&&20<=e&&e<30?(QC("MainMenuMyAccount").add(a),QC("LeftMenuMyAccount").add(s)):3==e?(QC("MainMenuMyEvents").add(a),QC("LeftMenuMyEvents").add(s)):4==e||30<=e&&e<40||50==e||51==e||52==e?(QC("MainMenuMyUsers").add(a),QC("LeftMenuMyUsers").add(s)):5==e?(QC("MainMenuMyFiles").add(a),QC("LeftMenuMyFiles").add(s)):(6==e||115==e||40<=e&&e<50)&&(QC("MainMenuMyServer").add(a),QC("LeftMenuMyServer").add(s)),QV("ServerPlugins",null!=pluginHandler),webPageStackMenu&&10<=e?QC("column_l").add("room4submenu"):QC("column_l").remove("room4submenu"),QV("topbar",0!=e),0==e&&webPageFullScreen&&QC("body").add("arg_hide"),QV("MainSubMenuSpan",10<=e&&e<20),QV("UserDummyMenuSpan",51==e||e<10&&6!=e&&webPageFullScreen),QV("MeshSubMenuSpan",20<=e&&e<30),QV("UserSubMenuSpan",30<=e&&e<40),QV("ServerSubMenuSpan",6==e||115==e||40==e||41==e||42==e||43==e),QV("UsersSubMenuSpan",4==e||50==e||52==e);var d={4:"UsersGeneral",10:"MainDev",11:"MainDevDesktop",12:"MainDevTerminal",13:"MainDevFiles",14:"MainDevAmt",15:"MainDevConsole",16:"MainDevEvents",17:"MainDevInfo",19:"MainDevPlugins",20:"MeshGeneral",21:"MeshSummary",30:"UserGeneral",31:"UserEvents",6:"ServerGeneral",40:"ServerStats",41:"ServerTrace",42:"ServerPlugins",50:"UsersGroups",52:"UsersRecordings",115:"ServerConsole"};for(var n in d)QC(d[n]).remove("style3x"),QC(d[n]).remove("style3sel"),QC(d[n]).add(e==n?"style3sel":"style3x");11==e&&deskAdjust(),115==e&&QV("p15",!0),QV("p15uploadCore",115!=e),QV("p15BackButton",115!=e),15!=e&&115!=e||setupConsole(),1==e&&masterUpdate(4),2==e&&Notification&&QV("accountEnableNotificationsSpan","granted"!=Notification.permission),40==e&&null==serverTimelineStats&&refreshServerTimelineStats(),42==e&&refreshPluginLatest(),21==e&&p21updateMesh(),52==e&&(null==p52recordings&&refreshRecodings(),updateRecordings()),12==e&&null!=xtermfit&&(xtermfit.fit(),xterm.focus()),document.title=currentNode&&10<=e&&e<20?currentNode.name+(meshes[currentNode.meshid]?" - "+meshes[currentNode.meshid].name:"")+" - "+decodeURIComponent("{{{extitle}}}"):decodeURIComponent("{{{extitle}}}"),null!=pluginHandler&&pluginHandler.callHook("goPageEnd",e,t),QS("column_l").overflow=0<=[11,12].indexOf(e)?"hidden":null}}function updatePluginList(e){if(null!=pluginHandler){if(Array.isArray(e)&&e.forEach(function(e){updatePluginList(e)}),QV("pluginNoneNotice",0==installedPluginList.length),installedPluginList.length){if(null!=e&&(null==installedPluginList.version_info&&(installedPluginList.version_info=[]),installedPluginList.version_info[e.id]=e),(n=Q("p42tbl").querySelectorAll(".p42tblRow")).length)for(var t in Object.values(n))n[t].parentNode.removeChild(n[t]);var s={0:{text:"Disabled",color:"858483"},1:{text:"Installed",color:"00aa00"}},l={0:{install:"Install",delete:"Delete"},1:{disable:"Disable",upgrade:"Upgrade"}},d=Q("p42tbl");installedPluginList.forEach(function(e){var t=[];if(1==e.hasAdminPanel&&e.status?e.nameHtml="<a onclick=\"return goPlugin('"+e.shortName+"', '"+e.name.replace(/'/g,"\\'")+"');\">"+e.name+"</a>":e.nameHtml=e.name,e.statusText=s[e.status].text,e.statusColor=s[e.status].color,null==e.versionHistoryUrl&&t.push("downgrade"),e.status||(e.version=" - "),e.upgradeAvail="Überprüfen...",null!=installedPluginList.version_info&&null!=installedPluginList.version_info[e._id]){var n=installedPluginList.version_info[e._id];n.hasUpdate?e.upgradeAvail='<a title="Changelog anzeigen" target="_blank" href="'+n.changelogUrl+'">'+n.version+"</a>":(t.push("upgrade"),e.status?e.upgradeAvail="Aktuell":e.upgradeAvail='<a title="Changelog anzeigen" target="_blank" href="'+n.changelogUrl+'">'+n.version+"</a>"),n.meshCentralCompat||(e.upgradeAvail+=' [ <span onclick="return setDialogMode(2, \'Compatibility Issue\', 1, null, \'This plugin version is not compatible with your MeshCentral installation, please upgrade MeshCentral first.\');" title="Version nicht kompatibel, bitte aktualisieren Sie zuerst Ihre MeshCentral-Installation" style="cursor: pointer; color:red;"> ! </span> ]',t.push("install"),t.push("upgrade"))}e.actions="<select onchange=\"return pluginAction(this,'"+e._id+'\');"><option value=""> --</option>';var i=Object.entries(l[e.status]);for(var o in i)-1===t.indexOf(i[o][0])&&(e.actions+='<option value="'+i[o][0]+'">'+i[o][1]+"</option>");e.actions+="</select>";var r="<td><img style=margin-top:3px src=images/plugin24.png></td><td class=gradTable1>&nbsp;</td><td class=gradTable2>"+e.nameHtml+"</td><td class=gradTable2>"+e.description+'</td><td class=gradTable2 style=text-align:center><a href="'+e.homepage+'" target="_blank">Home</a></td><td class=gradTable2 style=text-align:center>'+e.version+'</td><td style=text-align:center class="pluginUpgradeAvailable gradTable2">'+e.upgradeAvail+'</td><td class=gradTable2 style="text-align:center;color:#'+e.statusColor+'">'+e.statusText+'</td><td class="pluginAction gradTable2" style=text-align:center>'+e.actions+"</td><td class=gradTable3>&nbsp;</td>",a=d.insertRow(-1);a.innerHTML=r,a.classList.add("p42tblRow"),a.setAttribute("data-id",e._id),a.setAttribute("id","pluginRow-"+e._id)})}else{var n=Q("p42tbl").querySelectorAll(".p42tblRow");for(var t in Object.values(n))n[t].parentNode.removeChild(n[t])}null==e&&refreshPluginLatest()}}function refreshPluginLatest(){null!=pluginHandler&&meshserver.send({action:"pluginLatestCheck"})}function distributeCore(){null!=pluginHandler&&(meshserver.send({action:"distributeCore",nodes:nodes}),QV("pluginRestartNotice",!1))}function pluginActionEx(){if(null!=pluginHandler){var e=Q("lastPluginAct").value,t=Q("lastPluginId").value,n=Q("lastPluginVersion").value;switch(e){case"upgrade":case"install":meshserver.send({action:"installplugin",id:t,version_only:!1});break;case"downgrade":Q("lastPluginVersion").querySelectorAll("option").forEach(function(e){e.value==n&&(pVers=e.text)}),meshserver.send({action:"installplugin",id:t,version_only:{name:pVers,url:n}});break;case"delete":meshserver.send({action:"removeplugin",id:t});break;case"disable":meshserver.send({action:"disableplugin",id:t})}QV("pluginRestartNotice",!0)}}function pluginAction(e,t){if(null!=pluginHandler){if("downgrade"==e.value)meshserver.send({action:"getpluginversions",id:t});else{var n=null;for(var i in installedPluginList)installedPluginList[i]._id==t&&(n=installedPluginList[i]);setDialogMode(2,"Plugin-Aktion",3,pluginActionEx,format("Möchten Sie wirklich das Plugin {0}: {1}",e.value,n.name)+'<input id="lastPluginAct" type="hidden" value="'+e.value+'" /><input id="lastPluginId" type="hidden" value="'+t+'" /><input id="lastPluginVersion" type="hidden" value="" />')}e.value=""}}function goPlugin(e,t){null!=pluginHandler&&(null==e?Q("p43iframe").src="":(QH("p43title",t),Q("p43iframe").src="/pluginadmin.ashx?pin="+e,go(43)))}function GetMeshRights(e,t){if(null==e)return 0;if(null==t&&(t=userinfo._id),"string"==typeof e&&(e=meshes[e]),null==e||null==e.links)return 0;if(serverinfo.manageAllDeviceGroups)return 4294967295;var n=0,i=e.links[t];if(null!=i){if(4294967295==i.rights)return 4294967295;n=i.rights}var o=null;if(t==userinfo._id?o=userinfo:null!=users&&(o=users[t]),null!=o)for(var r in o.links)if(r.startsWith("ugrp/")&&null!=(i=e.links[r])){if(4294967295==i.rights)return 4294967295;n|=i.rights}return n}function IsMeshViewable(e,t){if(null==e)return!1;if(null==t&&(t=userinfo._id),"string"==typeof e&&(e=meshes[e]),null==e||null==e.links)return!1;if(null!=e.links[t])return!0;if(serverinfo.manageAllDeviceGroups)return!0;var n=null;if(t==userinfo._id?n=userinfo:null!=users&&(n=users[t]),null!=n)for(var i in n.links)if(i.startsWith("ugrp/")&&null!=e.links[i])return!0;return!1}function GetNodeRights(e,t){if(null==e)return 0;if(null==t&&(t=userinfo._id),"string"==typeof e&&null==(e=getNodeFromId(e)))return 0;var n=GetMeshRights(e.meshid,t);if(4294967295==n)return n;if(null!=e.links&&null!=e.links[t]&&(n|=e.links[t].rights),null!=e.links&&null!=userinfo.links)for(var i in e.links)i.startsWith("ugrp/")&&null!=userinfo.links[i]&&null!=e.links[i].rights&&(n|=e.links[i].rights);return n}function IsNodeViewable(e,t){if(null==e)return!1;if(null==t&&(t=userinfo._id),"string"==typeof e&&null==(e=getNodeFromId(e)))return!1;if(IsMeshViewable(e.meshid,t))return!0;if(null!=e.links&&null!=e.links[t])return!0;if(null!=e.links&&null!=userinfo.links)for(var n in e.links)if(n.startsWith("ugrp/")&&null!=userinfo.links[n]&&null!=e.links[n].rights)return!0;return!1}if("undefined"==typeof TextEncoder){window.TextEncoder=function(){},TextEncoder.prototype.encode=function(e){for(var t=e.length,n=-1,i="undefined"==typeof Uint8Array?new Array(1.5*t):new Uint8Array(3*t),o=0,r=0,a=0;a!==t;){if(o=e.charCodeAt(a),a+=1,55296<=o&&o<=56319){if(a===t){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;break}if(!(56320<=(r=e.charCodeAt(a))&&r<=57343)){i[n+=1]=239,i[n+=1]=191,i[n+=1]=189;continue}if(a+=1,65535<(o=1024*(o-55296)+r-56320+65536)){i[n+=1]=240|o>>>18,i[n+=1]=128|o>>>12&63,i[n+=1]=128|o>>>6&63,i[n+=1]=128|63&o;continue}}o<=127?i[n+=1]=0|o:(o<=2047?i[n+=1]=192|o>>>6:(i[n+=1]=224|o>>>12,i[n+=1]=128|o>>>6&63),i[n+=1]=128|63&o)}return"undefined"!=typeof Uint8Array?i.subarray(0,n+1):(i.length=n+1,i)},TextEncoder.prototype.toString=function(){return"[object TextEncoder]"};try{Object.defineProperty(TextEncoder.prototype,"encoding",{get:function(){if(TextEncoder.prototype.isPrototypeOf(this))return"utf-8";throw TypeError("Illegal invocation")}})}catch(e){TextEncoder.prototype.encoding="utf-8"}"undefined"!=typeof Symbol&&(TextEncoder.prototype[Symbol.toStringTag]="TextEncoder")}function joinPaths(){var e=[];for(var t in arguments){var n=arguments[t];if(null!=n&&""!=n){for(;n.endsWith("/")||n.endsWith("\\");)n=n.substring(0,n.length-1);for(;n.startsWith("/")||n.startsWith("\\");)n=n.substring(1);e.push(n)}}return e.join("/")}function putstore(e,t){try{if("undefined"==typeof localStorage||localStorage.getItem(e)==t)return;null==t?localStorage.removeItem(e):localStorage.setItem(e,t)}catch(e){}if("_"!=e[0]){var n={};try{for(var i=0,o=localStorage.length;i<o;++i){var r=localStorage.key(i);"_"!=r[0]&&(n[r]=localStorage.getItem(r),"desktopsettings"!=r&&"string"==typeof n[r]&&64<n[r].length&&delete n[r])}}catch(e){}meshserver.send({action:"userWebState",state:JSON.stringify(n)})}}function getstore(e,t){try{if("undefined"==typeof localStorage)return t;var n=localStorage.getItem(e);return null==n||null==n?t:n}catch(e){return t}}function addLink(e,t){return"<span tabindex=0 style=cursor:pointer;text-decoration:none onclick='"+t+"' onkeypress=\"if (event.key=='Enter') {"+t+'} ">'+e+" <img class=hoverButton src=images/link5.png></span>"}function addLinkConditional(e,t,n){return n?addLink(e,t):e}function haltEvent(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1}function addOption(e,t,n){var i=document.createElement("option");i.text=t,i.value=n,Q(e).add(i)}function passwordcheck(e){return 7<e.length&&/\d/.test(e)&&/[a-z]/.test(e)&&/[A-Z]/.test(e)&&/\W/.test(e)}function methodcheck(e){return!(!e||null==e||!e.Body||"SUCCESS"==e.Body.ReturnValueStr)&&(messagebox("Aufruf-Fehler",e.Header.Method+": "+e.Body.ReturnValueStr.replace("_"," ")),!0)}function TableStart(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=200px><p><td>"}function TableStart2(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><p><td>"}function TableEntry(e,t){return"<tr><td><p>"+e+"<td>"+t}function FullTable(e,t){var n=TableStart();for(i in e)i&&e[i]&&(n+=TableEntry(i,e[i]));return n+TableEnd(t)}function TableEnd(e){return"<tr><td colspan=2><p>"+(e||"")+"</table>"}function AddButton(e,t){return'<input type=button value="'+e+'" onclick="'+t+'" style=margin:4px>'}function AddButton2(e,t){return'<input type=button value="'+e+'" onclick="'+t+'">'}function AddRefreshButton(e){return'<input type=button name=refreshbtn value=Refresh onclick="refreshButtons(false);'+e+'" style=margin:4px '+(0==refreshButtonsState?"disabled":"")+">"}function MoreStart(){return'<a href=# style=cursor:pointer;color:blue id=morexxx1 onclick=QV("morexxx1",false);QV("morexxx2",true)>&#x25BC; Mehr</a><div id=morexxx2 style=display:none><br><hr>'}function MoreEnd(){return'<a href=# style=cursor:pointer;color:blue onclick=QV("morexxx2",false);QV("morexxx1",true)>&#x25B2; Weniger</a></div>'}function getSelectedOptions(e){for(var t,n=[],i=0,o=e.options.length;i<o;i++)(t=e.options[i]).selected&&n.push(t.value);return n}function getInstance(e,t){for(var n in e)if(e[n].InstanceID==t)return e[n];return null}function getItem(e,t,n){for(var i in e)if(e[i][t]==n)return e[i];return null}function guidToStr(e){return e.substring(6,8)+e.substring(4,6)+e.substring(2,4)+e.substring(0,2)+"-"+e.substring(10,12)+e.substring(8,10)+"-"+e.substring(14,16)+e.substring(12,14)+"-"+e.substring(16,20)+"-"+e.substring(20)}function getUrlVars(){for(var e,t=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<n.length;i++)0<(e=n[i].indexOf("="))&&(t[n[i].substring(0,e)]=n[i].substring(e+1,n[i].length));return t}function addHtmlValue(e,t){return"<table><td style=width:120px>"+e+"<td><b>"+t+"</b></table>"}function addHtmlValue2(e,t){return"<div><div style=display:inline-block;float:right>"+t+"</div><div style=display:inline-block>"+e+"</div></div>"}function addHtmlValue3(e,t){return"<div><b>"+e+"</b></div><div style=margin-left:16px>"+t+"</div>"}function addHtmlValue4(e,t){return"<table style=width:100%><td style=width:120px>"+e+"<td style=text-align:right><b>"+t+"</b></table>"}function parseUriArgs(){var e=window.document.location.href;e.endsWith("#")&&(e=e.substring(0,e.length-1));var t,n={},i=e.split(/[\?&|\=]/);for(o in i.splice(0,1),i)switch(o%2){case 0:t=decodeURIComponent(i[o]);break;case 1:n[t]=decodeURIComponent(i[o]);var o=parseInt(n[t]);o==n[t]&&(n[t]=o)}return n}function focusTextBox(e){setTimeout(function(){Q(e).selectionStart=Q(e).selectionEnd=65535,Q(e).focus()},0)}function validateEmail(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function isPrivateIP(e){return e.startsWith("10.")||e.startsWith("172.16.")||e.startsWith("192.168.")}function u2fSupported(){return window.u2f&&(0<navigator.userAgent.indexOf("Chrome/")||0<navigator.userAgent.indexOf("Firefox/")||0<navigator.userAgent.indexOf("Opera/")||0<navigator.userAgent.indexOf("Safari/"))}function findOne(t,e){return null!=t&&null!=e&&e.some(function(e){return 0<=t.indexOf(e)})}function copyTextToClip(e){var t=document.createElement("DIV");t.textContent=e,document.body.appendChild(t),function(e){if(document.selection)(t=document.body.createTextRange()).moveToElementText(e),t.select();else if(window.getSelection){var t;(t=document.createRange()).selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}}(t),document.execCommand("copy"),t.remove()}function copyTextToClip2(e){var t=document.createElement("DIV");t.textContent=decodeURIComponent(e),document.body.appendChild(t),function(e){if(document.selection)(t=document.body.createTextRange()).moveToElementText(e),t.select();else if(window.getSelection){var t;(t=document.createRange()).selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}}(t),document.execCommand("copy"),t.remove()}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}function printDate(e){return e.toLocaleDateString(args.locale)}function printTime(e){return e.toLocaleTimeString(args.locale)}function printDateTime(e){return e.toLocaleString(args.locale)}function addDetailItem(e,t,n){return"<table style=width:100%><td>"+nobreak(e)+"<td style=text-align:right>"+t+"</table>"}function format(e){var n=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,t){return void 0!==n[t]?n[t]:e})}function addTextLink(e,t,n){var i=t.toLowerCase().indexOf(e.toLowerCase());return-1==i?t:t.substring(0,i)+'<a href="'+n+'">'+e+"</a>"+t.substring(i+e.length)}function getOrderedList(e,o){var t=[];for(var n in e)t.push(e[n]);return t.sort(function(e,t){var n=e[o].toLowerCase(),i=t[o].toLowerCase();return i<n?1:n<i?-1:0}),t}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}function nobreak(e){return e.split(" ").join("&nbsp;")}function pad2(e){var t="00"+e;return t.substr(t.length-2)}function encodeURIComponentEx(e){return encodeURIComponent(e).replace(/'/g,"%27")}function getUserName(e){return users&&null!=users[e]?users[e].name:e.split("/")[2]}</script>