<!doctypehtml><html lang=ko 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>정보</b></div><div id=cxdesktop class=cmtext onclick=cmaction(3,event)>데스크탑</div><div id=cxterminal class=cmtext onclick=cmaction(2,event)>터미널</div><div id=cxfiles class=cmtext onclick=cmaction(4,event)>파일</div><div id=cxevents class=cmtext onclick=cmaction(5,event)>이벤트</div><div id=cxdetails class=cmtext onclick=cmaction(6,event)>세부사항</div><div id=cxconsole class=cmtext onclick=cmaction(7,event)>콘솔</div><div id=cxplugins class=cmtext onclick=cmaction(8,event) style=display:none>플러그인</div><hr id=cxmgroupsplit><div id=cxmdesktop class=cmtext onclick=cmaction(9,event) style=display:none>다중 데스크탑</div></div><div id=meshContextMenu class="contextMenu noselect"style=display:none;min-width:0><div id=cxselectall class=cmtext onclick=cmmeshaction(1,event)>모두 선택</div><div id=cxselectnone class=cmtext onclick=cmmeshaction(2,event)>선택하지 않음</div></div><div id=termShellContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmtermaction(1,event)><b>관리자 쉘</b></div><div class=cmtext onclick=cmtermaction(6,event)>PowerShell 관리자</div><div class=cmtext onclick=cmtermaction(8,event)>사용자 쉘</div><div class=cmtext onclick=cmtermaction(9,event)>사용자 PowerShell</div></div><div id=termShellContextMenuLinux class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmtermaction(1,event)><b>루트 쉘</b></div><div class=cmtext onclick=cmtermaction(8,event)>사용자 쉘</div><div class=cmtext onclick=cmtermaction(100,event)>로그인 쉘</div></div><div id=deskConnectContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmdeskaction(1,event)>연결 요청 + Bar</div><div class=cmtext onclick=cmdeskaction(2,event)>연결 요청</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)>대체 포트</div></div><div id=rfbPortContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmrfbportaction(1,event)>대체 포트</div></div><div id=filesContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmfilesaction(1,event)>이름 바꾸기</div><div class=cmtext onclick=cmfilesaction(2,event)>편집</div><div class=cmtext onclick=cmfilesaction(3,event)>삭제</div></div><div id=deskPlayerContextMenu class="contextMenu noselect"style=display:none;min-width:0><div class=cmtext onclick=cmdeskplayeraction(1,event)>플레이어 열기 ...</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="현재 알림을 보려면 클릭하십시오.">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="내 장치"onclick=go(1,event) onkeypress='"Enter"==event.key&&go(1)'><div class=lb2></div></div><div id=LeftMenuMyAccount tabindex=0 class=lbbutton title="내 계정"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'><div class=lb1></div></div><div id=LeftMenuMyEvents tabindex=0 class=lbbutton title="내 이벤트"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="내 파일"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="내 사용자"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="내 서버"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="사용자 인터페이스 선택"onclick=showUserInterfaceSelectMenu() onkeypress='"Enter"==event.key&&showUserInterfaceSelectMenu()'>♦<div id=uiMenu style=display:none><div tabindex=0 id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="왼쪽 바 인터페이스"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(1)'><div class=uiSelector1></div></div><div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="상단 바 인터페이스"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(2)'><div class=uiSelector2></div></div><div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="고정 폭 인터페이스"onkeypress='"Enter"==event.key&&userInterfaceSelectMenu(3)'><div class=uiSelector3></div></div><div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="야간 모드 전환"onkeypress='"Enter"==event.key&&toggleNightMode()'><div class=uiSelector4></div></div><div tabindex=0 id=uiViewButton5 class=uiSelector onclick=toggleFooterBarMode() title="바닥 글 바 전환"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)'>내 장치<td tabindex=0 id=MainMenuMyAccount class="topbar_td style3x"onclick=go(2,event) onkeypress='"Enter"==event.key&&go(2)'>내 계정<td tabindex=0 id=MainMenuMyEvents class="topbar_td style3x"onclick=go(3,event) onkeypress='"Enter"==event.key&&go(3)'>내 이벤트<td tabindex=0 id=MainMenuMyFiles class="topbar_td style3x"onclick=go(5,event) onkeypress='"Enter"==event.key&&go(5)'>내 파일<td tabindex=0 id=MainMenuMyUsers class="topbar_td style3x"onclick=go(4,event) onkeypress='"Enter"==event.key&&go(4)'>내 사용자<td tabindex=0 id=MainMenuMyServer class="topbar_td style3x"onclick=go(6,event) onkeypress='"Enter"==event.key&&go(6)'>내 서버<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)'>일반<td tabindex=0 id=MainDevDesktop class="topbar_td style3x"onclick=go(11,event) onkeypress='"Enter"==event.key&&go(11)'>데스크탑<td tabindex=0 id=MainDevTerminal class="topbar_td style3x"onclick=go(12,event) onkeypress='"Enter"==event.key&&go(12)'>터미널<td tabindex=0 id=MainDevFiles class="topbar_td style3x"onclick=go(13,event) onkeypress='"Enter"==event.key&&go(13)'>파일<td tabindex=0 id=MainDevEvents class="topbar_td style3x"onclick=go(16,event) onkeypress='"Enter"==event.key&&go(16)'>이벤트<td tabindex=0 id=MainDevInfo class="topbar_td style3x"onclick=go(17,event) onkeypress='"Enter"==event.key&&go(17)'>세부사항<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)'>콘솔<td tabindex=0 id=MainDevPlugins class="topbar_td style3x"onclick=go(19,event) onkeypress='"Enter"==event.key&&go(19)'>플러그인<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)'>일반<td tabindex=0 id=MeshSummary class="topbar_td style3x"onclick=go(21,event) onkeypress='"Enter"==event.key&&go(21)'>요약<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)'>일반<td tabindex=0 id=UserEvents class="topbar_td style3x"onclick=go(31,event) onkeypress='"Enter"==event.key&&go(31)'>이벤트<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)'>사용자<td tabindex=0 id=UsersGroups class="topbar_td style3x"onclick=go(50,event) onkeypress='"Enter"==event.key&&go(50)'>여러 그룹<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)'>일반<td tabindex=0 id=ServerStats class="topbar_td style3x"onclick=go(40,event) onkeypress='"Enter"==event.key&&go(40)'>통계<td tabindex=0 id=ServerConsole class="topbar_td style3x"onclick=go(115,event) onkeypress='"Enter"==event.key&&go(115)'>콘솔<td tabindex=0 id=ServerTrace class="topbar_td style3x"onclick=go(41,event) onkeypress='"Enter"==event.key&&go(41)'>기록<td tabindex=0 id=ServerPlugins class="topbar_td style3x"onclick=go(42,event) onkeypress='"Enter"==event.key&&go(42)'>플러그인<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>서버 연결이 끊어졌습니다</span>,<href onclick=reload() style=cursor:pointer><u>다시 연결하려면 클릭하십시오.</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=열><div class=viewSelector2></div></div><div tabindex=0 id=devViewButton2 class=viewSelector onclick=onDeviceViewChange(2) onkeypress='"Enter"==event.key&&onDeviceViewChange(2)'title=목록><div class=viewSelector1></div></div><div tabindex=0 id=devViewButton3 class=viewSelector onclick=onDeviceViewChange(3) onkeypress='"Enter"==event.key&&onDeviceViewChange(3)'title="여러 데스크톱"><div class=viewSelector3></div></div><div tabindex=0 id=devViewButton4 class=viewSelector onclick=onDeviceViewChange(4) onkeypress='"Enter"==event.key&&onDeviceViewChange(4)'title=지도 style=display:none><div class=viewSelector4></div></div></div><div><h1>내 장치</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="모두 선택">&nbsp; <input type=button id=GroupActionButton disabled value="그룹 동작"onclick=groupActionFunction()>&nbsp; <input id=SearchInput placeholder=필터 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="장치 운영체제 이름 표시">OS에서 설정한 이름</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="모두 연결">&nbsp; <input type=button onclick=disconnectAllKvmFunction() value="모두 연결 해제">&nbsp; <label><input type=checkbox id=autoConnectDesktopCheckbox onclick=autoConnectDesktops(event) title="자동 연결">자동&nbsp;</label> <input type=button onclick=showMultiDesktopSettings() value=설정>&nbsp; <input id=KvmSearchInput placeholder=필터 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="위치 검색"onfocus=onMapSearchFocus(1) onblur=onMapSearchFocus(0)> <input type=button value=검색 title="위치 검색"onclick=getSearchLocation()> <input type=button id=refreshmap title="지도보기 초기화"value=초기화 onclick=refreshMap(!1,!0)><td class=auto-style1 style=height:100%><div style=display:none id=devListToolbarView>보기 <select id=viewselect onchange=onDeviceViewChange()><option value=1>열<option value=2>목록<option value=3>여러 데스크톱<option id=viewselectmapoption value=4 style=display:none>지도</select></div><div style=display:none id=devListToolbarSort>정렬 <select id=sortselect onchange=masterUpdate(6)><option>그룹<option>전원<option>장치<option>태그</select> &nbsp;</div><div style=display:none id=devListToolbarSize>크기 <select id=sizeselect onchange=onDeviceViewChange()><option value=0>작은<option value=1>중간<option value=2>큰</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>시작하려면, <a href=# onclick="return account_createMesh()"><strong>장치 그룹을 만들려면 여기를 클릭하십시오</strong></a>.</div><div id=getStarted2>장치 그룹이 없습니다.</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>위치 결과</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>내 계정</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>계정 보안</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()">휴대폰 번호 관리</a><br></span></div><div id=manageEmail2FA><div class=p2AccountActions><span id=authEmailSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthEmail()">이메일 인증 관리</a><br></span></div><div id=manageAuthApp><div class=p2AccountActions><span id=authAppSetupCheck><strong>✓</strong></span></div><span><a href=# onclick="return account_manageAuthApp()">2단계 인증앱 관리</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)">보안 키 관리</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)">백업 코드 관리</a><br></span></div></div></div><div id=p2AccountActions><p><strong>계정 동작</strong><p class=mL><span id=managePhoneNumber2 style=display:none><a href=# onclick="return account_managePhone()">휴대폰 번호 관리</a><br></span><span id=verifyEmailId style=display:none><a href=# onclick="return account_showVerifyEmail()">이메일 검증</a><br></span><span id=accountEnableNotificationsSpan style=display:none><a href=# onclick="return account_enableNotifications()">웹 알림 사용</a><br></span><a href=# onclick="return account_showLocalizationSettings()">현지화 설정</a><br><a href=# onclick="return account_showAccountNotifySettings()">알림 설정</a><br><span id=p2AccountPassActions><span id=accountChangeEmailAddressSpan style=display:none><a href=# onclick="return account_showChangeEmail()">이메일 주소</a><br></span><a href=# onclick="return account_showChangePassword()">비밀번호 변경</a><span id=p2nextPasswordUpdateTime></span><br><a href=# onclick="return account_showDeleteAccount()">계정 삭제</a><br></span></p><br style=clear:both></div><strong>장치 그룹</strong> <span id=p2createMeshLink1>( <a href=# onclick="return account_createMesh()"class=newMeshBtn>새로운</a> )</span><br><br><div id=p2meshes></div><div id=p2noMeshFound style=display:none>장치 그룹이 없습니다.<span id=p2createMeshLink2> <a href=# onclick="return account_createMesh()"><strong>여기서 시작하십시오!</strong></a></span></div><br style=clear:both></div></div><div id=p3 style=display:none><div id=p3title><h1>내 이벤트</h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>보이기 <select id=p3limitdropdown onchange=refreshEvents()><option value=60>최근 60<option value=120>최근 120<option value=250>최근 250<option value=500>최근 500<option value=1000>최근 1000</select>&nbsp; <a href=# onclick=p3showDownloadEventsDialog(2)><img src=images/link4.png height=10 width=10 title="이벤트 다운로드"style=cursor:pointer></a>&nbsp;<td class=h2></table><div id=p3events></div></div><div id=p4 style=display:none><div id=p4title><h1>내 사용자</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=방송> <a href=# onclick=p4downloadUserInfo()><img style=cursor:pointer title="사용자 정보 다운로드"src=images/link4.png></a><a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style=cursor:pointer;display:none title="여러 사용자 계정을 일괄 생성"src=images/link6.png></a></div><div><input type=button id=UsersSelectAllButton onclick=p3usersSelectallButtonFunction() value="모두 선택"> <input type=button id=UsersGroupActionButton disabled value="그룹 동작"onclick=p3usersGroupActionFunction()> <input id=UserNewAccountButton type=button onclick=showCreateNewAccountDialog() value="새 계정 ..."> <input id=UserSearchInput style=width:120px;margin-left:6px placeholder=필터 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>내 파일</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="상위 항목으로">&nbsp; <input type=button id=p5SelectAllButton disabled onclick=p5selectallfile() value="모두 선택">&nbsp; <input type=button id=p5RenameFileButton disabled value="이름 바꾸기"onclick=p5renamefile()>&nbsp; <input type=button id=p5DeleteFileButton disabled value=삭제 onclick=p5deletefile()>&nbsp; <input type=button id=p5NewFolderButton disabled value="새 폴더"onclick=p5createfolder()>&nbsp; <input type=button id=p5UploadButton disabled value=업로드 onclick=p5uploadFile()>&nbsp; <input type=button id=p5CutButton disabled value=잘라내기 onclick=p5copyFile(1)>&nbsp; <input type=button id=p5CopyButton disabled value=복사 onclick=p5copyFile(0)>&nbsp; <input type=button id=p5PasteButton disabled value=붙여넣기 onclick=p5pasteFile()>&nbsp;</div><tr><td id=p5filesubhead><div style=float:right><select id=p5sortdropdown onchange=updateFiles()><option value=1 selected>이름순으로 정렬<option value=2>크기별로 정렬<option value=3>날짜순으로 정렬<option value=4>이름 내림차순<option value=5>크기 내림차순<option value=6>날짜 내림차순</select></div><div>&nbsp;&nbsp;<span id=p5currentpath></span></div></table><div id=p5filetable><div id=p5PublicShare><div>이 파일은 공개적으로 공유됩니다. 공개 링크를 받으려면 "링크"를 클릭하십시오.</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>내 서버</h1></div><div id=p2ServerActions><p><strong>서버 동작</strong><div class=mL><div id=p2ServerActionsBackup><a href={{{domainurl}}}backup.zip rel="noreferrer noopener"target=_blank>서버 백업 다운로드</a></div><div id=p2ServerActionsRestore><a href=# onclick="return server_showRestoreDlg()">백업으로 서버 복원</a></div><div id=p2ServerActionsVersion><a href=# onclick="return server_showVersionDlg()">서버 버전 확인</a></div><div id=p2ServerActionsErrors><a href=# onclick="return server_showErrorsDlg()">서버 오류 로그 표시</a></div></div></div><br><strong>서버 통계</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>서버 경고</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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>일반 - <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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="전체 화면. 브라우저를 전체 화면으로 전환합니다."><div class=viewSelector5></div></div></div><h1>데스크탑 - <span id=p11deviceName></span></h1></div></div><div id=p11warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT 리디렉션 포트 또는 KVM 기능이 비활성화되었습니다<span id=p11warninga>, 사용하려면 여기를 클릭하십시오.</span></div></div><div id=p11warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>원격 컴퓨터의 전원이 켜져 있지 않으면, 여기를 클릭하여 전원 명령을 실행하십시오.</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="보기 모드 전환"onclick=toggleAspectRatio(1)>⇲</div><div class=deskareaicon title="왼쪽으로 회전"onclick=drotate(-1)>↺</div><div class=deskareaicon title="오른쪽으로 회전"onclick=drotate(1)>↻</div><div id=deskRecordIcon class=deskareaicon title="서버가 이 세션을 녹화하고 있습니다"style=display:none;background-color:red;width:12px;height:12px;border-radius:6px;margin-top:5px></div><input id=deskFocusBtn type=button title="마우스 주변 영역만 활성화되면 포커스 모드 전환"onkeypress=return!1 onkeydown=return!1 value="모든 초점"onclick=deskToggleFocus() style=margin-right:3px;display:none> <input id=deskActionsBtn type=button title="장치에서 전원 작업 수행"onkeypress=return!1 onkeydown=return!1 value=동작 onclick=deviceActionFunction() class=mR> <input id=deskActionsSettings type=button value=설정... title="원격 데스크톱 설정 편집"onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() class=mR> <input type=button title="원격 시스템의 전원 상태 변경"onkeypress=return!1 onkeydown=return!1 value="전원 동작 ..."onclick=showPowerActionDlg() style=display:none></div><div><div id=idx_deskFullBtn2 onclick=deskToggleFull(event)>&nbsp;✖</div><input type=button id=autoconnectbutton1 value="자동 연결"onclick=autoConnectDesktop(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton1span><input type=button id=connectbutton1 cmenu=deskConnectButton value=연결 onclick=connectDesktop(event,3) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton1hspan>&nbsp;<input type=button id=connectbutton1h value="하드웨어 연결"title="Intel AMT 하드웨어 KVM을 사용하여 연결"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton1span>&nbsp;<input type=button id=disconnectbutton1 value="연결 해제"onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1></span>&nbsp;<span id=deskstatus>연결 해제</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()>새로 고침</a><div id=deskToolsTopTabProcess class=deskToolsTopTab onclick=changeDeskToolTab(0) style=left:0;bottom:0>프로세스</div><div id=deskToolsTopTabService class=deskToolsTopTab onclick=changeDeskToolTab(1) style=display:none;left:90px;color:gray>서비스</div></div><div id=deskToolsArea><div id=DeskToolsProcessTab><div id=deskToolsHeader><a class=colmn1 title="프로세스 ID별로 정렬"onclick=sortProcess(0)>PID</a> <a class=colmn2 title="이름순으로 정렬"onclick=sortProcess(1)>이름</a></div><div id=DeskToolsProcesses></div></div><div id=DeskToolsServiceTab style=display:none><div id=deskToolsServiceHeader><a class=colmn1 style=width:70px title="상태별로 정렬"onclick=sortService(0)>상태</a> <a class=colmn2 title="이름순으로 정렬"onclick=sortService(1)>이름</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="데스크톱 세션 지연"></span> <span id=DeskTimer title="세션 시간"></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=도구 title="도구 보기 전환"onkeypress=return!1 onkeydown=return!1 onclick=toggleDeskTools()>&nbsp; <span id=DeskChatButton class=deskarea title="이 컴퓨터에게 채팅창 열기"><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:2px></span><span id=DeskNotifyButton title="원격 컴퓨터에 알림 표시"><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskOpenWebButton title="원격 컴퓨터에서 웹 주소를 엽니다"><img src=images/icon-url2.png onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px></span><span id=DeskBackgroundButton title="원격 데스크톱 배경 전환"><img src=images/icon-background.png onclick=deviceToggleBackground(event) height=16 width=16 style=padding-top:2px></span><span id=DeskSaveImageButton title="원격 데스크톱의 스크린샷 저장"><img src=images/icon-camera.png onclick=deskSaveImage() height=16 width=16 style=padding-top:2px></span><span id=DeskRecordButton cmenu=deskPlayerContextMenu title="원격 데스크톱 세션을 파일에 기록"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>Ctrl+Alt+Del<option value=5>Win<option value=0>Win+아래<option value=1>Win+위<option value=2>Win+L<option value=3>Win+M<option value=4>Shift+Win+M<option value=6>Win+R<option value=7>Alt-F4<option value=8>Ctrl-W<option value=9>Alt-Tab<option value=11>Win+왼쪽<option value=12>Win+오른쪽</select> <input id=DeskWD type=button value=전송 onkeypress=return!1 onkeydown=return!1 onclick=deskSendKeys()> <input id=DeskClip type=button value=클립보드 onkeypress=return!1 onkeydown=return!1 onclick=showDeskClip()> <input id=DeskType type=button value=유형 onkeypress=return!1 onkeydown=return!1 onclick=showDeskType()> <label><span id=DeskControlSpan title="마우스와 키보드 입력 전환"><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1 onclick=toggleKvmControl()>입력</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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons2 style=float:right><div class=viewSelector onclick=deskToggleFull(event) title="전체 화면. 브라우저를 전체 화면으로 전환합니다."><div class=viewSelector5></div></div></div><h1>터미널 - <span id=p12deviceName></span></h1></div><div id=p12warning onclick=showFeaturesDlg()><div class=icon2></div><div class=warningbox>Intel® AMT 리디렉션 포트 또는 KVM 기능이 비활성화되었습니다<span id=p12warninga>, 사용하려면 여기를 클릭하십시오.</span></div></div><div id=p12warning2 onclick=showPowerActionDlg()><div class=icon2></div><div class=warningbox>원격 컴퓨터의 전원이 켜져 있지 않으면, 여기를 클릭하여 전원 명령을 실행하십시오.</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="서버가 이 세션을 녹화하고 있습니다"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="장치에서 전원 작업 수행"onkeypress=return!1 onkeydown=return!1 value=동작 onclick=deviceActionFunction()></div><div><div id=idx_termFullBtn2 onclick=deskToggleFull(event)>&nbsp;✖</div><input type=button id=autoconnectbutton2 value="자동 연결"onclick=autoConnectTerminal(event) onkeypress=return!1 onkeydown=return!1 style=display:none> <span id=connectbutton2span><input type=button id=connectbutton2 cmenu=termConnectButton value=연결 onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2hspan>&nbsp;<input type=button id=connectbutton2h value="하드웨어 연결"title="Intel AMT 하드웨어 KVM을 사용하여 연결"onclick=connectTerminal(event,2) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span>&nbsp;<input type=button id=disconnectbutton2 value="연결 해제"onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span>&nbsp;<span id=termstatus>연결 해제</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="세션 시간"></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="리턴 키가 전송할 것을 전환"onclick=termToggleCr()> <input id=id_tfxkeysbutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="인텔 (F10 = ESC + [OM)"title="F1~F10 키 에뮬레이션 유형 전환"onclick=termToggleFx()> <input id=id_ttypebutton type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton value="확장 ASCII"title="터미널 에뮬레이션 유형 전환"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=전송 title="선택한 특수키를 전송합니다."onclick=sendSpecialKey()></span></div><div>&nbsp; <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlcbutton value=Ctl-C onclick='termSendKey(3,"ctrlcbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=ctrlxbutton value=Ctl-X onclick='termSendKey(24,"ctrlxbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=escbutton value=ESC onclick='termSendKey(27,"escbutton")'> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=bsbutton value=백스페이스 onclick='termSendKey(8,"bsbutton")'style=display:none> <input type=button onkeypress=return!1 onkeydown=return!1 class=bottombutton id=pastebutton value=붙여넣기 title="터미널에 텍스트 붙여 넣기"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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>파일- <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="장치에서 전원 작업 수행"value=동작 onclick=deviceActionFunction()><div id=filesRecordIcon class=deskareaicon title="서버가 이 세션을 녹화하고 있습니다"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="자동 연결"onclick=autoConnectFiles(event) type=button style=display:none> <input id=p13Connect value=연결 onclick=connectFiles(event) type=button> <span id=p13Status>연결 해제</span></div><tr><td class=areaHead2 valign=bottom><div id=p13rightOfButtons class=toright2></div><div><input type=button id=p13FolderUp disabled onclick=p13folderup() value="상위 항목으로">&nbsp; <input type=button id=p13SelectAllButton disabled onclick=p13selectallfile() value="모두 선택">&nbsp; <input type=button id=p13RenameFileButton disabled value="이름 바꾸기"onclick=p13renamefile()>&nbsp; <input type=button id=p13DeleteFileButton disabled value=삭제 onclick=p13deletefile()>&nbsp; <input type=button id=p13ViewFileButton disabled value=편집 onclick=p13viewfile()>&nbsp; <input type=button id=p13NewFolderButton disabled value="새 폴더"onclick=p13createfolder()>&nbsp; <input type=button id=p13UploadButton disabled value=업로드 onclick=p13uploadFile()>&nbsp; <input type=button id=p13CutButton disabled value=잘라내기 onclick=p13copyFile(1)>&nbsp; <input type=button id=p13CopyButton disabled value=복사 onclick=p13copyFile(0)>&nbsp; <input type=button id=p13PasteButton disabled value=붙여넣기 onclick=p13pasteFile()>&nbsp; <input type=button id=p13RefreshButton disabled value="새로 고침"onclick=p13folderup(9999)>&nbsp;</div><tr><td class=areaHead3><div class=toright2><select id=p13sortdropdown onchange=p13updateFiles()><option value=1 selected>이름순으로 정렬<option value=2>크기별로 정렬<option value=3>날짜순으로 정렬<option value=4>이름 내림차순<option value=5>크기 내림차순<option value=6>날짜 내림차순</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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><div id=devListToolbarViewIcons><div class=viewSelector onclick=deskToggleFull(event) title="전체 화면. 브라우저를 전체 화면으로 전환합니다."><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=뒤로 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="이 에이전트에서 실행중인 현재 코어에 대한 정보"></div><input type=button id=p15uploadCore value="에이전트 동작"onclick=p15uploadCore(event) title="에이전트 Java 스크립트 코드 모듈 변경"> <img onclick=p15downloadConsoleText() style=cursor:pointer;margin-top:6px title="콘솔 텍스트 다운로드"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>에이전트<option value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=지우기 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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>이벤트 - <span id=p16deviceName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>보이기 <select id=p16limitdropdown onchange=refreshDeviceEvents()><option value=60>최근 60<option value=120>최근 120<option value=250>최근 250<option value=500>최근 500<option value=1000>최근 1000</select> <a href=# onclick=p3showDownloadEventsDialog(1)><img src=images/link4.png height=10 width=10 title="이벤트 다운로드"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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>세부사항 - <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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>플러그인 - <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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>일반 - <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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>요약 - <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>전원 상태</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>에이전트 유형들</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>연결성</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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>일반 - <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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>이벤트 - <span id=p31userName></span></h1></div><table class=pTable><tr><td class=h1><td class=auto-style1>보이기 <select id=p31limitdropdown onchange=refreshUsersEvents()><option value=60>최근 60<option value=120>최근 120<option value=250>최근 250<option value=500>최근 500<option value=1000>최근 1000</select> <a href=# onclick=p3showDownloadEventsDialog(3)><img src=images/link4.png height=10 width=10 title="이벤트 다운로드"style=cursor:pointer></a>&nbsp;<td class=h2></table><div id=p31events></div></div><div id=p40 style=display:none><div id=p40title><h1>내 서버 통계</h1></div><div class=areaHead><div class=toright2><select id=p40type onchange=updateServerTimelineStats()><option value=0>연결된 것들<option value=1>메모리</select>&nbsp; <select id=p40time onchange=updateServerTimelineHours()><option value=3>최근 3시간<option value=8>최근 8시간<option value=24>최근 날짜<option value=168>지난 주<option value=720>최근 30일</select>&nbsp; <img src=images/link4.png height=10 width=10 title="데이터 포인트 다운로드 (.csv)"style=cursor:pointer onclick=p40downloadEvents()>&nbsp;</div><div><input value="새로 고침"type=button onclick=refreshServerTimelineStats()> &nbsp;<label><input id=p40log type=checkbox onclick=updateServerTimelineHours()>로그 -X</label></div></div><canvas id=serverMainStats></canvas></div><div id=p41 style=display:none><div id=p41title><h1>내 서버 추적</h1></div><div class=areaHead><div class=toright2>보이기 <select id=p41limitdropdown onchange=displayServerTrace()><option value=100>최근 100<option value=250>최근 250<option value=500>최근 500<option value=1000>최근 1000</select> <input value=지우기 type=button onclick=clearServerTracing()> <img src=images/link4.png height=10 width=10 title="추적 다운로드 (.csv)"style=cursor:pointer onclick=p41downloadServerTrace()>&nbsp;</div><div><input value=기록 type=button onclick=setServerTracing()> <span id=p41traceStatus>없음</span></div></div><div id=p41events></div></div><div id=p42 style=display:none><h1>내 서버 플러그인</h1><div class=areaHead><div class=toright2></div><div><input value="플러그인 다운로드"type=button onclick="return pluginHandler.addPluginDlg()"></div></div><div id=pluginRestartNotice class=areaHead style=background-color:gold;display:none><div class=toright2><input value="에이전트 코어 새로 고침"type=button onclick="return distributeCore(),!1"></div><div style=padding:2px><div style=padding:2px><b>주의:</b> 플러그인이 변경되었습니다. 에이전트 코어 업데이트가 필요할 수 있습니다.</div></div></div><table id=p42tbl><tr class=DevSt><th style=width:26px><th style=width:10px><th class=chName>이름<th class=chDescription>설명<th class=chSite style=text-align:center>링크<th class=chVersion style=text-align:center>버전<th class=chUpgradeAvail style=text-align:center>가장 최근<th class=chStatus style=text-align:center>상태<th class=chAction style=text-align:center>동작<th style=width:10px></table><div id=pluginNoneNotice style=width:100%;text-align:center;padding-top:10px;display:none><i>서버에 플러그인이 없습니다.</i></div></div><div id=p43 style=display:none><div id=p43BackButton><div class=backButton tabindex=0 onclick=go(42) title=뒤로 onkeypress='"Enter"==event.key&&go(42)'><div class=backButtonEx></div></div></div><h1>내 서버 플러그인 - <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>내 사용자 그룹</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="모두 선택"> <input type=button id=UsersGroupsGroupActionButton disabled value="그룹 동작"onclick=p50usersGroupActionFunction()> <input id=NewUserGroupButton type=button onclick=showCreateUserGroupDialog(1) value="새 그룹 ..."> <input id=DuplicateUserGroupButton type=button style=display:none onclick=showCreateUserGroupDialog(2) value="그룹 복제..."></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=뒤로 onkeypress='"Enter"==event.key&&goBack()'><div class=backButtonEx></div></div></div><h1>사용자 그룹 - <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="플레이어 열기 ..."></div><div><input type=button onclick=refreshRecodings() value="새로 고침"></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()>이메일 검증</a> &nbsp;<a id=termsLinkFooter href=terms>약관과 개인정보</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>파일 선택</div><select id=d3uploadMode onchange=d3modechange()><option value=1>로컬 파일 업로드<option value=2>서버 파일 선택</select></div><div id=d3localmode style=display:none><div>파일 업로드</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="상위 항목으로">&nbsp;</div><div id=d3serverfiles></div></div></div><div id=dialog4><input id=d4WrapButton type=button value="Wrap On"onclick=d4ToggleWrap()> <input id=d4SizeButton type=button value=작은 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>에이전트 원격 데스크톱</h4><div><div>품질</div><select id=d7bitmapquality dir=rtl></select></div><div><div>비율</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>프레임 속도</div><select id=d7framelimiter dir=rtl><option selected value=50>빠른<option value=100>중간<option value=400>느린<option value=1000>아주 느린</select></div></div><div id=d7amtkvm><h4>Intel® AMT 하드웨어 KVM</h4><div><div>이미지 인코딩</div><select id=d7desktopmode><option value=1>RLE8, 가장 빠름<option value=2>RLE16, 권장<option value=3>RAW8, 느림<option value=4>RAW16, 매우 느림</select></div><div><div>다른 설정</div><div id=d7otherset style=display:block><label style=display:block><input type=checkbox id=d7showfocus>초점 도구 표시</label> <label style=display:block><input type=checkbox id=d7showcursor>로컬 마우스 커서 표시</label> <label style=display:block><input type=checkbox id=d7localKeyMap>로컬 키보드 맵</label></div></div></div></div></div><div id=idx_dlgButtonBar><input id=idx_dlgCancelButton type=button value=취소 onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=확인 onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=삭제 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=["","전원이 켜짐","절전","절전","절전","최대 절전 모드","전원 끄기","현재"],StatusStrs=["연결 해제","연결 중 ...","설치...","연결됨","Intel&reg; AMT 연결"],agentsStr=["알 수 없는","Windows 32비트 콘솔","Windows 64비트 콘솔","Windows 32비트 서비스","Windows 64비트 서비스","Linux 32bit","Linux 64bit","MIPS","XENx86","Android ARM","Linux ARM","MacOS 32비트","Android x86","PogoPlug ARM","Android APK","Linux Poky x86-32비트","MacOS 64비트","ChromeOS","Linux Poky x86-64비트","Linux NoKVM x86-32비트","Linux NoKVM x86-64비트","Windows MinCore 콘솔","Windows MinCore 서비스","NodeJS","ARM-Linaro","ARMv6l / ARMv7l","ARMv8 64비트","ARMv6l / ARMv7l / NoKVM","알 수 없는","알 수 없는","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!=(s=getstore("loctag",0))&&"*"!=s&&(args.locale=s);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 o="";logoutControls&&null!=logoutControls.name&&(o=format("{0}님, 환영합니다.",logoutControls.name)),null!=logoutControls.logoutUrl&&(o+=format(' <a href="'+logoutControls.logoutUrl+'" style="color:white">로그아웃</a>')),1&args.hide?QH("logoutControlSpan2",o):QH("logoutControlSpan",o),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 i=1;i<5;i++)Q("devViewButton"+i).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 a=null;try{a=localStorage.getItem("desktopsettings")}catch(e){}null!=a&&(desktopsettings=JSON.parse(a)),a=null;try{a=localStorage.getItem("multidesktopsettings")}catch(e){}null!=a&&(multidesktopsettings=JSON.parse(a)),applyDesktopSettings();for(var s="",r=1;r<27;r++)s+="<option value='"+r+"'>Ctrl-"+String.fromCharCode(64+r)+" ("+r+")</option>";QH("specialkeylist",s),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){s="";for(var d in customui.devicesbarbuttons){var c="one"==customui.devicesbarbuttons[d].selection||"many"==customui.devicesbarbuttons[d].selection?"disabled":"";s+='<input id="cui:'+d+'" type="button" value="'+customui.devicesbarbuttons[d].name+'" '+c+' onclick=customUIAction(event,"devicesbarbuttons") />'}QH("devCustomUIBar",s)}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 o=customui[t][n.substring(4)];if(null!=o&&"devicesbarbuttons"==t){for(var i=document.getElementsByClassName("DeviceCheckbox"),a=[],s=0;s<i.length;s++)!0===i[s].checked&&a.push(i[s].defaultValue.substring(6));"string"==typeof o.action&&("event"==o.action&&meshserver.send({action:"uicustomevent",section:t,element:n.substring(4),selectedDevices:a}),o.action.startsWith("dialog:")&&showCustomUiDialog(o.action.substring(7),{section:t,element:n.substring(4),selectedDevices:a}))}}}function showCustomUiDialog(e,t){if(null!=customui&&null!=customui.dialogs&&"object"==typeof customui.dialogs[e]){var n="",o=customui.dialogs[e],i=3;if("string"==typeof o.text&&(n+="<div style=margin-bottom:8px>"+o.text+"</div>"),"number"==typeof o.buttons&&(i=o.buttons),"object"==typeof o.elements)for(var a in o.elements){var s=o.elements[a];if("text"==s.type&&(n+=addHtmlValue(s.name,"<input id=cui:"+a+" style=width:230px autocomplete=off />")),"droplist"==s.type){var r="";for(var l in s.options)r+='<option value="'+l+'">'+EscapeHtml(s.options[l])+"</option>";n+=addHtmlValue(s.name,'<select id="cui:'+a+'" style=width:230px autocomplete=off />'+r+"</select>")}}setDialogMode(2,o.title,i,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 o in n.elements){var i=n.elements[o];"text"==i.type&&(t.values[o]=Q("cui:"+o).value),"droplist"==i.type&&(t.values[o]=Q("cui:"+o).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 o=!(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,o&&(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)",o&&(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,o){if(0==t){if(setDialogMode(0),go(0),powerTimelineUpdate=powerTimelineNode=powerTimelineReq=powerTimeline=null,deleteAllNotifications(),hideContextMenu(),QV("verifyEmailId2",!1),QV("logoutControl",!1),"noauth"==o)return void QH("p0span","인증을 수행할 수 없습니다.");2==n?autoReconnect&&setTimeout(serverPoll,5e3):QH("p0span","웹 소켓을 연결할 수 없습니다"),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:"2단계 인증 백업 코드를 추가하십시오. 이 내용이 손실되면, 계정을 복구 할 수 없습니다.",title:"이중 인증"}),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"," - 다음에 로그인할 때 초기화하십시오.");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"," - 다음에 로그인할 때 초기화하십시오.");else if(n<3600){var o=Math.floor(n/60);QH("p2nextPasswordUpdateTime",format(1==o?" - 1분 후에 재설정하십시오.":" - {0}분 후에 재설정하십시오.",o))}else if(n<86400){var i=Math.floor(n/3600);QH("p2nextPasswordUpdateTime",format(1==i?" - 1시간 후에 재설정합니다.":" - {0}시간 후에 재설정하십시오.",i))}else{var a=Math.floor(n/86400);QH("p2nextPasswordUpdateTime",format(1==i?" - 1일 후에 재설정합니다.":" - {0}일 후에 재설정하십시오.",a))}}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초 남음":"연결이 끊어질 때까지 {0}초",t)):(t=Math.round(t/60))<=5&&QH("idleTimeoutNotify","<br />"+format(1==t?"접속해제까지 1분 남음":"연결이 끊어질 때까지 {0}분 남음",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","없음")));break;case"serverstats":updateGeneralServerStats(t);break;case"serverwarnings":if(null!=t.warnings&&0<t.warnings.length){var n="";for(var o in t.warnings)n+="<div style=color:red;padding-bottom:6px><b>경고:"+t.warnings[o]+"</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 i in users={},t.users)users[t.users[i]._id]=t.users[i];null!=currentUser&&(currentUser=users[currentUser._id]),masterUpdate(16384),updateSelf();break;case"wssessioncount":wssessions=t.wssessions,masterUpdate(16384);break;case"meshes":for(var i in meshes={},t.meshes)meshes[t.meshes[i]._id]=t.meshes[i];null!=currentMesh&&(currentMesh=meshes[currentMesh._id]),masterUpdate(132);break;case"usergroups":var a=0;if(Array.isArray(t.ugroups)){for(var o in usergroups={},t.ugroups)a++,usergroups[t.ugroups[o]._id]=t.ugroups[o];0==a&&(usergroups=null)}else{for(var o in usergroups=t.ugroups,t.ugroups)a++,t.ugroups[o]._id=o;0==a&&(usergroups=null)}masterUpdate(8192);break;case"files":filetree=setupBackPointers(t.filetree),updateFiles(),d3updatefiles();break;case"nodes":for(var i in nodes=[],t.nodes)for(var s in t.nodes[i])null!=t.nodes[i][s]._id?(t.nodes[i][s].namel=t.nodes[i][s].name.toLowerCase(),t.nodes[i][s].rname?t.nodes[i][s].rnamel=t.nodes[i][s].rname.toLowerCase():t.nodes[i][s].rnamel=t.nodes[i][s].namel,t.nodes[i][s].meshnamel=meshes[i]?meshes[i].name.toLowerCase():"*",t.nodes[i][s].meshid=i,t.nodes[i][s].state=t.nodes[i][s].state?t.nodes[i][s].state:0,t.nodes[i][s].icon||(t.nodes[i][s].icon=1),t.nodes[i][s].ident=++nodeShortIdent,nodes.push(t.nodes[i][s])):console.log("Invalid node ("+s+"): "+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 o in powerTimelineNode=t.nodeid,powerTimeline=t.timeline,powerTimelineUpdate=Date.now()+3e5,powerTimeline)o%2==1&&(powerTimeline[o]=1e3*powerTimeline[o]);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!=(B=getNodeFromId(t.nodeid))&&(B.lastconnect=t.time,B.lastaddr=t.addr,currentNode._id==B._id&&""==Q("MainComputerState").innerHTML&&QH("MainComputerState","<span>마지막으로 본 :<br />"+printDateTime(new Date(B.lastconnect))+"</span>"));break;case"msg":if(null!=t.nodeid){var r=-1;if(null!=nodes)for(var o in nodes)if(nodes[o]._id==t.nodeid){r=o;break}if(-1!=r)if("console"==t.type)p15consoleReceive(nodes[r],t.value,t.source);else if("notify"==t.type){if(0==(8&(s=getstore("notifications",0)))&&null!=t.amtMessage)break;s={text:t.value,title:t.title,icon:t.icon};null!=t.id&&(s.id=t.id),null!=t.nodeid&&(s.nodeid=t.nodeid),null!=t.tag&&(s.tag=t.tag),null!=t.username&&(s.username=t.username),addNotification(s)}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>성공</span>":"<span style=color:red>실패</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 o in t.data)"Active"!=t.data[o].State&&"Console"!=t.data[o].StationName&&3!=debugmode||l.push(t.data[o]);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 o 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[o].SessionId+","+t.tag+")>"+l[o].State+", "+l[o].StationName,l[o].Username&&(l[o].Domain?n+=" - "+l[o].Domain+"/"+l[o].Username:n+=" - "+l[o].Username),n+="</div>";QH("p11DeskSessionSelector",n),QV("p11DeskSessionSelector",!0)}}}else if("notify"==t.type){s={text:t.value,title:t.title,icon:t.icon};null!=t.id&&(s.id=t.id),null!=t.tag&&(s.tag=t.tag),null!=t.username&&(s.username=t.username),addNotification(s)}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","이 장치에 사용 가능한 네트워크 인터페이스 정보가 없습니다.");else{n="<div class=dialogText>";if(currentNode.lastconnect&&(n+=addHtmlValue2("마지막 에이전트 연결",printDateTime(new Date(currentNode.lastconnect)))),currentNode.lastaddr){var d=currentNode.lastaddr.split(":");2<d.length?n+=addHtmlValue2("마지막 에이전트 주소",currentNode.lastaddr+' <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(currentNode.lastaddr)+'") width=10 height=10>'):isPrivateIP(currentNode.lastaddr)?n+=addHtmlValue2("마지막 에이전트 주소",d[0]+' <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(d[0])+'") width=10 height=10>'):n+=addHtmlValue2("마지막 에이전트 주소",'<a href="https://iplocation.com/?ip='+d[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+d[0]+'</a> <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(d[0])+'") width=10 height=10>')}for(var o in n+=addHtmlValue2("최근 인터페이스 업데이트",printDateTime(new Date(t.updateTime))),t.netif){var c=t.netif[o];n+="<hr />",c.name&&(n+=addHtmlValue2("이름","<b>"+EscapeHtml(c.name)+"</b>")),c.desc&&(n+=addHtmlValue2("설명",EscapeHtml(c.desc).replace("(R)","&reg;").replace("(r)","&reg;"))),c.dnssuffix&&(n+=addHtmlValue2("DNS 접미사",EscapeHtml(c.dnssuffix)+' <img src="images/link4.png" title="이름을 클립보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.dnssuffix)+'") width=10 height=10>')),c.mac&&(n+=addHtmlValue2("MAC 주소",'<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 주소를 클립보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.mac.toLowerCase())+'") width=10 height=10>')),c.v4addr&&(n+=addHtmlValue2("IPv4 주소",EscapeHtml(c.v4addr)+' <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4addr)+'") width=10 height=10>')),c.v4mask&&(n+=addHtmlValue2("IPv4 마스크",EscapeHtml(c.v4mask)+' <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4mask)+'") width=10 height=10>')),c.v4gateway&&(n+=addHtmlValue2("IPv4 게이트웨이",EscapeHtml(c.v4gateway)+' <img src="images/link4.png" title="주소를 클립 보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(c.v4gateway)+'") width=10 height=10>')),c.gatewaymac&&(n+=addHtmlValue2("게이트웨이 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 주소를 클립보드에 복사" 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="알 수 없는"),t.tags.stable||(t.tags.stable="알 수 없는"),t.tags.latest||(t.tags.latest="알 수 없는"),n+=addHtmlValue2("현재 버전","<b>"+EscapeHtml(t.tags.current)+"</b>"),n+="<hr />",n+=addHtmlValue2("<label><input id=d2updateCheck1 type=checkbox onclick=server_showVersionDlgUpdate()"+("알 수 없는"==t.tags.stable||t.tags.current==t.tags.stable?" disabled":"")+" /> 안정화된 버전</label>","<b>"+EscapeHtml(t.tags.stable)+"</b>"),n+=addHtmlValue2("<label><input id=d2updateCheck2 type=checkbox onclick=server_showVersionDlgUpdate()"+("알 수 없는"==t.tags.latest||t.tags.current==t.tags.latest?" disabled":"")+" /> 최신 버전</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 버전",1,null,n):(setDialogMode(2,"MeshCentral 버전",3,server_showVersionDlgEx,n+="<hr />확인하시고, OK를 클릭하여 서버 셀프-업데이트를 시작하십시오.",t.tags),server_showVersionDlgUpdate())}break;case"servererrors":if(2==xxdialogMode&&"MeshCentralServerErrors"==xxdialogTag)if(null==t.data)setDialogMode(2,"MeshCentral 서버 오류",1,null,"서버에 오류 로그가 없습니다.");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="오류 로그 다운로드" style=cursor:pointer onclick=d2CopyServerErrorsToClip()></div>',setDialogMode(2,"MeshCentral 서버 오류",3,server_showErrorsDlgEx,n+="<div><label><input id=d2clearErrorsCheck type=checkbox onclick=server_showErrorsDlgUpdate() /> 확인하시고, OK를 클릭하여 오류 로그를 지우십시오.</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!=(B=getNodeFromId(t.nodeid))&&(m+="&name="+encodeURIComponentEx(B.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!=(B=getNodeFromId(t.nodeid))&&(u+="&name="+encodeURIComponentEx(B.name)),window.open(u,"mcmstsc/"+t.nodeid).opener=null}break;case"getNotes":if((s=Q("d2devNotes"))&&t.id==decodeURIComponent(s.attributes.noteid.value))t.notes?QH("d2devNotes",decodeURIComponent(t.notes)):QH("d2devNotes",""),0==("true"==s.attributes.ro.value)&&(s.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('<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" rel="noreferrer noopener" target=_blank>Google Authenticator 설치</a> 또는 호환되는 응용 프로그램에서 바코드를 스캔하려면 <a href="{0}" rel="noreferrer noopener" target=_blank>이 링크</a>를 사용하거나 암호화 코드를 입력하십시오. 그런 다음 아래에 현재 6자리 토큰을 입력하여 2단계 로그인을 활성화하십시오.',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 />여기에 2단계 로그인을 위한 토큰을 입력하십시오 : <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,"2단계 인증 앱",1,null,t.success?"<b style=color:green>2단계 인증 앱 활성화에 성공했습니다.</b> 이제 다시 로그인하려면 유효한 토큰이 필요합니다.":"<b style=color:red>2단계 로그인 활성화에 실패했습니다.</b> 응용 프로그램에서 암호(the secret)을 지우고 다시 시도하십시오. 올바른 코드를 입력하기 위해서는 몇 분 밖에 걸리지 않습니다.");break;case"otpauth-clear":if(xxdialogMode)return;setDialogMode(2,"2단계 인증 앱",1,null,t.success?"<b>2단계 인증 프로그램이 제거되었습니다.</b> 언제든지 이 기능을 다시 활성화 할 수 있습니다.":"<b style=color:red>2단계 로그인 활성화 제거에 실패했습니다.</b> 다시 시도하십시오.");break;case"otpauth-getpasswords":if(xxdialogMode)return;n="일회성 토큰을 보조 인증으로 사용할 수 있습니다. 토큰들을 생성하고 인쇄하여 안전한 장소에 보관하십시오.";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 o in t.passwords){++h%2&&(n+="<tr>");for(var f=""+t.passwords[o].p;f.length<8;)f="0"+f;!0===t.passwords[o].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>활성화된 토큰이 없습니다";n+="</table></div></div><br />",n+="<div><input type=button value=닫기 onclick=setDialogMode(0) style=float:right></input>",n+='<input type=button value="새로운 토큰 생성" onclick="account_manageOtp(1);"></input>',null!=t.passwords&&(n+='<input type=button value="토큰 지우기" onclick="account_manageOtp(2);"></input>',n+='&nbsp;<img src=images/link4.png height=10 width=10 title="유효한 코드를 클립보드에 복사" style=cursor:pointer onclick=copyTextToClip2("'+encodeURIComponentEx(v)+'")>'),setDialogMode(2,"백업 코드 관리",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>',x="</table></div></div>";n='<a href="https://www.yubico.com/" rel="noreferrer noopener" target="_blank">하드웨어 전자열쇠</a>는 보조 로그인 인증으로 사용됩니다.';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 o in t.keys){var y=t.keys[o];n+=k+'<tr style=margin:5px><td style=width:30px><img width=24 height=18 src="images/hardware-key-'+(2==y.type?"OTP":"WebAuthn")+'-24.png" style=margin-top:4px><td style=width:250px>'+y.name+'<td><input type=button value="제거" onclick=account_removehkey('+y.i+")></input>"+x}else n+=k+"<tr style=text-align:center><td>구성된 키가 없습니다."+x;n+="</div>",n+='<div><input type=button value="닫기" onclick=setDialogMode(0) style=float:right></input>',0!=(131072&features)&&(n+='<input id=d2addkey3 type=button value="키 추가" onclick="account_addhkey(3);"></input>'),0!=(16384&features)&&(n+='<input id=d2addkey2 type=button value="YubiKey&reg; OTP 추가" onclick="account_addhkey(2);"></input>'),setDialogMode(2,"보안 키 관리",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,"보안 키 추가",1,null,"<br />오류, 키를 추가 할 수 없습니다.<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,"보안 키 추가",1,null,"<br />오류 : 키를 추가 할 수 없습니다.<br /><br />","otpauth-hardware-manage");break;case"webauthn-startregister":if(xxdialogMode&&"otpauth-hardware-manage"!=xxdialogTag)return;setDialogMode(2,"보안 키 추가",2,null,n='지금 키 버튼을 누르십시오.<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 b=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:b}).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,"보안 키 추가",1,null,"오류:"+e)})},100);break;case"verifyPhone":if(xxdialogMode&&"verifyPhone"!=xxdialogTag)return;n='<table><tr><td><img src="images/phone80.png" style=padding:8px>';n+="<td>휴대 전화를 확인하고 인증 코드를 입력하십시오.",setDialogMode(2,"휴대폰 알림",3,account_managePhoneConfirm,n+='<br /><br /><div style=width:100%;text-align:center>검증 코드: <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 C=localStorage.getItem("showRealNames"),D=localStorage.getItem("uiMode"),M=localStorage.getItem("sort"),S=localStorage.getItem("loctag"),E=localStorage.getItem("nightMode"),T=localStorage.getItem("footerBar"),A=JSON.parse(t.event.state);for(var o in A)localStorage.setItem(o,A[o]);null!=A.deskAspectRatio&&A.deskAspectRatio!=deskAspectRatio&&(deskAspectRatio=A.deskAspectRatio,deskAdjust()),null!=A.showRealNames&&A.showRealNames!=C&&(showRealNames=Q("RealNameCheckBox").checked="1"==A.showRealNames,masterUpdate(6)),null!=A.uiMode&&A.uiMode!=D&&userInterfaceSelectMenu(parseInt(A.uiMode)),null!=A.sort&&A.sort!=M&&(document.getElementById("sortselect").selectedIndex=sort=parseInt(A.sort),masterUpdate(6)),null!=A.loctag&&A.loctag!=S&&(null!=A.loctag?args.locale=A.loctag:delete args.locale,masterUpdate(4294967295)),null!=A.nightMode&&A.nightMode!=E&&((nightMode="1"==A.nightMode)?(QC("body").add("night"),QS("body")["background-color"]="#000"):(QC("body").remove("night"),QS("body")["background-color"]="#d3d9d6")),null!=A.footerBar&&A.footerBar!=T&&(footerBar="1"==A.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 _=t.event.account.siteadmin?t.event.account.siteadmin:0,N=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 I=userinfo.groups;if(userinfo=t.event.account,N!=_&&updateSiteAdmin(),updateSelf(),0!=(2&userinfo.siteadmin)){var U=I||[],V=userinfo.groups?userinfo.groups:[];U.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 H=usergroups[t.event.ugrpid];null==H?usergroups[t.event.ugrpid]={_id:t.event.ugrpid,name:t.event.name,desc:t.event.desc,domain:t.event.domain,links:t.event.links}:(H.name=t.event.name,t.event.desc?H.desc=t.event.desc:delete H.desc,t.event.links?H.links=t.event.links:delete H.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 o 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 F=!1;for(var o in null!=t.event.links[userinfo._id]&&(F=!0),null!=userinfo.links[t.event.meshid]&&(F=!0),userinfo.links)o.startsWith("ugrp/")&&null!=t.event.links[o]&&(F=!0);F&&(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 o in meshes[t.event.meshid].name=t.event.name,nodes)nodes[o].meshid==t.event.meshid&&(nodes[o].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 P=[];for(var o in nodes)(nodes[o].meshid!=t.event.meshid||null!=userinfo.links&&null!=userinfo.links[nodes[o]._id])&&P.push(nodes[o]);nodes=P,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"}));P=[];if(null!=nodes)for(var o in nodes)nodes[o].meshid!=t.event.meshid&&P.push(nodes[o]);nodes=P,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 B=t.event.node;if(!meshes[B.meshid])break;if(null!=getNodeFromId(B._id))break;B.namel=B.name.toLowerCase(),B.rname?B.rnamel=B.rname.toLowerCase():B.rnamel=B.namel,B.meshnamel=meshes[B.meshid]?meshes[B.meshid].name.toLowerCase():"*",B.state=0,B.icon||(B.icon=1),B.ident=++nodeShortIdent,nodes.push(B),masterUpdate(23);break;case"removenode":r=-1;for(var o in nodes)if(nodes[o]._id==t.event.nodeid){r=o;break}if(-1!=r){B=nodes[r];currentNode==B&&(10<=xxcurrentView&&xxcurrentView<20&&(setDialogMode(0),go(1)),currentNode=null),nodes.splice(r,1),masterUpdate(20)}break;case"changenode":r=-1;for(var o in nodes)if(nodes[o]._id==t.event.nodeid){r=o;break}if(-1!=r)(B=nodes[r]).name=t.event.node.name,B.rname=t.event.node.rname,B.users=t.event.node.users,B.host=t.event.node.host,B.desc=t.event.node.desc,B.ip=t.event.node.ip,B.osdesc=t.event.node.osdesc,B.publicip=t.event.node.publicip,B.iploc=t.event.node.iploc,B.wifiloc=t.event.node.wifiloc,B.gpsloc=t.event.node.gpsloc,B.tags=t.event.node.tags,B.userloc=t.event.node.userloc,B.rdpport=t.event.node.rdpport,B.rfbport=t.event.node.rfbport,B.consent=t.event.node.consent,null!=t.event.node.links?B.links=t.event.node.links:delete B.links,null!=t.event.node.agent&&(null==B.agent&&(B.agent={}),null!=t.event.node.agent.ver&&(B.agent.ver=t.event.node.agent.ver),null!=t.event.node.agent.id&&(B.agent.id=t.event.node.agent.id),null!=t.event.node.agent.caps&&(B.agent.caps=t.event.node.agent.caps),null!=t.event.node.agent.core?B.agent.core=t.event.node.agent.core:B.agent.core&&delete B.agent.core,B.agent.tag=t.event.node.agent.tag),null!=t.event.node.intelamt&&(null==B.intelamt&&(B.intelamt={}),null!=t.event.node.intelamt.state&&(B.intelamt.state=t.event.node.intelamt.state),null!=t.event.node.intelamt.host&&(B.intelamt.user=t.event.node.intelamt.host),null!=t.event.node.intelamt.user&&(B.intelamt.user=t.event.node.intelamt.user),null!=t.event.node.intelamt.tls&&(B.intelamt.tls=t.event.node.intelamt.tls),null!=t.event.node.intelamt.ver&&(B.intelamt.ver=t.event.node.intelamt.ver),null!=t.event.node.intelamt.tag&&(B.intelamt.tag=t.event.node.intelamt.tag),null!=t.event.node.intelamt.uuid&&(B.intelamt.uuid=t.event.node.intelamt.uuid),null!=t.event.node.intelamt.realm&&(B.intelamt.realm=t.event.node.intelamt.realm)),null!=t.event.node.av&&(B.av=t.event.node.av),B.namel=B.name.toLowerCase(),B.rname?B.rnamel=B.rname.toLowerCase():B.rnamel=B.namel,t.event.node.icon&&(B.icon=t.event.node.icon),masterUpdate(30),refreshDevice(B._id),currentNode==B&&null!=xxdialogMode&&"@xxmap"==xxdialogTag&&p10showNodeLocationDialog();break;case"nodemeshchange":r=-1;for(var o in nodes)if(nodes[o]._id==t.event.nodeid){r=o;break}if(-1!=r){B=nodes[r];null!=meshes[t.event.newMeshId]||null!=userinfo.links&&null!=userinfo.links[B._id]?(B.meshid=t.event.newMeshId,B.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(r,1),masterUpdate(20)),refreshDevice(t.event.nodeid)}else{B=t.event.node;if(!meshes[B.meshid])break;B.namel=B.name.toLowerCase(),B.rname?B.rnamel=B.rname.toLowerCase():B.rnamel=B.namel,B.meshnamel=meshes[B.meshid]?meshes[B.meshid].name.toLowerCase():"*",B.state=0,B.icon||(B.icon=1),B.ident=++nodeShortIdent,nodes.push(B),masterUpdate(23)}break;case"nodeconnect":r=-1;for(var o in nodes)if(nodes[o]._id==t.event.nodeid){r=o;break}if(-1!=r){B=nodes[r],s=getstore("notifications",0);t.event.meshid&&userinfo.links&&userinfo.links[t.event.meshid]&&userinfo.links[t.event.meshid].notify?s&=userinfo.links[t.event.meshid].notify:s=0,2&s&&(0==(1&B.conn)&&0!=(1&t.event.conn)&&addNotification({text:"에이전트가 연결되었습니다.",title:B.name,icon:B.icon,nodeid:B._id}),0==(2&B.conn)&&0!=(2&t.event.conn)&&addNotification({text:"인텔 AMT 감지",title:B.name,icon:B.icon,nodeid:B._id}),0==(4&B.conn)&&0!=(4&t.event.conn)&&addNotification({text:"Intel AMT CIRA 연결",title:B.name,icon:B.icon,nodeid:B._id}),0==(16&B.conn)&&0!=(16&t.event.conn)&&addNotification({text:"MQTT 연결",title:B.name,icon:B.icon,nodeid:B._id})),4&s&&(0!=(1&B.conn)&&0==(1&t.event.conn)&&addNotification({text:"에이전트 연결이 끊어졌습니다.",title:B.name,icon:B.icon,nodeid:B._id}),0!=(2&B.conn)&&0==(2&t.event.conn)&&addNotification({text:"인텔 AMT가 감지되지 않습니다.",title:B.name,icon:B.icon,nodeid:B._id}),0!=(4&B.conn)&&0==(4&t.event.conn)&&addNotification({text:"Intel AMT CIRA 연결이 끊어졌습니다",title:B.name,icon:B.icon,nodeid:B._id}),0!=(16&B.conn)&&0==(16&t.event.conn)&&addNotification({text:"MQTT 연결이 끊어졌습니다",title:B.name,icon:B.icon,nodeid:B._id})),B.conn=t.event.conn,B.pwr=t.event.pwr,B.lastconnect=Date.now(),0==(1&B.conn)&&delete B.sessions,masterUpdate(21),refreshDevice(B._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>이 주소 범위를 검색할 수 없습니다.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>샘플 IP 범위 값<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>";else{for(var o in amtScanResults=t.event.results,t.event.results){var L=t.event.results[o],O=L.hostname;"host"==L.hosttype&&(O=capitalizeFirstLetter(O.split(".")[0])),20<O.length&&(O=O.substring(0,20)+"...");var G='<b title="'+EscapeHtml(L.hostname)+'">'+EscapeHtml(O)+"</b> - v"+L.ver;2==L.state?1==L.tls?G+=" TLS 사용.":G+=" TLS 사용 안함.":G+=" 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(o)+'" 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>'+G+"</div></div></div>"}""==n&&(n="<div style=width:100%;text-align:center;margin-top:12px>검색 결과가 없습니다.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>샘플 IP 범위 값<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":s={text:t.event.value,title:t.event.title,icon:t.event.icon};null!=t.id&&(s.id=t.id),null!=t.event.tag&&(s.tag=t.event.tag),addNotification(s);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","없음")));break;case"sysinfohash":null!=currentNode&&t.event.nodeid==powerTimelineReq&&meshserver.send({action:"getsysinfo",nodeid:t.event.nodeid});break;case"devicesessions":if(null==(B=getNodeFromId(t.event.nodeid)))break;if(B.sessions=t.event.sessions,null!=B.sessions){for(var o in B.sessions)0==Object.keys(B.sessions[o]).length&&delete B.sessions[o];0==Object.keys(B.sessions).length&&delete B.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("플러그인 핸들러가 이벤트 메시지를 작성할 수 없습니다.",e)}}break;case"createInviteLink":if(xxdialogTag!=t.meshid)break;var z=serverinfo.name;-1!=z.indexOf(".")&&0==(2&features)||(z=window.location.hostname);var W;domainUrl.substring(0,domainUrl.length-1);if(1==serverinfo.https)W="https://"+z+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"agentinvite?c="+t.cookie+(urlargs.key?"&key="+urlargs.key:"");else W="http://"+z+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl+"agentinvite?c="+t.cookie+(urlargs.key?"&key="+urlargs.key:"");Q("agentInvitationLink").href=W;var K=format(1==t.expire?"1시간":"{0} 시간",t.expire);24==t.expire&&(K="1일"),168==t.expire&&(K="1주"),5040==t.expire&&(K="1개월"),0==t.expire&&(K="제한없는"),QH("agentInvitationLink",format("초대 링크 ({0})",K)),QV("agentInvitationLinkDiv",!0);break;case"getmqttlogin":if(null==currentNode||currentNode._id!=t.nodeid||null!=xxdialogMode)return;n="이 설정은 이 장치의 MQTT를 연결하는 데 사용할 수 있습니다.<br /><br />";delete t.action,delete t.nodeid,setDialogMode(2,"MQTT 자격 증명",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,"플러그인 액션",3,pluginActionEx,format("Select the version to downgrade the plugin: {0}",t.info.name)+"<hr />"+j+"<hr />다운그레이드는 권장되지 않습니다. 최근 업그레이드로 인해 문제가 발생한 경우에만 수행하십시오.NaN"+t.info.id+'" />');break;case"pluginError":setDialogMode(2,"플러그인 오류",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 o=Q("UserSearchInput").value;Q("UserSearchInput").value=o.substring(0,o.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){o=Q("SearchInput").value;Q("KvmSearchInput").value=Q("SearchInput").value=o.substring(0,o.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),o=1}if(27===e.keyCode&&(Q("UserSearchInput").value="",o=1),0<o)return 1==o&&masterUpdate(5),haltEvent(e)}if(!xxdialogMode&&1==xxcurrentView&&1!=e.ctrlKey&&1!=e.altKey&&1!=e.metaKey){var o=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),o=1}if(27===e.keyCode&&(Q("KvmSearchInput").value=Q("SearchInput").value="",o=1),0<o)return 1==o&&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),o=1}27===e.keyCode&&(Q("mapSearchLocation").value="",mapCloseSearchWindow(),o=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)(o=e.children[1].children[1]).children[0].classList.remove("g1s"),o.children[1].classList.remove("e2s"),o.children[2].classList.remove("g2s"),1==t&&(o.children[0].classList.add("g1s"),o.children[1].classList.add("e2s"),o.children[2].classList.add("g2s"));else if(2==n){var o;(o=e).children[2].classList.remove("g1s"),o.children[4].classList.remove("e2s"),o.children[3].classList.remove("g2s"),1==t&&(o.children[2].classList.add("g1s"),o.children[4].classList.add("e2s"),o.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,o={},i=Q("viewselect").value,a={},s={};if(QV("xdevices",i<4),QV("xdevicesmap",4==i),QV("devListToolbar",i<3),QV("kvmListToolbar",3==i),QV("devMapToolbar",4==i),QV("devListToolbarSize",3==i),QV("NoMeshesPanel",0==nodes.length&&0==meshcount),QV("devListToolbarViewIcons",0<nodes.length),QV("devListToolbarSort",0<nodes.length&&i<4),0==nodes.length&&(i=1,sort=0),4==i)setTimeout(function(){null!=xxmap.map&&xxmap.map.updateSize()},200);else{deviceHeaderCount={},deviceHeaders={},deviceHeadersTitles={};var r=[];(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==i?multiDesktopFilter=l:3==oldviewmode&&i<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!=(W=nodes[c]).v){var m=meshes[W.meshid],g=GetNodeRights(W);if(0==sort){if((meshes[W.meshid]?W.meshid:"*")!=n){1!=i&&3!=i||null==n||(e+="</div>"),deviceHeaderSet();var h="";if(2==i&&(e+="<tr><td colspan=5>"),meshes[W.meshid]&&1==meshes[W.meshid].mtype&&(h="<span class=devHeaderx>, Intel&reg; AMT 만</span>"),1==i&&null!=n&&(2==t&&(e+="<td><div style=width:301px></div></td>"),""!=e&&(e+="</tr></table>")),2==i&&(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==i||2==i||3==i){var v=CollapsedGroups[W.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+'","'+W.meshid+'",'+i+")></img>"}n=meshes[W.meshid]?(e+='<span id=MxMESH cmenu=meshContextMenu tabindex=0 style=cursor:pointer onclick=gotoMesh("'+W.meshid+"\") onkeypress=\"if (event.key=='Enter') gotoMesh('"+W.meshid+"')\">"+EscapeHtml(meshes[W.meshid].name)+"</span>"+getMeshActions(m,g)+"</div>",W.meshid):(e+="<span id=MxMESH><i>개별 장치</i></span></div>","*"),2==i&&(e+="</div>"),t=0,(o[n]=1)!=i&&3!=i||(e+="<div id=DevxCol"+deviceHeaderId+(!0===v?" style=display:none":"")+">")}}else if(1==sort){var f=W.pwr?W.pwr:0;if(f!==n){if(1!=i&&3!=i||null==n||(e+="</div>"),deviceHeaderSet(),1==i&&null!==n&&(2==t&&(e+="<td><div style=width:301px></div></td>"),""!=e&&(e+="</tr></table>")),2==i&&(e+="<tr><td>"),e+="<div class=DevSt style=width:100%;padding-top:4px><span id=DevxHeader"+deviceHeaderId+" class=devHeaderx style=float:right></span>",1==i||2==i||3==i){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+'",'+i+")></img>"}e+="<span>"+PowerStateStr2(W.pwr)+"</span></div>",n=f,t=0,1!=i&&3!=i||(e+="<div id=DevxCol"+deviceHeaderId+(!0===v?" style=display:none":"")+">")}}else 2==sort&&null==n&&(n="1");0;var k=EscapeHtml(W.name);0==k.length&&(k="<i>없음</i>"),null!=W.rname&&0<W.rname.length&&(k+=" / "+EscapeHtml(W.rname));var x=EscapeHtml(W.name);1==showRealNames&&null!=W.rname&&(x=EscapeHtml(W.rname)),0==x.length&&(x="<i>없음</i>");var y="";if(null!=W.sessions&&(null==W.sessions.kvm&&null==W.sessions.terminal&&null==W.sessions.files||(y=2==i?"<img onclick=showDeviceSessions('"+W._id+"',null,event) class=deviceNotifySmallDot src=images/icon-relay-notify10.png width=10 height=10>":"<img onclick=showDeviceSessions('"+W._id+"',null,event) class=deviceNotifyDot src=images/icon-relay-notify.png width=16 height=16>"),null!=W.sessions.battery&&1==i)){var b=W.sessions.battery,w="";"ac"==b.state&&(w="Device is plugged-in"),"dc"==b.state&&(w="Device is battery powered");var C="",D=-1;"number"==typeof b.level&&0<=b.level&&b.level<=100&&(C=b.level+"%",5<(D=Math.floor((b.level+10)/25)+1)&&(lvl=5),"ac"==b.state&&(100==b.level?D=11:D+=5)),0<D&&(y+='<div class="deviceBatterySmall deviceBatterySmall'+D+'" title="'+(null!=w?w+", "+C:C)+'"></div>')}var M=W.icon;if(W.conn&&0!=W.conn||(M+=" gray"),1==i)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="'+W.meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+W._id+" type=checkbox></div><div style=height:100%;cursor:pointer tabindex=0 onclick=gotoDevice('"+W._id+"',null,null,event) onkeypress=\"if (event.key=='Enter') gotoDevice('"+W._id+'\',null,null,event)"><div class="i'+M+'" 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+'">'+x+"</div><div>"+NodeStateStr(W)+"</div></div><div class=g2></div></div></div>"+y+"</div>";else if(2==i){var S=[];W.conn&&(0!=(1&W.conn)&&S.push('<span title="메시 에이전트가 연결되어 사용할 준비가되었습니다.">에이전트</span>'),0!=(2&W.conn)?S.push('<span title="Intel&reg; AMT CIRA가 연결되어 사용할 준비가되었습니다.">CIRA</span>'):0!=(4&W.conn)&&S.push('<span title="Intel&reg; AMT는 라우팅 가능합니다.">AMT</span>'),0!=(8&W.conn)&&S.push('<span title="메시 에이전트는 다른 에이전트를 전달(relay)로 사용하여 연결할 수 있습니다.">전달(Relay)</span>'),0!=(16&W.conn)&&S.push('<span title="디바이스에 대한 MQTT 연결이 활성화되었습니다.">MQTT</span>'));var E=W.meshid;1==sort?E="pwr:"+(W.pwr?W.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('"+W._id+"',null,null,event)\">",e+='<div class=deviceBarCheckbox><input class="'+W.meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+W._id+" type=checkbox></div>",e+="<div class=deviceBarIcon onclick=gotoDevice('"+W._id+"',null,null,event)><div class=\"j"+M+'" 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('"+W._id+"',null,null,event)><span style=width:300px>"+x+"</span></div></div>"+y+"</td>",e+="<td style=text-align:center>"+getUserShortStr(W),e+="<td style=text-align:center>"+(null!=W.ip?W.ip:""),e+="<td style=text-align:center>"+S.join("&nbsp;+&nbsp;"),e+="</tr>"}else 3==i&&1&W.conn&&0!=(8&g||256&g)&&0!=(1&W.agent.caps)&&multiDesktopFilter&&(0==multiDesktopFilter.length||0<=multiDesktopFilter.indexOf("devid_"+W._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('"+W._id+"',11,null,event) onkeypress=\"if (event.key=='Enter') gotoDevice('"+W._id+"',11,null,event)\">"+y,e+='<div class="j'+M+'" style=width:16px;float:left></div>&nbsp;'+x+"</div>",e+="<span onclick=gotoDevice('"+W._id+"',null,null,event)></span><div id=xkvmid_"+W._id.split("/")[2]+"><div id=skvmid_"+W._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(\''+W._id+"') onkeypress=\"if (event.key=='Enter') toggleKvmDevice('"+W._id+"')\">연결 해제</div></div>",e+="</div>",r.push(W._id));if(3==sort&&""!=e){if(W.tags)for(var T in W.tags){var A=W.tags[T],_=(v=CollapsedGroups["tag:"+A],e.replace("**xx**xx*TaG*xx**xx**",encodeURIComponentEx(A)+(v?" style=display:none":"")));if(null==a[A]?(a[A]=_,s[A]=1):(a[A]+=_,s[A]+=1),3==i)break}e=""}deviceHeaderTotal++,void 0===deviceHeaderCount[W.state]?deviceHeaderCount[W.state]=1:deviceHeaderCount[W.state]++}}if(1==i&&null!=n&&(e+="</div>"),32<=r.length&&(Q("autoConnectDesktopCheckbox").checked=!1),QE("autoConnectDesktopCheckbox",r.length<32),3==sort){var N=[],I=0;for(var c in a)N.push(c);for(var T in N.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),N){c=N[T];if(2==i)e+="<tr><td colspan=4><div class=DevSt style=width:100%;padding-top:4px>",e+='<img class=collapseImage id="DevxColImg'+I+'" 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("'+I+'","tag:'+encodeURIComponentEx(c)+'",2)></img>',e+="<span class=devHeaderx style=float:right>"+s[c]+" node"+(1<s[c]?"s":"")+"</span><span>"+c+"</span></div>"+a[c];else e+="<div class=DevSt style=width:100%;padding-top:4px><span class=devHeaderx style=float:right>"+s[c]+" node"+(1<s[c]?"s":"")+"</span>",e+='<img class=collapseImage id="DevxColImg'+I+'" 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("'+I+'","tag:'+encodeURIComponentEx(c)+'")></img>',e+="<span>"+c+"</span></div>",e+="<div id=DevxCol"+I+(!0===v?" style=display:none":"")+">",e+=a[c],e+="</div>";I++}}var U=!1;if(""==e&&0<nodes.length&&""!=Q("SearchInput").value&&(U=!0,e=3==sort?'<div style="margin:30px">그룹에 장치가 포함되어 있지 않으면 장치의 "그룹"을 클릭하여 그룹에 추가하십시오.</div>':'<div style="margin:30px">이 검색과 일치하는 기기가 없습니다.</div>'),1==i&&2==t&&(e+="<td><div style=width:301px></div></td>"),0==sort&&""==Q("SearchInput").value&&i<3){var V=deviceHeaderId,H=[];for(var c in meshes)H.push(meshes[c]);for(var c in H.sort(nameSort),H){var R=H[c];g=GetMeshRights(R);if(null==o[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>이 메시에 Intel&reg; AMT 장치가 없습니다",0!=(4&g)&&(e+=", <a href=# style=cursor:pointer onclick='return addDeviceToMesh(\""+R._id+"\")'>한 가지 추가</a>")):2==R.mtype&&(e+="<td>",e+="<div id=DevxCol"+V+(!0===v?" style=display:none":"")+">",e+="<div style=padding:10px><i>이 그룹에 기기가 없습니다.",0!=(4&g)&&(e+=", <a href=# style=cursor:pointer onclick='return addAgentToMesh(\""+R._id+"\")'>한 가지 추가</a>")),e+=".</i></div></td>",e+="</div>",n=R._id,0}}""!=e&&0==U?(e+="</table>",2==i&&(e="<table style=width:100%;margin-top:4px cellpadding=0 cellspacing=0><th style=color:gray><th style=color:gray;width:120px>사용자<th style=color:gray;width:120px>주소<th style=color:gray;width:100px>연결성"+e+"</tr></table><div style=height:1px></div>")):(e+="</table>",3==sort&&(e='<div style="margin:10px"><i>태그가있는 장치가 없습니다.</i></div>')),e+="<div style=border-top-style:solid;border-top-width:1px;border-top-color:#DDDDDD;cursor:pointer;font-size:10px>",i<3&&0==sort&&0<nodes.length&&(4294967295==userinfo.siteadmin||0==(64&userinfo.siteadmin))&&(e+='<a href=# onclick="return account_createMesh()" title="새 장치 그룹을 만듭니다." style=cursor:pointer>장치 그룹 추가</a>&nbsp'),4294967295!=userinfo.siteadmin&&0!=(128&userinfo.siteadmin)||(e+="<a href=# onclick='return p10showMeshCmdDialog(0)' style=cursor:pointer title=\"많은 기능을 수행하는 명령어 도구 MeshCmd를 다운로드하십시오.\">MeshCmd</a>&nbsp","win32"==navigator.platform.toLowerCase()&&(e+="<a href=# onclick='return p10showMeshRouterDialog()' style=cursor:pointer title=\"TCP포트 매핑 도구 인 MeshCentral 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==i&&1==xxcurrentView){var F=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex],P=F.x+2,B=u-5,L=Math.floor(B/P);for(var c in L=P+Math.floor((B-L*P)/L),F.y=F.y*(L/F.x),F.x=L,multiDesktop)multiDesktop[c].xxdelete=!0;for(var c in r){var O=r[c],G=O.split("/")[2],z=multiDesktop[O];if(null!=z)z.m.CanvasId.setAttribute("style","background-color:black;width:"+F.x+"px;height:"+F.y+"px"),Q("xkvmid_"+G).appendChild(z.m.CanvasId),delete z.xxdelete,QH("skvmid_"+G,["연결 해제","연결 중 ...","설치...","",""][null==z.m.State?z.m.state:z.m.State]);else{var W=getNodeFromId(O);if(desktopNode==W&&null!=desktop){(t=desktop.m.CanvasId).setAttribute("id","kvmid_"+G),t.setAttribute("style","background-color:black;width:"+F.x+"px;height:"+F.y+"px"),t.setAttribute("onclick","toggleKvmDevice('"+O+"')"),t.removeAttribute("onmousedown"),t.removeAttribute("onmouseup"),t.removeAttribute("onmousemove"),Q("xkvmid_"+G).appendChild(t),QH("skvmid_"+G,["연결 해제","연결 중 ...","설치...","",""][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=G,desktop.onStateChanged=onMultiDesktopStateChange,multiDesktop[O]=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_"+G),t.setAttribute("width",640),t.setAttribute("height",480),t.setAttribute("oncontextmenu","return false"),t.setAttribute("style","background-color:black;width:"+F.x+"px;height:"+F.y+"px"),t.setAttribute("onclick","toggleKvmDevice('"+O+"')");try{Q("xkvmid_"+G).appendChild(t)}catch(e){}1==Q("autoConnectDesktopCheckbox").checked&&setTimeout(function(){connectMultiDesktop(W,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=i}}function showDeviceSessions(e,t,n){if(n&&haltEvent(n),xxdialogMode&&!t)return!1;var o=null,i="";if(null==(o=null==e?currentNode:getNodeFromId(e))||null==o.sessions)return setDialogMode(0),!1;for(var a in o.sessions)if("kvm"==a&&null==o.sessions.multidesk)for(var s in i+="<u>Remote Desktop</u>",o.sessions.kvm)i+=addHtmlValue4(getUserName(s),1==o.sessions.kvm[s]?"1세션":nobreak(format("{0} 세션",o.sessions.kvm[s])));else if("multidesk"==a)for(var s in i+="<u>Remote Desktop</u>",o.sessions.multidesk)i+=addHtmlValue4(getUserName(s),1==o.sessions.multidesk[s]?"1세션":nobreak(format("{0} 세션",o.sessions.multidesk[s])));else if("terminal"==a)for(var s in i+="<u>터미널</u>",o.sessions.terminal)i+=addHtmlValue4(getUserName(s),1==o.sessions.terminal[s]?"1세션":nobreak(format("{0} 세션",o.sessions.terminal[s])));else if("files"==a)for(var s in i+="<u>파일</u>",o.sessions.files)i+=addHtmlValue4(getUserName(s),1==o.sessions.files[s]?"1세션":nobreak(format("{0} 세션",o.sessions.files[s])));return""!=i&&setDialogMode(2,"Sessions - "+EscapeHtml(o.name),1,null,i,"SESSIONS-"+o._id),!1}function toggleCollapseGroup(e,t,n){var o;if(2==n){var i=document.getElementsByName("DevxCol"+t);if(0==i.length)return;(o="none"==i[0].style.display)?delete CollapsedGroups[t]:CollapsedGroups[t]=!0;for(var a=0;a<i.length;a++)i[a].style.display=o?"":"none"}else(o="none"==QS("DevxCol"+e).display)?delete CollapsedGroups[t]:CollapsedGroups[t]=!0,QV("DevxCol"+e,o);Q("DevxColImg"+e).src=o?"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} 사용자",e.users.length))+"</span>";var t=e.users[0],n=t,o=t.indexOf("\\");return 0<o&&(n=t.substring(o+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 o=nodes[n],i=nodes[n]._id;if(null==multiDesktop[i]&&(0==multiDesktopFilter.length||0<=multiDesktopFilter.indexOf("devid_"+i))){var a=GetNodeRights(o);(8&a||256&a)&&1&o.conn&&1==o.v&&t++}}if(8<t)return void setDialogMode(2,"모두 연결",3,function(){connectAllKvmFunction(!0)},format("{0} 장치에 연결하시겠습니까?",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,["연결 해제","연결 중 ...","설치...","",""][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,"원격 데스크톱 설정",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,o=n.split("/")[2],i=multiDesktop[n];if(null==i){if(null==Q("kvmid_"+o))return;if(2==t){if(null==e.intelamt.user||""==e.intelamt.user)return;(i=CreateAmtRedirect(CreateAmtRemoteDesktop("kvmid_"+o),authCookie)).shortid=o,i.onStateChanged=onMultiDesktopStateChange,i.m.bpp=1,i.m.useZRLE=!0,i.m.showmouse=!0,i.m.onKvmData=function(e){console.log("KVM Data received in multi-desktop mode, this is not supported.")},0<debugmode&&(i.m.onScreenSizeChange=mdeskAdjust),i.Start(n,16994,"*","*",0),i.contype=2,multiDesktop[n]=i}else 1==t&&((i=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("kvmid_"+o),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).m.mouseCursorActive(11==xxcurrentView),i.shortid=o,i.attemptWebRTC=attemptWebRTC,i.onStateChanged=onMultiDesktopStateChange,i.m.CompressionLevel=multidesktopsettings.quality,i.m.ScalingLevel=multidesktopsettings.scaling,multidesktopsettings.framerate&&(i.m.FrameRateTimer=multidesktopsettings.framerate),0<debugmode&&(i.m.onScreenSizeChange=mdeskAdjust),i.Start(n),i.contype=1,multiDesktop[n]=i)}else i.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="인터넷에있는 새 Intel&reg; AMT 컴퓨터를 추가하십시오." onclick=\'return addCiraDeviceToMesh("'+e._id+"\")'>CIRA 추가</a>"),1==e.mtype&&(0==(1&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="로컬 네트워크에있는 새 Intel&reg; AMT 컴퓨터를 추가하십시오." onclick=\'return addDeviceToMesh("'+e._id+"\")'>로컬 추가</a>",n+=' <a href=# style=cursor:pointer;font-size:10px title="로컬 네트워크를 스캔하여 새 Intel&reg; AMT 컴퓨터를 추가하십시오." onclick=\'return addAmtScanToMesh("'+e._id+"\")'>네트워크 검색</a>"),e.amt&&2==e.amt.type?n+=' <a href=# style=cursor:pointer;font-size:10px title="Intel AMT 클라이언트 제어 모드 (CCM) 활성화를 수행하십시오." onclick=\'return showCcmActivation("'+e._id+"\")'>활성화</a>":e.amt&&3==e.amt.type&&0!=(1048576&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="Intel AMT 관리자 제어 모드 (ACM) 활성화를 수행하십시오." onclick=\'return showAcmActivation("'+e._id+"\")'>활성화</a>")),2==e.mtype&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="MeshAgent(매시 에이전트)를 설치하여 새로운 컴퓨터를 이 장치 그룹에 추가하십시오." onclick=\'return addAgentToMesh("'+e._id+"\")'>에이전트 추가</a>",0==(2&features)&&(n+=' <a href=# style=cursor:pointer;font-size:10px title="이 장치 그룹에 메쉬 에이전트를 설치하도록 초대하십시오." onclick=\'return inviteAgentToMesh("'+e._id+"\")'>초대</a>")),n}function addDeviceToMesh(e){if(xxdialogMode)return!1;var t=meshes[e],n=format('장치 그룹 "{0}"에 새 Intel&reg; AMT 장치를 추가하십시오.',EscapeHtml(t.name))+"<br /><br />";return n+=addHtmlValue("장치 이름","<input id=dp1devicename style=width:230px maxlength=32 autocomplete=off onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />"),n+=addHtmlValue("호스트 이름",'<input id=dp1hostname style=width:230px maxlength=32 autocomplete=off placeholder="장치 이름과 동일" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />'),n+=addHtmlValue("사용자 이름",'<input id=dp1username style=width:230px maxlength=32 autocomplete=off placeholder="관리자" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />'),n+=addHtmlValue("암호","<input id=dp1password type=password style=width:230px autocomplete=off maxlength=32 onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />"),setDialogMode(2,"Intel&reg; AMT 장치 추가",3,addDeviceToMeshEx,n+=addHtmlValue("보안","<select id=dp1tls style=width:236px><option value=0>TLS 보안이 없습니다.</option><option value=1>TLS 보안 필요</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 o;domainUrl.substring(0,domainUrl.length-1);1==serverinfo.https?o="wss://"+t+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl:o="ws://"+t+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl;var i=format('MeshCMD 도구를 다운로드하고 다음과 같이 실행하여 "{0}"그룹에 대한 Intel AMT CCM (Client Control Mode) 활성화를 수행하십시오 :',EscapeHtml(n.name))+"<br /><br />";return setDialogMode(2,"Intel&reg; AMT 활성화",9,null,i+="<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtccm --url "+o+"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 o;domainUrl.substring(0,domainUrl.length-1);1==serverinfo.https?o="wss://"+t+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl:o="ws://"+t+(80==serverinfo.port?"":":"+serverinfo.port)+domainUrl;var i=format('MeshCMD 도구를 다운로드하고 다음과 같이 실행하여 "{0}"그룹에 대한 Intel AMT 관리자 제어 모드 (ACM) 활성화를 수행하십시오 :',EscapeHtml(n.name))+"<br /><br />";return i+="<textarea readonly=readonly style=width:100%;resize:none;height:100px;overflow:auto;font-size:12px readonly>meshcmd amtacm --url "+o+"amtactivate?id="+e.split("/")[2]+" --serverhttpshash "+serverinfo.tlshash+"</textarea>",null!=serverinfo.amtAcmFqdn&&(i+="<div style=margin-top:8px>Intel AMT는 MEBx에서 Trusted FQDN으로 설정하거나 네트워크에 유선 LAN이 있어야합니다. <b>"+serverinfo.amtAcmFqdn.join(", ")+"</b></div>"),setDialogMode(2,"Intel&reg; AMT 활성화",9,null,i),Q("idx_dlgOkButton").focus(),!1}function addAmtScanToMesh(e){if(xxdialogMode)return!1;var t="Intel AMT 장치를 검색할 IP 주소 범위를 입력하십시오.<br /><br />";return t+=addHtmlValue("IP 범위",'<input id=dp1range style=width:184px value="192.168.1.0/24" onkeyup=addAmtScanToMeshKeyUp(event) /><input id=dp1rangebutton type=button value="검색" onclick=addAmtScanToMeshButton()></input>'),setDialogMode(2,"Intel&reg; AMT 장치 검색",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"),o=0;o<n.length;o++)if(n[o].checked){var i=n[o].getAttribute("tag"),a=amtScanResults[i],s=a.hostname;"host"==a.hosttype&&(s=capitalizeFirstLetter(s.split(".")[0])),meshserver.send({action:"addamtdevice",meshid:t,devicename:s,hostname:a.hostname,amtusername:"",amtpassword:"",amttls:a.tls})}}function addAmtScanToMeshButton(){QE("dp1range",!1),QE("dp1rangebutton",!1),QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px>검색 중...</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"),o="<select id=dlgAddCiraSel onclick=dlgAddCiraSelClick() style=width:230px><option value=0>MeshCommander 스크립트</option><option value=1>수동 사용자 이름 / 비밀번호</option>";0==(16&features)&&(o+="<option value=2>수동 인증서</option></select>");var i="";return i+=addHtmlValue("설치 방법",o),i+="<hr>",i+="<div id=dlgAddCira0>"+format("CIRA를 사용하여 장치 그룹 \"{0}\"에 새 Intel&reg; AMT 장치를 추가하려면 다음 스크립트 파일을 다운로드하고, 스크립트를 실행하여 컴퓨터를 구성하려면 <a href = 'http://meshcommander.com' rel='noreferrer noopener' target='_blank '>MeshCommander</a>를 사용하십시오.",EscapeHtml(t.name))+"<br /><br />",i+=addHtmlValue("CIRA 설치",'<a href="mescript.ashx?type=1'+(urlargs.key?"&key="+urlargs.key:"")+"&meshid="+e+'" download>cira_setup.mescript</a>'),i+=addHtmlValue("CIRA 정리",'<a href="mescript.ashx?type=2'+(urlargs.key?"&key="+urlargs.key:"")+'" download>cira_clean.mescript</a>'),i+="</div>",i+="<div id=dlgAddCira1 style=display:none>"+format('CIRA를 사용하여 장치 그룹 "{0} "에 새 Intel&reg; AMT 장치를 추가하려면, Intel AMT 안에 있는 신뢰할 수 있는 루트로서 다음 인증서를로드하십시오.',EscapeHtml(t.name)),serverinfo.mpspass,i+=" 이 사용자 이름과 비밀번호를 사용하여 서버를 인증하십시오.<br /><br />",i+=addHtmlValue("루트 인증서",'<a href="MeshServerRootCert.cer'+(urlargs.key?"?key="+urlargs.key:"")+'" download>루트 인증서 파일</a>'),i+=addHtmlValue("사용자 이름",'<input style=width:230px readonly value="'+n.substring(0,16)+'" />'),serverinfo.mpspass&&(i+=addHtmlValue("암호",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpspass)+'" />')),null!=serverinfo&&(i+=addHtmlValue("MPS 서버",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')),i+="</div>",0==(16&features)&&(i+="<div id=dlgAddCira2 style=display:none>"+format('CIRA를 사용하여 장치 그룹 "{0} "에 새 Intel&reg; AMT 장치를 추가하려면, Intel AMT 내에서 신뢰할 수 있는 루트로서 다음 인증서를 로드하고, 다음 일반 이름의 클라이언트 인증서를 사용하여 인증 한 후 다음 서버에 연결하십시오.',EscapeHtml(t.name))+"<br /><br />",i+=addHtmlValue("루트 인증서",'<a href="MeshServerRootCert.cer'+(urlargs.key?"?key="+urlargs.key:"")+'" download>루트 인증서 파일</a>'),i+=addHtmlValue("조직",'<input style=width:230px readonly value="'+n+'" />'),null!=serverinfo&&(i+=addHtmlValue("MPS 서버",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')),i+="</div>"),setDialogMode(2,"Intel&reg; AMT CIRA 장치 추가",2,null,i,"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 o=t[1].split(".");for(var i in o)0==o[i].length&&(n=!1)}return n}function inviteAgentToMesh(e){if(xxdialogMode)return!1;var t="",n=meshes[e];return 64&features&&(t+=addHtmlValue("초대 유형","<select id=d2InviteType onchange=d2ChangedInviteType() style=width:236px><option value=0>링크 초대</option><option value=1>이메일 초청</option></select>")+"<hr />",t+="<div id=emailInviteDiv style=display:none>"+format('메쉬 에이전트를 설치하도록 초대하십시오. "{0}"디바이스 그룹의 메시 에이전트 설치 링크가 포함된 이메일이 발송됩니다.',EscapeHtml(n.name))+"<br /><br />",t+=addHtmlValue("이름 (선택 사항)",'<input id=agentInviteName value="" style=width:230px maxlength=64 />'),t+=addHtmlValue("이메일",'<input id=agentInviteEmail style=width:230px placeholder="example@email.com" onkeyup=validateAgentInvite()></input>'),t+=addHtmlValue("운영체제","<select id=agentInviteNameOs onchange=d2ChangedInviteType() style=width:236px><option value=4>설치 링크를 보냅니다.</option><option value=0 selected>모두 지원됨</option><option value=1>오직 Windows 만</option><option value=3>오직 Apple MacOS만</option><option value=2>오직 Linux만</option></select>"),t+="<div id=d2agentexpirediv>",t+=addHtmlValue("링크 만료","<select id=agentInviteExpire style=width:236px><option value=1>1시간</option><option value=8>8시간</option><option value=24>1일</option><option value=168>1주</option><option value=5040>1개월</option><option value=0>제한없는</option></select>"),t+="</div>",t+=addHtmlValue("설치 유형","<select id=agentInviteType style=width:236px><option value=0>백그라운드 실행 및 대화식</option><option value=2>오직 백그라운드 실행만</option><option value=1>오직 대화식만</option></select>"),t+=addHtmlValue("메시지<br />(선택사항)",'<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>'),t+="</div>"),t+="<div id=urlInviteDiv>"+format('초대 링크를 공유하여 메쉬 에이전트를 설치하도록 초대하십시오. 이 링크는 사용자에게 "{0}"장치 그룹의 설치를 안내합니다. 이 링크는 공개이며, 이 서버에 대한 계정이 필요하지 않습니다.',EscapeHtml(n.name))+"<br /><br />",t+=addHtmlValue("링크 만료","<select id=d2inviteExpire style=width:236px onchange=d2RequestInvitationLink()><option value=1>1시간</option><option value=8>8시간</option><option value=24>1일</option><option value=168>1주</option><option value=5040>1개월</option><option value=0>제한없는</option></select>"),setDialogMode(2,"초대",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="링크를 클립보드에 복사" 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("운영체제","<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 (제거)</option><option value=4>Linux / BSD (제거)</option></select>"),n+="<div id=aginsTypeDiv>",n+=addHtmlValue("설치 유형","<select id=aginsType onchange=addAgentToMeshClick() style=width:236px><option value=0>백그라운드 실행 및 대화식</option><option value=2>오직 백그라운드 실행만</option><option value=1>오직 대화식만</option></select>"),n+="</div><hr>";var o=t.name;o=o.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('장치 그룹 "{0}"에 새 컴퓨터를 추가하려면, 관리할 컴퓨터에 메쉬 에이전트를 다운로드하고 설치하십시오. 이 에이전트에는 서버 및 장치 그룹 정보가 포함되어 있습니다.',EscapeHtml(t.name))+"<br /><br />",n+=addHtmlValue("메시 에이전트",'<a id=aginsw32lnk href="meshagents?id=3&meshid='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="MeshAgent의 32비트 버전">Windows (.exe)</a> <img src=images/link4.png height=10 width=10 title="Windows 32비트 에이전트 웹 주소를 클립보드에 복사" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=3&meshid='+e.split("/")[2]+'&installflags=",1)>'),n+=addHtmlValue("메시 에이전트",'<a id=aginsw64lnk href="meshagents?id=4&meshid='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="MeshAgent의 64비트 버전">Windows x64 (.exe)</a> <img src=images/link4.png height=10 width=10 title="Windows 64비트 에이전트 웹 주소를 클립보드에 복사" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=4&meshid='+e.split("/")[2]+'&installflags=",1)>'),0<debugmode&&(n+=addHtmlValue("설정 파일",'<a id=aginswmshlnk href="meshsettings?id='+e.split("/")[2]+"&installflags=0"+(urlargs.key?"&key="+urlargs.key:"")+'" download rel="noreferrer noopener" target="_blank">'+format("{0} 설정 (.msh)",EscapeHtml(t.name))+"</a>")),n+="</div>",n+="<div id=agins_linux style=display:none>"+format("{0}에 컴퓨터를 추가하려면 다음 명령을 실행하십시오. root 계정에 대한 자격 증명이 필요합니다.",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'>* BSD의 경우, 먼저 \"pkg install wget sudo bash\"를 실행하십시오.</div></div>",n+="<div id=agins_osx style=display:none>"+format('장치 그룹 "{0} "에 새 컴퓨터를 추가하려면, 관리할 컴퓨터에 메쉬 에이전트를 다운로드하고 설치하십시오. 이 에이전트 설치 관리자에는 서버 및 장치 그룹 정보가 포함되어 있습니다.',EscapeHtml(t.name))+"<br /><br />",n+=addHtmlValue("메시 에이전트",'<a href="meshosxagent?id=16&meshid='+e.split("/")[2]+(urlargs.key?"&key="+urlargs.key:"")+'" download rel="noreferrer noopener" target="_blank" title="MacOS용 MeshAgent의 64비트 버전">MacOS Agent (64bit)</a> <img src=images/link4.png height=10 width=10 title="MacOS 에이전트 웹 주소를 클립보드에 복사" style=cursor:pointer onclick=copyAgentUrl("meshosxagent?id=16&meshid='+e.split("/")[2]+'",0)>'),n+="</div>",n+='<div id=agins_windows_un style=display:none>메쉬 에이전트를 제거하려면, 아래 파일을 다운로드하여 실행한 다음 "제거"를 클릭하십시오.<br /><br />',n+=addHtmlValue("메시 에이전트",'<a href="meshagents?id=3'+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="MeshAgent의 32비트 버전">Windows (.exe)</a>'),n+=addHtmlValue("메시 에이전트",'<a href="meshagents?id=4'+(urlargs.key?"&key="+urlargs.key:"")+'" download onclick="setDialogMode(0)" title="MeshAgent의 64비트 버전">Windows x64 (.exe)</a>'),n+="</div>",n+="<div id=agins_linux_un style=display:none>메시 에이전트를 제거하려면 다음 명령을 실행하십시오. 루트 자격 증명이 필요합니다.<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,"MeshAgent(메쉬 에이전트) 추가",2,null,n+="</div>","fileDownload");var i=serverinfo.name;-1!=i.indexOf(".")&&0==(2&features)||(i=window.location.hostname);var a=domainUrl.substring(0,domainUrl.length-1);if(1==serverinfo.https){var s=443==serverinfo.port?"":":"+serverinfo.port;0==(8192&features)?(Q("agins_linux_area").value='(wget "https://'+i+s+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-check-certificate -O ./meshinstall.sh || wget "https://'+i+s+domainUrl+'meshagents?script=1" --no-proxy --no-check-certificate -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh https://'+i+s+a+" '"+e.split("/")[2]+"' || ./meshinstall.sh https://"+i+s+a+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='(wget "https://'+i+s+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-check-certificate -O ./meshinstall.sh || wget "https://'+i+s+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://'+i+s+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://'+i+s+a+" '"+e.split("/")[2]+"' || ./meshinstall.sh https://"+i+s+a+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='wget "https://'+i+s+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{s=80==serverinfo.port?"":":"+serverinfo.port;0==(8192&features)?(Q("agins_linux_area").value='(wget "http://'+i+s+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" -O ./meshinstall.sh || wget "http://'+i+s+domainUrl+'meshagents?script=1" --no-proxy -O ./meshinstall.sh) && chmod 755 ./meshinstall.sh && sudo -E ./meshinstall.sh http://'+i+s+a+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='(wget "http://'+i+s+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" -O ./meshinstall.sh || wget "http://'+i+s+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://'+i+s+domainUrl+"meshagents?script=1"+(urlargs.key?"&key="+urlargs.key:"")+'" --no-proxy -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://'+i+s+a+" '"+e.split("/")[2]+"'\r\n",Q("agins_linux_area_un").value='wget "http://'+i+s+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 o="https://"+n+(443==serverinfo.port?"":":"+serverinfo.port)+domainUrl+e;1==t&&(o+=Q("aginsType").value),copyTextToClip(o+=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 o=Q("dp1hostname").value;""==o&&(o=Q("dp1devicename").value),meshserver.send({action:"addamtdevice",meshid:t,devicename:Q("dp1devicename").value,hostname:o,amtusername:n,amtpassword:Q("dp1password").value,amttls:Q("dp1tls").value})}function deviceHeaderSet(){0!=deviceHeaderId?(deviceHeaders["DevxHeader"+deviceHeaderId]=1==deviceHeaderTotal?"1기기":format("{0} 기기",deviceHeaderTotal),deviceHeaderId++,deviceHeaderCount={},deviceHeaderTotal=0):deviceHeaderId=1}var powerStateStrings=["",'<span title="장치의 전원이 켜져 있습니다.">전원이 켜짐</span>','<span title="장치가 절전 상태입니다 (S1).">절전 중</span>','<span title="장치가 절전 상태입니다 (S2).">절전 중</span>','<span title="장치가 최대 절전 상태입니다 (S3).">최대 절전 모드</span>','<span title="장치가 최대 절전 상태입니다 (S4).">최대 절전 모드</span>','<span title="장치의 전원이 꺼진 상태입니다 (S5).">소프트-오프</span>','<span title="장치가 감지되었지만 전원 상태를 얻을 수 없습니다.">현재</span>'],powerStateStrings2=["","장치의 전원이 공급되었습니다.","장치가 절전 상태입니다 (S1)","장치가 절전 상태입니다 (S2)","장치가 최대 절전 상태입니다 (S3).","장치가 최대 절전 모드입니다 (S4).","장치가 소프트 오프 상태입니다 (S5)","장치가 있지만 전원 상태를 확인할 수 없습니다."],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="메시 에이전트가 연결되어 사용할 준비가되었습니다.">에이전트</span>'),0!=(2&e.conn)?t.push('<span title="Intel&reg; AMT CIRA가 연결되어 사용할 준비가되었습니다.">CIRA</span>'):0!=(4&e.conn)&&t.push('<span title="Intel&reg; AMT는 라우팅 가능합니다.">AMT</span>'),0!=(8&e.conn)&&t.push('<span title="메시 에이전트는 다른 에이전트를 전달(relay)로 사용하여 연결할 수 있습니다.">전달(Relay)</span>'),0!=(16&e.conn)&&t.push('<span title="디바이스에 대한 MQTT 연결이 활성화되었습니다.">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]:"알 수 없는"}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="선택하지 않음",QV("cxmgroupsplit",!0),QV("cxmdesktop",!0)):(QE("GroupActionButton",!1),Q("SelectAllButton").value="모두 선택",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>MQTT 메시지를 보냅니다.</option>";break}for(var n in t){var o=getNodeFromId(t[n]),i=GetNodeRights(o);if(0!=(1&o.conn)&&0!=(32768&i)){e+="<option value=104>에이전트 제거</option>";break}}var a="선택한 모든 장치에서 수행할 작업을 선택하십시오. 작업은 적절한 권한 내에서만 수행될 것입니다.<br /><br />";setDialogMode(2,"그룹 동작",3,groupActionFunctionEx,a+=addHtmlValue("조작","<select id=d2groupop><option value=100>장치 깨우기(Wake-up)</option><option value=4>절전 장치</option><option value=3>기기 초기화</option><option value=2>장치 전원 끄기</option><option value=105>장치 정보 내보내기</option><option value=102>장치 그룹으로 이동</option>"+e+"<option value=101>여러 장치 삭제</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 o=t[n].value.substring(6);-1==e.indexOf(o)&&e.push(o)}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() />확인</label>",setDialogMode(2,"여러 기기 삭제",3,d2groupActionFunctionDelExec,"선택된 장치를 삭제하시겠습니까?<br /><br /><label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelCheck() />확인</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="아래 파일 형식 중 하나를 사용하여 장치 목록을 다운로드하십시오.<br /><br />";e+=addHtmlValue("CSV 형식","<a href=# style=cursor:pointer onclick='return p2downloadDeviceInfoCSV()'>devicelist.csv</a>"),setDialogMode(2,"장치 정보 내보내기",1,null,e+=addHtmlValue("JSON 형식","<a href=# style=cursor:pointer onclick='return p2downloadDeviceInfoJSON()'>devicelist.json</a>"))}}function p2downloadDeviceInfoCSV(){var e="아이디, 이름, rname, 호스트, 아이콘, ip, osdesc, 상태, 그룹 이름, conn, pwr\r\n",t=getCheckedDevices();for(var n in t){var o=getNodeFromId(t[n]);e+='"'+o._id.split(",").join("")+'","'+o.name.split(",").join("")+'","'+(o.rname?o.rname.split(",").join(""):"")+'","'+(o.host?o.host.split(",").join(""):"")+'","'+o.icon+'","'+(o.ip?o.ip:"")+'","'+(o.osdesc?o.osdesc.split(",").join(""):"")+'","'+o.state+'","'+meshes[o.meshid].name.split(",").join("")+'","'+(o.conn?o.conn:"")+'","'+(o.pwr?o.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(),o=t.name.toLowerCase();return o<n?1:n<o?-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,o=t.pwr?t.pwr:0;return o<n?-1:n<o?1:n==o?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,o=null,i=null;if(e.startsWith("사용자:".toLowerCase())?t=e.substring("사용자:".length):e.startsWith("u:".toLowerCase())?t=e.substring("u:".length):e.startsWith("IP :".toLowerCase())?n=e.substring("IP :".length):e.startsWith("그룹:".toLowerCase())?o=e.substring("그룹:".length):e.startsWith("g:".toLowerCase())?o=e.substring("g:".length):e.startsWith("태그:".toLowerCase())?i=Q("SearchInput").value.trim().substring("태그:".length):e.startsWith("t:".toLowerCase())&&(i=Q("SearchInput").value.trim().substring("t:".length)),""==e)for(var a in nodes)nodes[a].v=!0;else if(null!=n)for(var a in nodes)nodes[a].v=null!=nodes[a].ip&&0<=nodes[a].ip.indexOf(n);else if(null!=o)for(var a in nodes)nodes[a].v=0<=meshes[nodes[a].meshid].name.toLowerCase().indexOf(o);else if(null!=i)for(var a in nodes)nodes[a].v=null==nodes[a].tags&&""==i||null!=nodes[a].tags&&0<=nodes[a].tags.indexOf(i);else if(null!=t){for(var a in nodes)if(nodes[a].v=!1,nodes[a].users&&0<nodes[a].users.length)for(var s in nodes[a].users)0<=nodes[a].users[s].toLowerCase().indexOf(t)&&(nodes[a].v=!0)}else try{var r=e.split(/\s+/).join("|"),l=new RegExp(r);for(var a in nodes)if(nodes[a].v=l.test(nodes[a].name.toLowerCase())||null!=nodes[a].rnamel&&l.test(nodes[a].rnamel.toLowerCase()),0==nodes[a].v&&nodes[a].tags)for(var d in nodes[a].tags){if(l.test(nodes[a].tags[d].toLowerCase())){nodes[a].v=!0;break}nodes[a].v=!1}}catch(e){for(var a in nodes)nodes[a].v=!0}if(Q("OnlineCheckBox").checked)for(var a in nodes)null!=nodes[a].conn&&0!=nodes[a].conn||(nodes[a].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,o=document.elementFromPoint(e.pageX-t,e.pageY-n);o&&null!=o&&null==o.attributes.cmenu;)o=o.parentElement;if(null==o)return!0;var i=o.attributes.cmenu.value;switch(i){case"termConnectButton":if(null==currentNode||null==currentNode.agent)return!0;contextelement=o;var a=document.getElementById("termShellContextMenu");4<currentNode.agent.id&&(a=document.getElementById("termShellContextMenuLinux")),showContextMenuDiv(a,e.pageX,e.pageY);break;case"deskConnectButton":if(null==currentNode||null==currentNode.agent)return!0;contextelement=o,showContextMenuDiv(document.getElementById("deskConnectContextMenu"),e.pageX,e.pageY);break;case"devsContentMenu":contextelement=o,showContextMenuDiv(a=document.getElementById("contextMenu"),e.pageX,e.pageY);var s=contextelement.children[1].attributes.onclick.value,r=getNodeFromId(s.substring(12,s.length-18)),l=meshes[r.meshid],d=GetNodeRights(r),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==r.agent||null==r.agent.caps||0!=(1&r.agent.caps)||r.intelamt&&2==r.intelamt.state)&&(8&d||256&d)&&u),QV("cxterminal",(1==l.mtype||null==r.agent||null==r.agent.caps||0!=(2&r.agent.caps)||r.intelamt&&2==r.intelamt.state)&&8&d&&p),QV("cxfiles",2==l.mtype&&(null==r.agent||null==r.agent.caps||0!=(4&r.agent.caps))&&8&d&&m),QV("cxevents",null!=r.intelamt&&(2==r.intelamt.state||2&r.conn)&&8&d),QV("cxconsole",c&&2==l.mtype&&(null==r.agent||null==r.agent.caps||0!=(8&r.agent.caps))&&8&d);break;default:if(null==(a=document.getElementById(i)))return!0;contextelement=o,showContextMenuDiv(a,e.pageX,e.pageY)}return haltEvent(e)}}function showContextMenuDiv(e,t,n){var o=document.documentElement.getBoundingClientRect(),i=o.height,a=o.width;e.style.left=e.style.right=e.style.top=e.style.bottom=null,a/2<t?e.style.right=a-event.pageX+"px":e.style.left=event.pageX+"px",i/2<n?e.style.bottom=i-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 o=[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="+o+"&hide=16","meshcentral:"+n);else{gotoDevice(n,o);var i=meshes[currentNode.meshid];1&currentNode.conn&&2==i.mtype&&(11==o&&null==desktop&&1&currentNode.agent.caps&&connectDesktop(null,3),12==o&&null==terminal&&2&currentNode.agent.caps&&connectTerminal(null,1),13==o&&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 o=0;o<n.length;o++)n[o].attributes&&n[o].attributes.class.value.split(" ")[0]==t&&(n[o].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 연결",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 원격 연결 포트 :<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,"이름 바꾸기",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("파일 편집기","200k 미만의 파일만 편집 할 수 있습니다."):3==e&&setDialogMode(2,"삭제",3,p13deletefileCm,"항목을 삭제 하시겠습니까?",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 o=map_parseNodeLoc(nodes[n]),i=xxmap.markersSource.getFeatureById(nodes[n]._id);if(null==o||nodes[n].meshid!=e&&null!=e)i&&xxmap.markersSource.removeFeature(i);else{var a=o[0],s=o[1];o[2];null==t?t=[a,s,a,s,0]:(a<t[0]&&(t[0]=a),s<t[1]&&(t[1]=s),a>t[2]&&(t[2]=a),s>t[3]&&(t[3]=s)),null==i?(addFeature(nodes[n]),t[4]=1):(updateFeature(nodes[n],i),i.setStyle(markerStyle(nodes[n],o[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 o=getCorrespondingFeature(t);QH("xmap-info-window",o.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 o=getModifiedFeature(e._id);if(o)xxmap.markersSource.addFeature(o);else{if(!t&&!n){var i=map_parseNodeLoc(e);t=i[0],n=i[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 a=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});a.setId(e._id),a.setStyle(markerStyle(e)),xxmap.markersSource.addFeature(a)}}}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 o=n[0],i=n[1];if(o!=t.get("lat")||i!=t.get("lon")){t.set("lat",o),t.set("lon",i);var a=ol.proj.transform([parseFloat(i),parseFloat(o)],"EPSG:4326","EPSG:3857");t.getGeometry().setCoordinates(a)}}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 o=e.getGeometry().getCoordinates(),i=ol.proj.transform(o,"EPSG:3857","EPSG:4326");180<i[0]&&(i[0]=180-i[0]);var a=[i[1],i[0]];meshserver.send({action:"changedevice",nodeid:t,userloc:a})}}}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){"범위 확대"==e.text||"범위 축소"==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 o=xxmap.activeInteractions[n].feature,i=o.getGeometry().getCoordinates();if(i[0].toFixed(5)==t[0].toFixed(5)&&i[1].toFixed(5)==t[1].toFixed(5))return o}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 o=(n[0]+n[2])/2,i=(n[1]+n[3])/2,a=Math.max(Math.abs(n[0]-n[2]),Math.abs(n[1]-n[3])),s=xxmap.map.getView();s.setCenter(ol.proj.transform([i,o],"EPSG:4326","EPSG:3857"));for(var r=360,l=-2;a<r;)l++,r/=2;s.setZoom(l)}}function placeNode(e){if(!xxdialogMode){var t='<div style=margin-bottom:6px><label for=selectnode-search>검색</label>&nbsp&nbsp<input type=text placeholder="장치 이름" 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>장치를 찾을 수 없습니다.</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,"위치를 지정할 기기를 선택하십시오",3,placeNodeEx,t+"</div>",e),onPlaceNodeInputChange()}}function placeNodeEx(e,t){var n=document.getElementsByName("PlaceMapDeviceCheckbox");for(var o in n)if(n[o].checked){var i=getNodeFromId(n[o].id.substring(0,n[o].id.length-8));if(i){var a=xxmap.markersSource.getFeatureById(o),s=ol.proj.transform(t,"EPSG:3857","EPSG:4326"),r=[s[1],s[0]];if(a)a.getGeometry().setCoordinates(t),getActiveInteractions(a)?saveMarkerloc(a):meshserver.send({action:"changedevice",nodeid:i._id,userloc:r});else meshserver.send({action:"changedevice",nodeid:i._id,userloc:r})}}}function onPlaceNodeInputChange(){updatePlaceNodeTable(Q("selectnode-search").value.trim().toLowerCase())}function updatePlaceNodeTable(e){document.getElementsByName("PlaceMapDeviceCheckbox");var t=0;for(var n in nodes){var o=0<=nodes[n].namel.indexOf(e)||""==e||null!=nodes[n].rnamel&&0<=nodes[n].rnamel.indexOf(e);o&&t++,QV(nodes[n]._id+"-rowid",o)}QV("noNodesMapPlace",0==t)}function selectNodeToPlace(e,t){if("PlaceMapDeviceCheckbox"!=e.target.name){var n=Q(t+"-checkid");n.checked=!n.checked}var o=document.getElementsByName("PlaceMapDeviceCheckbox"),i=0;for(var a in o)o[a].checked&&i++;QE("idx_dlgOkButton",0<i)}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,o='<div class="xmapItem">',i=0;i<t.length;i++)if(t[i].display_name&&t[i].boundingbox[0]&&t[i].boundingbox[1]&&t[i].boundingbox[2]&&t[i].boundingbox[3]){n++;o+='<div class="xmapItemSel1" onclick=mapGotoSelectedLocation(this)><div>'+t[i].display_name+"</div><div style=display:none>"+t[i].boundingbox[0]+"!#!"+t[i].boundingbox[1]+"!#!"+t[i].boundingbox[2]+"!#!"+t[i].boundingbox[3]+"</div></div>"}if(o+="</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&&(o="<div style=width:200px>위치를 찾을 수 없습니다.<div>"),QV("xmapSearchResultsDlg",!0);QH("xmapSearchResults",o)}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:"기기 위치 수정",callback:function(e){modifyMarkerloc(e.data)}},map_cm_clearMarker={text:"기기 위치 제거",callback:function(e){meshserver.send({action:"changedevice",nodeid:e.data.a,userloc:[]})}},map_cm_saveMarker={text:"기기 위치 저장",callback:function(e){saveMarkerloc(e.data)}},map_cm_nodemenu_items=[{text:"일반 정보",callback:function(e){null!=e.data&&gotoDevice(e.data,10)}},{text:"데스크탑",callback:function(e){null!=e.data&&gotoDevice(e.data,11)}},{text:"터미널",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:"범위 확대",callback:function(e){zoomToLocation(e.data.getGeometry().getCoordinates(),19)}},{text:"범위 축소",callback:function(e){zoomToLocation(e.data.getGeometry().getCoordinates(),2)}}],contextmenu_items=[{text:"새로 고침",callback:function(){refreshMap(!0,!0)}},{text:"범위에 맞게 확대",callback:function(){zoomToFitExtent()}},{text:"여기가 지도의 중심입니다.",callback:function(e){xxmap.mapView.animate({center:e.coordinate})}},{text:"기기를 이 곳에 지정",callback:function(e){placeNode(e.coordinate)}}]);var powerTimelineNode=null,powerTimelineReq=null,powerTimelineUpdate=null,powerTimeline=null;function getCurrentNode(){return currentNode}function gotoDevice(e,t,n,o){if(!0===userinfo.emailVerified||1!=serverinfo.emailcheck||4294967295==userinfo.siteadmin)if(262144&features&&0==count2factoraAuths())setDialogMode(2,"계정 보안",1,null,'2단계 인증이 활성화 될 때까지 장치에 액세스 할 수 없습니다. 이것은 추가 보안을 위해 필요합니다. "내 계정"으로 이동하여 "계정 보안" 부분을 보십시오.');else if(o&&1==o.shiftKey)window.open(window.location.origin+"?node="+e.split("/")[2]+"&viewmode=10&hide=16","meshcentral:"+e);else{var i=getNodeFromId(e);if(null!=i){var a=meshes[i.meshid],s=GetNodeRights(i),r=null==currentNode||currentNode._id!=e;if(!currentNode||currentNode._id!=i._id||1==n){if(currentNode=i,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(i.name);0==m.length&&(m="<i>없음</i>"),0==(4&s)||a.flags&&0!=(2&a.flags)||(m='<span tabindex=0 title="서버 측 장치 이름을 편집하려면 여기를 클릭하십시오" onclick=showEditNodeValueDialog(0) onkeyup="if (event.key == \'Enter\') showEditNodeValueDialog(0)" style=cursor:pointer>'+m+' <img class=hoverButton src="images/link5.png" /></span>'),p=m,a&&(m+="<span style=color:#AAA;font-size:small> - "+EscapeHtml(a.name)+"</span>"),QH("p10deviceName",m),QH("p11deviceName",m),QH("p12deviceName",m),QH("p13deviceName",m),QH("p14deviceName",m),QH("p15deviceName","콘솔 -"+m),QH("p16deviceName",m),QH("p17deviceName",m),QH("p19deviceName",m);var g="<table style=width:100%>";0!=(8&args.hide)&&(g+="<br />"+addDeviceAttribute("이름",p)),a&&(g+=addDeviceAttribute('<span title="이 컴퓨터가 속한 장치 그룹의 이름입니다.">그룹</span>','<a href=# title="이 컴퓨터가 속한 장치 그룹의 이름" onclick=gotoMesh("'+i.meshid+'") style=cursor:pointer>'+EscapeHtml(meshes[i.meshid].name)+"</a>")),null!=i.rname&&i.name!=i.rname&&(g+=addDeviceAttribute('<span title="운영 체제에 설정된 이 컴퓨터의 이름">OS에서 설정한 이름</span>','<span title="운영 체제에 설정된 이 컴퓨터의 이름">'+EscapeHtml(i.rname)+"</span>")),0==(1&features)&&(g+=addDeviceAttribute("호스트 이름",addLinkConditional("<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>"+(i.host?EscapeHtml(i.host):"<i>없음</i>")+"</span>","showEditNodeValueDialog(1)",4&s)));var h=i.desc?EscapeHtml(i.desc):"<i>없음</i>";if(g+=addDeviceAttribute("설명",0!=(4&s)?"<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>"+h+' <img class=hoverButton src="images/link5.png" /></span>':h),null!=i.agent&&null!=i.agent.id&&null!=i.agent.ver){var v="";v=i.agent.id<=agentsStr.length?agentsStr[i.agent.id]:agentsStr[0],0!=i.agent.ver&&(v+=" v"+i.agent.ver),g+=addDeviceAttribute("메시 에이전트",v)}if(null!=i.intelamt){v="";var f={0:nobreak("활성화되지 않음 (Pre)"),1:nobreak("활성화되지 않음 (In)"),2:nobreak("활성화 됨")};null!=i.intelamt.ver&&null==i.intelamt.state?v+="<i>알 수 없는 상태</i>, v"+i.intelamt.ver:null==i.intelamt.ver&&2==i.intelamt.state?v+="<i>활성화 됨</i>":null==i.intelamt.ver||null==i.intelamt.state?v+="<i>알 수 없는 버전 및 상태</i>":(v+=f[i.intelamt.state],2==i.intelamt.state&&i.intelamt.flags&&(2&i.intelamt.flags?v+=' <span title="클라이언트 제어 모드에서 Intel AMT가 활성화 됨">CCM</span>':4&i.intelamt.flags&&(v+=' <span title="관리 제어 모드에서 Intel AMT가 활성화 됨">ACM</span>')),v+=", v"+i.intelamt.ver),1==i.intelamt.tls&&(v+=', <span title="Intel AMT는 TLS 네트워크 보안으로 설치되었습니다.">TLS</span>'),2==i.intelamt.state&&(null!=i.intelamt.user&&""!=i.intelamt.user||(v+=0!=(4&s)?', <i style=color:#FF0000;cursor:pointer title="Intel&reg; AMT 자격 증명 편집" onclick=editDeviceAmtSettings("'+i._id+'")>자격 증명이 없습니다.</i>':", <i style=color:#FF0000>자격 증명이 없습니다.</i>"),v+=" ",0!=(4&s)&&(v+='<img src=images/link4.png height=10 width=10 title="Intel&reg; AMT 자격 증명 편집" style=cursor:pointer onclick=editDeviceAmtSettings("'+i._id+'")>'));var k='<span title="인텔 &reg; 관리 효율성 엔진">Intel&reg; ME<span>';"number"==typeof i.intelamt.sku&&(0!=(8&i.intelamt.sku)?k='<span title="Intel&reg; Active Management Technology">Intel&reg; AMT<span>':0!=(16&i.intelamt.sku)&&(k='<span title="Intel&reg; 표준 관리자">Intel&reg; SM<span>')),g+=addDeviceAttribute(k,v)}if(null!=i.agent&&null!=i.agent.tag)(x=EscapeHtml(i.agent.tag)).startsWith("mailto:")&&(x='<a href="'+x+'">'+x.substring(7)+"</a>"),g+=addDeviceAttribute("에이전트 태그",x);else if(null!=i.intelamt&&null!=i.intelamt.tag){var x;(x=EscapeHtml(i.intelamt.tag)).startsWith("mailto:")&&(x='<a href="'+x+'">'+x.substring(7)+"</a>"),g+=addDeviceAttribute("Intel&reg; AMT 태그",x)}if(i.osdesc&&(g+=addDeviceAttribute("운영체제",i.osdesc)),i.av&&0<i.av.length){var y=[];for(var b in i.av)if(i.av[b].product){var w=EscapeHtml(i.av[b].product);!0!==i.av[b].enabled&&(w+=" - <span style=color:red>비활성화</span>"),!0!==i.av[b].updated&&(w+=" - <span style=color:red>만료된</span>"),1==i.av[b].enabled&&1==i.av[b].updated&&(w+=" - <span style=color:green>확인</span>"),y.push(w)}g+=addDeviceAttribute("백신소프트웨어",y.join("<br />"))}if(i.users&&i.conn&&0<i.users.length&&1&i.conn&&(g+=addDeviceAttribute(format("활성된 계정 {0}",1<i.users.length?"s":""),i.users.join(", "))),null!=i.agent){var C=[],D=0;i.consent&&(D=i.consent),serverinfo.consent&&(D|=serverinfo.consent),64&D&&8&D?C.push("데스크톱 프롬프트+도구모음"):64&D?C.push("데스크톱 툴바"):8&D?C.push("데스크탑 프롬프트"):1&D&&C.push("데스크탑 알림"),16&D?C.push("터미널 프롬프트"):2&D&&C.push("터미널 알림"),32&D?C.push("파일 프롬프트"):4&D&&C.push("파일 알림"),7==D&&(C=["항상 알림"]),56==(56&D)&&(C=["항상 묻기"]),""==(C=C.join(", "))&&(C="<i>없음</i>"),g+=addDeviceAttribute("사용자 연결 옵션",addLinkConditional(C,"p20editmeshconsent(3)",1&s))}var M=i.conn;if(M&&1<M){var S=[];0!=(1&i.conn)&&S.push('<span title="메시 에이전트가 연결되어 사용할 준비가되었습니다.">메시 에이전트</span>'),0!=(2&i.conn)?S.push('<span title="Intel&reg; AMT CIRA가 연결되어 사용할 준비가되었습니다.">Intel&reg; AMT CIRA</span>'):0!=(4&i.conn)&&S.push('<span title="Intel&reg; AMT는 라우팅 가능하며 사용할 준비가 되었습니다.">Intel&reg; AMT</span>'),0!=(8&i.conn)&&S.push('<span title="메시 에이전트는 다른 에이전트를 전달(relay)로 사용하여 연결할 수 있습니다.">메시 전달(Relay)</span>'),0!=(16&i.conn)&&S.push('<span title="디바이스에 대한 MQTT 연결이 활성화되었습니다.">MQTT</span>'),g+=addDeviceAttribute("연결성",S.join(", "))}var E="<i>없음</i>";if(null!=i.tags)for(var b in E="",i.tags)E+='<span class="tagSpan">'+i.tags[b]+"</span>";g+=addDeviceAttribute("Tags",0!=(4&s)?"<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>"+E+' <img class=hoverButton src="images/link5.png" /></span>':E),g+="</table><br />",0!=(76&s)&&(g+='<input type=button value="동작" title="장치에서 전원 작업 수행" onclick=deviceActionFunction() />'),g+='<input type=button value="메모" title="이 장치에 대한 메모 보기" onclick=showNotes('+(0==(128&s))+',"'+encodeURIComponentEx(i._id)+'") />',g+='<input type=button value="로그 이벤트" title="이 기기에 대한 이벤트 작성" onclick=writeDeviceEvent("'+encodeURIComponentEx(i._id)+'") />',1&M&&8&s&&(g+='<input type=button value="메시지" title="Display a text message on the remote device" onclick=deviceMessageFunction() />'),QH("p10html",g),masterUpdate(256);var T=4294967295==s||0==(65536&s),A=4294967295==s||0==(512&s),_=4294967295==s||0==(1024&s),N=4294967295==s||0==(2048&s);g='<div class="p10html3right">',0!=(4&s)&&(g+='&nbsp;<a href=# onclick=p10showChangeGroupDialog(["'+i._id+'"]) title="이 장치를 다른 장치 그룹으로 이동">그룹 변경</a>',g+='&nbsp;<a href=# onclick=p10showDeleteNodeDialog("'+i._id+'") title="이 장치 제거">장치 삭제</a>'),g+='</div><div class="p10html3left">',i.agent&&(g+='<a href=# onclick=p10showNodeNetInfoDialog("'+i._id+'") title="장치 네트워크 인터페이스 정보 표시">인터페이스</a>&nbsp;'),32768&features&&null!=xxmap&&(g+='<a href=# onclick=p10showNodeLocationDialog("'+i._id+'") title="장치 위치정보 표시">위치</a>&nbsp;'),4294967295!=userinfo.siteadmin&&0!=(128&userinfo.siteadmin)||A&&0!=(8&s)&&null!=i.agent&&(g+='<a href=# onclick=p10showMeshCmdDialog(1,"'+i._id+'") title="이 서버를 통해 장치에 연결하는데 사용되는 트래픽 라우터.">MeshCmd</a>&nbsp;'),0!==args.xterm||!i.agent||0==(2&i.agent.caps)||0==(8&s)||4294967295!=s&&0!=(512&s)||(g+='<a href=# onclick=p10openxterm(event,"'+i._id+'") title="XTerm 터미널 열기">XTerm</a>&nbsp;'),0!=(1&M)&&1==clickOnce&&i.agent&&0!=(8&s)&&(0<i.agent.id&&i.agent.id<5&&(g+='<a href=# cmenu=altPortContextMenu id=rdpClickOnceLink onclick=p10clickOnce("'+i._id+'","RDP2") title="브라우저에서 Microsoft ClickOnce 지원 필요.">RDP</a>&nbsp;'),4<i.agent.id&&(g+='<a href=# onclick=p10clickOnce("'+i._id+'","PSSH",22) title="브라우저에서 Microsoft ClickOnce 지원이 필요합니다.">Putty</a>&nbsp;',g+='<a href=# onclick=p10clickOnce("'+i._id+'","WSCP",22) title="브라우저에서 Microsoft ClickOnce 지원이 필요합니다.">WinSCP</a>&nbsp;')),0!=(1&M)&&i.agent&&0!=(8&s)&&0==(536870912&features)&&(g+='<a href=# cmenu=rfbPortContextMenu id=rfbLink onclick=p10rfb("'+i._id+'") title="Launch noVNC session to this device.">noVNC</a>&nbsp;'),0!=(1&M)&&i.agent&&0!=(8&s)&&0==(1073741824&features)&&(g+='<a href=# cmenu=rfbPortContextMenu id=mstscLink onclick=p10mstsc("'+i._id+'") title="Launch web-based RDP session to this device.">Web-RDP</a>&nbsp;'),4294967295==s&&4194304&features&&(g+='<a href=# onclick=p10showMqttLoginDialog("'+i._id+'") title="이 장치의 MQTT 로그인 자격 증명을 가져옵니다.">MQTT 로그인</a>&nbsp;'),g+="</div><br>",QH("p10html3",g);var I=PowerStateStr(i.state);0!=(1&M)&&(0<I.length&&(I+="<br/>"),I+='<span style=font-size:12px title="에이전트가 연결되었습니다.">에이전트가 연결되었습니다.</span>'),0!=(2&M)?(0<I.length&&(I+="<br/>"),I+='<span style=font-size:12px title="Intel&reg; AMT 연결">Intel&reg; AMT 연결</span>'):0!=(4&M)&&(0<I.length&&(I+="<br/>"),I+='<span style=font-size:12px title="Intel&reg; AMT 감지">Intel&reg; AMT 감지</span>'),0!=(16&M)&&(0<I.length&&(I+="<br/>"),I+='<span style=font-size:12px title="MQTT 연결">MQTT 채널 연결</span>'),""==I&&i.lastconnect&&(I="<span style=font-size:12px>마지막으로 본 :<br />"+printDateTime(new Date(i.lastconnect))+"</span>"),QH("MainComputerState",I),Q("MainComputerImage").setAttribute("src","images/icons256-"+i.icon+"-1.png"),Q("MainComputerImage").className=i.conn&&0!=i.conn?"":"gray",A&&setupTerminal(),_&&setupFiles();var U=0!=(16&s);U?setupConsole():15==t&&(t=10),QV("MainDevDesktop",T&&(null==i.agent&&("number"!=typeof i.intelamt.sku||0!=(8&i.intelamt.sku))||null!=i.agent&&(null==i.agent.caps||0!=(1&i.agent.caps)||i.intelamt&&2==i.intelamt.state))&&(8&s||256&s)),QV("MainDevTerminal",(null==i.agent&&null!=i.intelamt||null==i.agent.caps||0!=(2&i.agent.caps)||i.intelamt&&2==i.intelamt.state)&&8&s&&A),QV("MainDevFiles",null!=i.agent&&null!=i.agent.caps&&0!=(4&i.agent.caps)&&8&s&&_),QV("MainDevAmt",null!=i.intelamt&&(2==i.intelamt.state||2&i.conn)&&8&s&&N),QV("MainDevConsole",U&&null!=i.agent&&null!=i.agent.caps&&0!=(8&i.agent.caps)&&8&s),QV("MainDevPlugins",!1),QV("p15uploadCore",null!=i.agent&&null!=i.agent.caps&&0!=(16&i.agent.caps)),QH("p15coreName",null!=i.agent&&null!=i.agent.core?i.agent.core:"");var V=Q("p14iframe").contentWindow.getCurrentMeshNode();null!=V&&V._id!=currentNode._id&&Q("p14iframe").contentWindow.disconnect();var H=0!=(6&i.conn);if(Q("p14iframe").contentWindow.setConnectionState(H),Q("p14iframe").contentWindow.setFrameHeight("650px"),Q("p14iframe").contentWindow.setAuthCallback(updateAmtCredentials),QV("deskActionsBtn",0!=(72&s)),QV("termActionsBtn",0!=(72&s)),QV("filesActionsBtn",0!=(72&s)),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+(a?" - "+a.name:"")+" - "+decodeURIComponent("{{{extitle}}}"):decodeURIComponent("{{{extitle}}}"),r&&(p11clearConsoleMsg(),p12clearConsoleMsg(),p13clearConsoleMsg()),null!=pluginHandler){QH("p19headers",""),QH("p19pages",""),pluginHandler.callHook("onDeviceRefreshEnd",e,t,n,o);var R=getstore("_curPluginPage",null);null!=R&&null!=Q("p19ph-"+R)&&pluginHandler.callPluginPage(R,Q("p19ph-"+R))}if(g="",7&s&&(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> 사용자 추가</a>',null!=usergroups)){var F=0,P=!1;for(var b in usergroups)usergroups[b]._id.split("/")[1]==e.split("/")[1]&&(F++,null!=currentNode.links&&null!=currentNode.links[b]||(P=!0));0<F&&P&&(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> 사용자 그룹 추가</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>사용자 인증</th><th scope=col style=text-align:left></th></tr>';var B=1;if(null!=currentNode.links){var L=[];for(var b in currentNode.links)(b.startsWith("user/")||b.startsWith("ugrp/"))&&L.push(b);for(var b in L.sort(),L){var O="",G="",z=L[b],W=currentNode.links[z].rights,K=EscapeHtml(z.split("/")[2]),j=(G=makeUserDeviceRightsString(W),!1);null!=users&&null!=users[z]&&(K=EscapeHtml(users[z].name)),null!=usergroups&&null!=usergroups[z]&&(K=EscapeHtml(usergroups[z].name),j=!0),0!=(2&s)&&(G=j?(O="<a href=# onclick='return p30removeUserFromNode(event,\""+encodeURIComponentEx(z)+'")\' title="이 장치 그룹에 대한 사용자 그룹 권한 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>','<span style=cursor:pointer onclick=p20showAddMeshUserDialog(6,"'+encodeURIComponentEx(z)+'")>'+G+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>"):(O="<a href=# onclick='return p30removeUserFromNode(event,\""+encodeURIComponentEx(z)+'")\' title="이 장치 그룹에 대한 사용자 권한 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>','<span style=cursor:pointer onclick=p20showAddMeshUserDialog(5,"'+encodeURIComponentEx(z)+'")>'+G+" <img class=hoverButton style=cursor:pointer src=images/link5.png></span>")),null!=users&&(K=j?"<a href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(z)+"\");haltEvent(event);'>"+K+"</a>":"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(z)+"\");haltEvent(event);'>"+K+"</a>"),g+="<tr "+(++B%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="'+(j?"사용자 그룹":"사용자")+'" class=m'+(j?4:2)+"></div><div>&nbsp;"+K+"<div></div></div></td><td style=width:70%><div style=float:right>"+O+"</div><div>"+G+"</div></td></tr>"}}1==B&&(g+="<tr><td><div style=padding:6px>&nbsp;<i>이 장치에 대해서 특별한 장치 권한을 가진 사용자가 없습니다.</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 b in q="?viewmode="+xxcurrentView+"&gotonode="+currentNode._id.split("/")[2],urlargs)q+="&"+b+"="+urlargs[b];try{window.history.replaceState({},document.title,window.location.pathname+q)}catch(e){}}}setupDesktop(),go(t=t||10)}}else setDialogMode(2,"계정 보안",1,null,'이메일 주소가 확인 될 때까지 장치에 액세스 할 수 없습니다. 이것은 비밀번호 복구에 필요합니다. 이메일 주소를 변경하고 확인하려면 "내 계정" 탭으로 이동하십시오.')}function makeUserDeviceRightsString(e){if(57592==e)return"모든 장치 권한";var t=[];if(8&e){var n=[];256&e&&n.push("입력 장치가 없습니다."),512&e&&n.push("터미널이 없습니다."),1024&e&&n.push("파일이 없습니다."),2048&e&&n.push("AMT가 없습니다."),4096&e&&n.push("제한된 입력"),65536&e&&n.push("데스크톱 없음"),0<n.length?t.push("Control ("+n.join(", ")+")"):t.push("컨트롤")}return 16&e&&t.push("콘솔"),32&e&&t.push("서버 파일"),64&e&&t.push("깨우기(Wake)"),128&e&&t.push("메모"),8192&e&&t.push("이벤트 제한"),16384&e&&t.push("채팅"),32768&e&&t.push("설치 제거"),0==t.length?"권한이 없습니다.":t.join(", ")}function makeDeviceGroupRightsString(e){if(4294967295==e)return"모든 권한";var t=[];if(1&e&&t.push("그룹 편집"),2&e&&t.push("사용자 관리"),4&e&&t.push("장치 관리"),8&e){var n=[];256&e&&n.push("입력 장치가 없습니다."),512&e&&n.push("터미널이 없습니다."),1024&e&&n.push("파일이 없습니다."),2048&e&&n.push("AMT가 없습니다."),4096&e&&n.push("제한된 입력"),65536&e&&n.push("데스크톱 없음"),0<n.length?t.push("Control ("+n.join(", ")+")"):t.push("컨트롤")}return 16&e&&t.push("콘솔"),32&e&&t.push("서버 파일"),64&e&&t.push("깨우기(Wake)"),128&e&&t.push("메모"),8192&e&&t.push("이벤트 제한"),16384&e&&t.push("채팅"),32768&e&&t.push("설치 제거"),0==t.length?"권한이 없습니다.":t.join(", ")}function writeDeviceEvent(e){xxdialogMode||(setDialogMode(2,"장치 이벤트 추가",3,writeDeviceEventEx,"<textarea id=d2devEvent style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>이 장치의 이벤트 로그에 항목이 추가됩니다.<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,"메모",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>다른 장치 그룹 관리자가 장치 그룹 메모를 보고 변경할 수 있습니다.<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,"장치에서 페이지 열기",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,"장치 알림",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="이 장치에서 수행할 작업을 선택하십시오.<br /><br />",n="<select id=d2deviceop style=float:right;width:250px>";0!=(64&e)&&(n+="<option value=100>깨우기(Wake-up)</option>"),0!=(8&e)&&(n+="<option value=4>절전</option><option value=3>초기화</option><option value=2>전원 끄기</option>"),0!=(16&currentNode.conn)&&(n+="<option value=103>MQTT 메시지를 보냅니다.</option>"),0!=(1&currentNode.conn)&&0!=(32768&e)&&(n+="<option value=104>에이전트 제거</option>"),setDialogMode(2,"장치 동작",3,deviceActionFunctionEx,t+=addHtmlValue("조작",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 o=[];if(null!=e&&1<e.length){o.push([0,e[1],e[0]]);for(var i=e[1],a=2;a<e.length;a+=2){var s=e[a],r=t;e.length>a+1&&(r=e[a+1]),o.push([i,i+r,s]),i+=r}}var l="",d=1,c=new Date,u=Q("masthead").offsetWidth-192;c.setHours(0,0,0,0);for(a=0;a<7;a++){var p="",m=c.getTime(),g=m+864e5;for(var h in o){var v=o[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),x=Math.round((k-f)*u/864e5);if(0<x){var y=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="'+y+'" style="width:'+x+'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>일</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="전원 이벤트 로그 다운로드" src="images/link4.png" /></a>7일간 전원 상태</th></tr></thead><tbody>'+l+"</tbody></table>")}}function powerColor(e){return e<powerColorTable.length?powerColorTable[e]:"pwsYellow"}function isTimeBlockInside(e,t,n,o){return n<e&&t<o||(e<n&&n<t||e<o&&o<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 o="",i=getNodeFromId(e),a=3;0!=(4&GetNodeRights(i))&&(o+=addHtmlValue("사용자 이름",'<input id=dp10username style=width:230px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />'),o+=addHtmlValue("암호","<input id=dp10password type=password style=width:230px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />"),o+=addHtmlValue("보안","<select id=dp10tls style=width:236px><option value=0>TLS 보안이 없습니다.</option><option value=1>TLS 보안 필요</option></select>"),null!=i.intelamt.user&&""!=i.intelamt.user&&(a=7),setDialogMode(2,"Intel&reg; AMT 자격 증명 편집",a,editDeviceAmtSettingsEx,o,{node:i,func:t,arg:n}),null!=i.intelamt.user&&""!=i.intelamt.user?Q("dp10username").value=i.intelamt.user:Q("dp10username").value="admin",Q("dp10tls").value=i.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 o=Q("dp10password").value;""==o&&(n=""),meshserver.send({action:"changedevice",nodeid:t.node._id,intelamt:{user:n,pass:o,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("주제","<input id=dp2topic style=width:230px maxlength=64 onchange=p10validateSendMqttMsgDialog() onkeyup=p10validateSendMqttMsgDialog(event,1) />");return setDialogMode(2,"MQTT 메시지를 보냅니다.",3,p10showSendMqttMsgDialogEx,t+=addHtmlValue("메시지","<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("선택한 {0} 에이전트를 제거하시겠습니까?",e.length):"선택한 에이전트를 제거하시겠습니까?",t+="<br /><br />",1<e.length?t+="이렇게 하면 서버에서 장치가 제거되지 않지만, 장치는 더 이상 서버에 연결할 수 없습니다. 장치에 대한 모든 원격 액세스가 손실됩니다. 이 명령이 작동하려면 장치가 연결되어 있어야합니다.":t+="이렇게 하면 서버에서 이 장치가 제거되지 않지만 장치는 더 이상 서버에 연결할 수 없습니다. 장치에 대한 모든 원격 액세스가 손실됩니다. 이 명령이 작동하려면 장치가 연결되어 있어야합니다.",setDialogMode(2,"에이전트 제거",3,p10showSendUninstallAgentDialogEx,t+="<br /><br /><label style=color:red><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />확인</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>",o=0;for(var i in meshes){var a=GetMeshRights(i);meshes[i]._id!=t&&4&a&&(o++,n+="<option value='"+meshes[i]._id+"'>"+meshes[i].name+"</option>")}if(n+="</select>",0<o){var s=1==e.length?"이 기기에 대한 새 그룹을 선택하십시오.<br /><br />":"선택한 장치에 대한 새 그룹을 선택하십시오.<br /><br />";setDialogMode(2,"그룹 변경",3,p10showChangeGroupDialogEx,s+=addHtmlValue("새 장치 그룹",n),e)}else setDialogMode(2,"그룹 변경",1,null,"동일한 유형의 다른 장치 그룹이 없습니다.");return!1}function p10showChangeGroupDialogEx(e,t){meshserver.send({action:"changeDeviceMesh",nodeids:t,meshid:Q("p10newGroup").value}),uncheckAllDevices()}function p10showDeleteNodeDialog(e){return xxdialogMode||(setDialogMode(2,"기기 삭제",3,p10showDeleteNodeDialogEx,format("{0} 기기를 삭제하시겠습니까?",EscapeHtml(currentNode.name))+"<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />확인</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 o in t)if(null!=currentNode[t[o]]){var i=currentNode[t[o]].split(","),a=parseFloat(i[0]),s=parseFloat(i[1]);if(a<90&&-90<a&&s<180&&-180<s){var r=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([s,a]))});r.setStyle(markerStyle(currentNode,parseInt(o)+1)),e.push(r),null==n?n=[a,s,a,s,0]:(a<n[0]&&(n[0]=a),s<n[1]&&(n[1]=s),a>n[2]&&(n[2]=a),s>n[3]&&(n[3]=s))}}var l=new ol.source.Vector({features:e}),d=new ol.layer.Vector({source:l});setDialogMode(2,"장치 위치",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,"네트워크 인터페이스",1,null,"<div id=d2netinfo>불러오는 중 ...</div>","if"+currentNode._id),meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id})),!1}function p10showMeshRouterDialog(){if(!xxdialogMode){var e="<div>MeshCentral Router는 TCP 포트 매핑을 위한 Windows 도구입니다. 예를 들어 이 서버를 통해 원격 장치로 RDP를 수행 할 수 있습니다.</div><br />";e+=addHtmlValue("실행 가능한 Win32",'<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 라우터",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",o=getNodeFromId(t);if(null!=o)return 0<=[1,2,3,4,21,22].indexOf(o.agent.id)?n+="&os=win":n+="&os=linux",window.open(n,"xterm:"+t),!1}function p10showMeshCmdDialog(e,t){if(!xxdialogMode){"<option value=3>Windows (32비트)</option>","<option value=4>Windows (64비트)</option>","<option value=5>Linux x86 (32비트)</option>","<option value=6>Linux x86 (64비트)</option>","<option value=16>MacOS (64비트)</option>","<option value=25>Linux ARM, Raspberry Pi (32비트)</option>","</select>";var n="";0==e&&(n+="<div>MeshCmd는 다양한 작업을 수행하는 명령 줄 도구입니다. 옵션으로, 서버에게 정보와 자격 증명을 전달하기 위해 Action 파일을 다운로드하고 편집할 수 있습니다.<br /><br />"),1==e&&(n+='<div>이 서버를 통해 이 장치로 트래픽을 라우팅 하려면, 작업 파일과 함께 "meshcmd"를 다운로드하십시오. meshaction.txt를 편집하고 계정 비밀번호를 추가하거나 필요한 사항을 변경하십시오.<br /><br />'),n+=addHtmlValue("운영체제","<select id=aginsSelect onclick=meshCmdOsClick() style=width:236px><option value=3>Windows (32비트)</option><option value=4>Windows (64비트)</option><option value=5>Linux x86 (32비트)</option><option value=6>Linux x86 (64비트)</option><option value=16>MacOS (64비트)</option><option value=25>Linux ARM, Raspberry Pi (32비트)</option></select>"),n+=addHtmlValue("MeshCmd",'<a id=meshcmddownloadid href="meshagents?meshcmd=3'+(urlargs.key?"&key="+urlargs.key:"")+'" download></a>'),0==e&&(n+=addHtmlValue("동작 정의 파일",'<a href="meshagents?meshaction=generic'+(urlargs.key?"&key="+urlargs.key:"")+'" download>MeshAction (.txt)</a>')),1==e&&(n+=addHtmlValue("동작 정의 파일",'<a href="meshagents?meshaction=route&nodeid='+t+(urlargs.key?"&key="+urlargs.key:"")+'" download>MeshAction (.txt)</a>')),setDialogMode(2,"MeshCmd 다운로드",9,null,n+="</div>","fileDownload"),meshCmdOsClick()}}function meshCmdOsClick(){var e=Q("aginsSelect").value,t="";3==e&&(t="MeshCmd (Win32 실행파일)"),4==e&&(t="MeshCmd (Win64 실행파일)"),5==e&&(t="MeshCmd (Linux x86, 32비트)"),6==e&&(t="MeshCmd (Linux x86, 64비트)"),16==e&&(t="MeshCmd (MacOS, 64비트)"),25==e&&(t="MeshCmd (Linux ARM, 32비트)"),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,"아이콘 선택",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=["장치 이름","호스트 이름","설명","태그"],showEditNodeValueDialog_modes2=["name","host","desc","tags"],showEditNodeValueDialog_modes3=["","","","Tag1, Tag2, Tag3"];function showEditNodeValueDialog(e){if(!xxdialogMode){setDialogMode(2,"장치 편집",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),o=0!=(1&currentNode.conn);QE("connectbutton1",o);var i=0!=(6&currentNode.conn);QE("connectbutton1h",i),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&&o),QV("DeskNotifyButton",0!=(16384&t)&&0==browserfullscreen&&currentNode.agent&&currentNode.agent.id<5&&n&&currentNode.agent&&o),QV("DeskToolsButton",n&&currentNode.agent&&o),QV("DeskOpenWebButton",0==browserfullscreen&&n&&currentNode.agent&&o),QV("DeskBackgroundButton",3==e&&1==desktop.contype&&currentNode.agent&&11!=currentNode.agent.id&&16!=currentNode.agent.id&&o),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==o&&QV("DeskTools",!1)}var autoConnectDesktopTimer=null;function autoConnectDesktop(e){autoConnectDesktopTimer=null==autoConnectDesktopTimer?setInterval(function(){connectDesktop(null,1)},1e3):(clearInterval(autoConnectDesktopTimer),null)}var agentConsoleMessages=["","사용자가 액세스 권한을 부여하기를 기다리는 중 ...","거부","원격 터미널 세션을 시작하지 못했습니다 : {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,o){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("데이터 채널",{}),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!=o&&(desktop.options.consent=o),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:o});else desktop.Stop(),webRtcDesktopReset(),desktopNode=desktop=null,null!=pluginHandler&&pluginHandler.callHook("onDesktopDisconnect")}function updateMetadata(e,t){var n="",o=0;if(e&&3==e.State){if(e.metadata&&e.metadata.users)for(var i in e.metadata.users)o+=e.metadata.users[i];1<o&&(n="<span onclick=showSessionMetadata(1) style=cursor:pointer>"+format(", {0} watching",o)+"</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 o in t.metadata.users){var i=1==t.metadata.users[o]?"1 connection":format("{0} connections",t.metadata.users[o]),a=o.split("/")[2];null!=users&&null!=users[o]&&(a=users[o].name),n+=addHtmlValue4(format('User "{0}"',a),i)}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 o=StatusStrs[n];switch(null!=desktop&&1==desktop.webRtcActive&&(o+=", WebRTC"),QH("deskstatus",o),t){case 0:null!=desktop.m.recordedData&&deskRecordSession(),desktop.Stop(),desktopNode=desktop=null,QV("DeskFocus",!1),QV("termdisplays",!1),QV("deskRecordIcon",!1),deskFocusBtn.value="모든 초점",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,"원격 데스크톱 설정",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="모든 초점"),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 o=(1&n?0:66)+(2&n?0:24)+(4&n?0:45)+(8&n?0:60);QS("deskarea3x").height="calc(100vh - "+(75+o)+"px)",QS("deskarea3x")["max-height"]="calc(100vh - "+(75+o)+"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+o)+"px)",QS("termTable")["max-height"]="calc(100vh - "+(75+o)+"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=["모든 초점","작은 초점","큰 초점"][desktop.m.focusmode/64]}function deskAdjust(){var e=Q("DeskParent").clientHeight,t=Q("DeskParent").clientWidth,n=Q("Desk").height,o=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=o+"px",QS("DeskParent").overflow="scroll";else{if(n/o<e/t){var i=n*t/o+"px";QS("Desk").height=i,QS("Desk").width="100%"}else{var a=o*e/n+"px";QS("Desk").height=webPageFullScreen||fullscreen?null:"100%",QS("Desk").width=a}QS("Desk")["margin-top"]=null,QS("DeskParent").overflow="hidden"}}function mdeskAdjust(e,t,n,o){if(e&&t&&n&&o)if("Desk"!=o.id){var i=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex],a=i.x+2,s=Q("xdevices").clientWidth-30,r=Math.floor(s/a);r=a+Math.floor((s-r*a)/r),i.y=i.y*(r/i.x),i.x=r;var l=i.y,d=i.x;0!=e.State&&(l=i.y,d=t/n*i.y),QS(o.id)["max-height"]=l+"px",QS(o.id)["max-width"]=d+"px",QS(o.id)["margin-top"]="0",QS(o.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,"원격 키보드 입력",3,showDeskTypeEx,'<div>텍스트를 입력하고 확인을 클릭하여 미국 영어 키보드를 사용하여 원격으로 입력하십시오. 계속하기 전에 원격 커서를 올바른 위치에 놓으십시오.<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=[],o=!1;if(2==desktop.contype){for(var i in e){var a=e.charCodeAt(i);n.push([a,1],[a,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 i in e){a=e.charCodeAt(i);var s=t.charCodeAt(i);65<=a&&a<=90||97<=a&&a<=122?(a==s&&0==o&&(n.push([desktop.m.KeyAction.DOWN,16]),o=!0),a!=s&&1==o&&(n.push([desktop.m.KeyAction.UP,16]),o=!1)):48<=a&&a<=57?1==o&&(n.push([desktop.m.KeyAction.UP,16]),o=!1):DeskTypeTranslate[a]?(1==o&&(n.push([desktop.m.KeyAction.UP,16]),o=!1),s=DeskTypeTranslate[a]):DeskTypeShiftTranslate[a]&&(0==o&&(n.push([desktop.m.KeyAction.DOWN,16]),o=!0),s=DeskTypeShiftTranslate[a]),n.push([desktop.m.KeyAction.DOWN,s],[desktop.m.KeyAction.UP,s])}1==o&&(n.push([desktop.m.KeyAction.UP,16]),o=!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>원격 클립보드는 60 초 동안 유효합니다.</span>&nbsp;</div><div></div>',setDialogMode(2,"원격 클립보드",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>원격 클립보드는 60 초 동안 유효합니다.</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 o in n)t.push({p:parseInt(o),c:n[o].cmd,d:n[o].cmd.toLowerCase(),u:n[o].user});0==deskTools.sort?t.sort(sortProcessPid):1==deskTools.sort&&t.sort(sortProcessName);var i="";for(var a in t)if(0!=t[a].p){var s=t[a].c;30<s.length&&(s='<span title="'+s+'">'+s.substring(0,30)+"...</span>"),i+="<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>"+t[a].p+'</div><a href=# style=float:right;padding-right:5px;cursor:pointer title="프로세스 중지" onclick=\'return stopProcess('+t[a].p+',"'+t[a].c+'")\'><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>'+(t[a].u?t[a].u:"")+"</div><div>"+s+"</div></div>"}QH("DeskToolsProcesses",i)}}}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 o in n)n[o].status?t.push({p:capitalizeFirstLetter(n[o].status.state.toLowerCase()),d:n[o].displayName,i:o}):n[o].serviceType&&t.push({p:n[o].serviceType,d:n[o].name,i:o});0==deskTools.ssort?t.sort(sortProcessPid):1==deskTools.ssort&&t.sort(sortProcessName);var i="";for(var o in t)if(0!=t[o].p){var a=t[o].d;30<a.length&&(a='<span title="'+a+'">'+a.substring(0,30)+"...</span>"),i+="<div onclick=showServiceDetailsDialog("+t[o].i+") class=deskToolsBar><div style=width:70px;float:left;padding-right:5px>"+t[o].p+"</div><div>"+a+"</div></div>"}QH("DeskToolsServices",i)}}}else QH("DeskToolsProcesses","")}function showServiceDetailsDialog(e){if(!xxdialogMode){var t=deskTools.services[e];if(null!=t){var n="";if(t.name&&(n+=addHtmlValue("이름",t.name)),t.displayName&&(n+=addHtmlValue("이름 표시하기",t.displayName)),t.status){t.status.state&&(n+=addHtmlValue("상태",capitalizeFirstLetter(t.status.state.toLowerCase()))),t.status.pid&&(n+=addHtmlValue("PID",t.status.pid));var o=[];!0===t.status.isFileSystemDriver&&o.push("FileSystemDriver"),!0===t.status.isInteractive&&o.push("대화식"),!0===t.status.isKernelDriver&&o.push("커널 드라이버"),!0===t.status.isOwnProcess&&o.push("자기 프로세스"),!0===t.status.isSharedProcess&&o.push("공유 프로세스"),0<o.length&&(n+=addHtmlValue("유형",o.join(", ")))}setDialogMode(2,"서비스 내용",8,null,n+='<br/><div style=float:right;margin-bottom:12px><input type=button value="닫기" onclick=showServiceDetailsDialogEx(0,'+e+')></div><div style=margin-bottom:12px><input type=button value="시작" onclick=showServiceDetailsDialogEx(1,'+e+')><input type=button value="중지" onclick=showServiceDetailsDialogEx(2,'+e+')><input type=button value="재시작" 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 o=0,i="";for(var a in t)o++,i+="<option"+(n==a?" selected":"")+" value="+a+">"+t[a]+"</option>",deskPreferedStickyDisplay==a&&n!=deskPreferedStickyDisplay&&desktop.m.SetDisplay(a),deskPreferedStickyDisplay=-1;QH("termdisplays",i),QV("termdisplays",1<o)}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,"프로세스 제어",3,stopProcessEx,format('프로세스 #{0} "{1}"를 중지 하시겠습니까?',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 o=!(0===args.xterm||null!=terminal&&null==xterm);QV("termarea3xdiv",o),QV("Term",!o),QV("bsbutton",!o),QV("pastebutton",!o),QV("devListToolbarViewIcons2",o),QE("termSizeList",null==terminal)}function onTerminalStateChange(e,t){var n=t;3==n&&2==e.contype&&n++;var o=StatusStrs[n];switch(1==terminal.webRtcActive&&(o+=", WebRTC"),QH("termstatus",o),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 o={};1==Q("termSizeList").value?(o.cols=80,o.rows=25):2==Q("termSizeList").value&&(o.cols=100,o.rows=30),fullscreen&&deskToggleFull(),QV("termarea3xdiv",!1),QV("Term",!0),(terminal=CreateAmtRedirect(CreateAmtRemoteTerminal("Term",o),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{o={protocol:null!=n&&"number"==typeof n.protocol?n.protocol:1};n&&n.requireLogin&&(o.requireLogin=!0),-1==[1,2,3,4,21,22].indexOf(currentNode.agent.id)&&(1==Q("termSizeList").value?(o.cols=80,o.rows=25,o.xterm=!0):2==Q("termSizeList").value?(o.cols=100,o.rows=30,o.xterm=!0):3==Q("termSizeList").value&&(o.cols=Math.floor((Q("column_l").clientWidth-60)/10),o.rows=Math.floor((Q("column_l").clientHeight-120)/20),o.xterm=!0)),e&&1==e.shiftKey&&(4<currentNode.agent.id?1==o.protocol&&(o.protocol=7):1==o.protocol&&(o.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",o),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).options=o,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 터미널","확장 ASCII","인텔 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=["인텔 (F10 = ESC + [OM)","대체 (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,"붙여넣기",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?"연결":"연결 해제";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,"\\"),o=p13targetpath.replace(/\//g,"\\");0<n.length&&"\\"==n[0];)n=n.substring(1);for(;0<o.length&&"\\"==o[0];)o=o.substring(1);(n==o||"\\"==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="",o='<a href=# style=cursor:pointer onclick="return p13folderup(0)">최상위폴더</a>',i=p13filetree.path.split("\\");for(var a in p13filetreelocation=[],i)""!=i[a]&&p13filetreelocation.push(i[a]);for(var a in p13filetreelocation)o+=' / <a href=# style=cursor:pointer onclick="return p13folderup('+(parseInt(a)+1)+')">'+p13filetreelocation[a]+"</a>";var s=p13filetreelocation.join("/"),r=p13sort_files(p13filetree.dir);for(var a in r){var l,d=r[a],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(s+"/"+c)+"','"+encodeURIComponentEx(c)+"',"+d.s+')">'+l+"</a>"),m="<div id=fileEntry cmenu=filesContextMenu fileIndex="+a+" 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",o),QE("p13FolderUp",0!=p13filetreelocation.length),null!=e){var h=document.getElementsByName("fd");for(a=0;a<h.length;a++)0<=e.indexOf(p13filetree.dir[h[a].value].n)&&(h[a].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 o in e)e[o].nx=o,null==e[o].s&&(e[o].s=0),null==e[o].n&&(e[o].n=o),e[o].ln=e[o].n.toLowerCase(),t.push(e[o]);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="모두 선택",QE("p13RefreshButton",!1),QE("p13CutButton",!1),QE("p13CopyButton",!1),QE("p13PasteButton",!1);else{var e=p13getFileSelCount(),t=p13getFileCount(),n=p13getFileSelCount(!1),o=0<currentNode.agent.id&&currentNode.agent.id<5;QE("p13DeleteFileButton",0<e&&(0<p13filetreelocation.length||0==o)),QE("p13NewFolderButton",0<p13filetreelocation.length||0==o),QE("p13UploadButton",0<p13filetreelocation.length||0==o),QE("p13RenameFileButton",1==e&&(0<p13filetreelocation.length||0==o)),QE("p13ViewFileButton",1==e&&1==n&&(0<p13filetreelocation.length||0==o)),QE("p13SelectAllButton",0<t),Q("p13SelectAllButton").value=0<e?"선택하지 않음":"모두 선택",QE("p13RefreshButton",!0),QE("p13CutButton",0<e&&e==n&&(0<p13filetreelocation.length||0==o)),QE("p13CopyButton",0<e&&e==n&&(0<p13filetreelocation.length||0==o)),QE("p13PasteButton",(0<p13filetreelocation.length||0==o)&&null!=p13clipboard&&0<p13clipboard.length)}}function p13getFileSelCount(e){for(var t=0,n=document.getElementsByName("fd"),o=0;o<n.length;o++)!n[o].checked||0==e&&"3"!=n[o].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,"새 폴더",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>재귀 삭제</label><br>":"<input type=checkbox id=p13recdeleteinput style='display:none'>";setDialogMode(2,"삭제",3,p13deletefileEx,1<e?format("선택한 항목 {0}을 삭제하시겠습니까?",e)+t:"선택한 항목을 삭제 하시겠습니까?"+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,"이름 바꾸기",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,"파일 업로드",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("파일 편집기","200k 미만의 파일만 편집 할 수 있습니다.");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("{0} 항목을 이 위치로 복사하시겠습니까?",p13clipboard.length):format("1개의 항목을 이 위치로 복사하시겠습니까?"):1<p13clipboard.length?format("{0} 항목들을 이 위치로 이동하시겠습니까?",p13clipboard.length):format("이 위치로 1개 항목을 이동하시겠습니까?")),setDialogMode(2,"붙여넣기",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('복사할 {0} 항목 보유, <a href=# onclick="return p13clearClip()" style=cursor:pointer>지우기</a>.',p13clipboard.length):format('1개 복사 항목 보유, <a href=# onclick="return p13clearClip()" style=cursor:pointer>지우기</a>.'):1<p13clipboard.length?format('이동할 {0} 항목 보유, <a href=# onclick="return p13clearClip()" style=cursor:pointer>지우기</a>.',p13clipboard.length):format('1개 이동 항목 보유, <a href=# onclick="return p13clearClip()" style=cursor:pointer>지우기</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,o){xxdialogMode||downloadFile||!files||(downloadFile={path:decodeURIComponent(e),file:decodeURIComponent(t),size:n,tsize:0,data:"",state:0,id:Math.random(),tag:o},files.sendText({action:"download",sub:"start",id:downloadFile.id,path:downloadFile.path}),setDialogMode(2,"파일 다운로드",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=["Wrap: ON","Wrap: OFF"][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=["크기 : 100 %","크기 : 125 %","크기 : 150 %","크기 : 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=[],o=0;for(var i in p13filetree.dir)t?n.push(p13filetree.dir[i].n.toLowerCase()):n.push(p13filetree.dir[i].n);for(i=0;i<e.length;i++)t?0<=n.indexOf(e[i].name.toLowerCase())&&o++:0<=n.indexOf(e[i].name)&&o++;0==o?p13uploadFileContinue(1,e):setDialogMode(2,"파일 업로드",3,p13uploadFileContinue,format(1==o?"업로드하면 파일 1개를 덮어씁니다. 계속할까요?":"업로드하면 {0} 파일을 덮어씁니다. 계속할까요?",o),e)}}function p13uploadFileContinue(e,t){(uploadFile={}).xpath=p13filetreelocation.join("/"),uploadFile.xfiles=t,uploadFile.xfilePtr=-1,setDialogMode(2,"파일 업로드",10,p13uploadFileCancel,"<div id=p13dfileName>연결 중 ...</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,o=uploadFile.xptr+4096;if(o>t.byteLength){if(1==e)return;o=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 i=t.slice(n,o);uploadFile.ws.send(i),uploadFile.xptr=o,Q("d2progressBar").value=o}}var currentDeviceEvents=null;function deviceEventsUpdate(){var e="",t=null;for(var n in currentDeviceEvents){var o=currentDeviceEvents[n],i=new Date(o.time);if(o.msg){null==o.h&&(o.h=Math.random()),printDate(i)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(i))+"</td></tr>");var a="si3";"user"==o.etype&&(a="m2"),"server"==o.etype&&(a="si3");var s=EscapeHtml(o.msg).split("(R)").join("&reg;");o.username&&(s=2&userinfo.siteadmin&&o.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(o.userid)+"\");haltEvent(event);'>"+EscapeHtml(o.username)+"</a> &rarr; "+s:EscapeHtml(o.username)+" &rarr; "+s),"relay"!=o.etype&&"relaylog"!=o.action||(a="relayIcon16"),e+="<tr onclick=showEventDetails("+o.h+",1) onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+a+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(i)+" - "+s+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>이벤트가 없습니다.</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,o;for(var i in 1==t&&(n=currentDeviceEvents),2==t&&(n=events),3==t&&(n=currentUserEvents),n)if(n[i].h==e){o=n[i];break}if(o){if(xxdialogMode)return!1;var a="<div style=overflow-y:auto>";for(var i in o)"h"!=i&&"_id"!=i&&"ids"!=i&&"domain"!=i&&null!=o[i]&&"object"!=typeof o[i]&&(a+=addHtmlValue3(EscapeHtml(i),EscapeHtml(o[i])));setDialogMode(2,"상세 이벤트 내역",9,null,a+="</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 o=[],i={};if(t.windows&&t.windows.osinfo||e.osdesc){var a="";if(e.rname&&(a+=addDetailItem("이름",EscapeHtml(e.rname),i)),e.osdesc&&(a+=addDetailItem("버전",EscapeHtml(e.osdesc),i)),t.windows&&t.windows.osinfo)(d=t.windows.osinfo).OSArchitecture&&(a+=addDetailItem("구조",EscapeHtml(d.OSArchitecture),i));""!=a&&o.push({name:"운영체제",html:a,img:"software64.png"})}if(e.agent){a="";if(null!=e.agent&&null!=e.agent.id&&null!=e.agent.ver){var s="";s=e.agent.id<=agentsStr.length?agentsStr[e.agent.id]:agentsStr[0],0!=e.agent.ver&&(s+=" v"+e.agent.ver),a+=addDetailItem("메시 에이전트",s)}if(0!=(1&e.conn)?a+=addDetailItem("마지막 에이전트 연결","지금 연결됨"):e.lastconnect&&(a+=addDetailItem("마지막 에이전트 연결",printDateTime(new Date(e.lastconnect)))),e.lastaddr){var r=e.lastaddr.split(":");2<r.length?a+=addDetailItem("마지막 에이전트 주소",e.lastaddr):isPrivateIP(e.lastaddr)?a+=addDetailItem("마지막 에이전트 주소",r[0]):a+=addDetailItem("마지막 에이전트 주소",'<a href="https://iplocation.com/?ip='+r[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+r[0]+"</a>")}""!=a&&o.push({name:"메시 에이전트",html:a,img:"meshagent64.png"})}if(null!=n.netif){a="";for(var l in a+="<table style=width:100%>",n.netif){var d=n.netif[l];a+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",a+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.name+(d.dnssuffix?", "+d.dnssuffix:""))+"</b></div>",d.desc&&(a+=addDetailItem("설명",EscapeHtml(d.desc).split("(R)").join("&reg;"))),d.mac&&(d.gatewaymac?a+=addDetailItem("MAC 계층",format("MAC : {0}, 게이트웨이 : {1}",EscapeHtml(d.mac),EscapeHtml(d.gatewaymac))):a+=addDetailItem("MAC 계층",format("MAC : {0}",d.mac))),d.v4addr&&"0.0.0.0"!=d.v4addr&&(d.v4gateway&&d.v4mask?a+=addDetailItem("IPv4 레이어",format("IP : {0}, 마스크 : {1}, 게이트웨이 : {2}",EscapeHtml(d.v4addr),EscapeHtml(d.v4mask),EscapeHtml(d.v4gateway))):a+=addDetailItem("IPv4 레이어",format("IP : {0}",EscapeHtml(d.v4addr)))),a+="</div>"}""!=(a+="</table>")&&o.push({name:"네트워킹",html:a,img:"networking64.png"})}if(null!=e.intelamt){a="";a+=addDetailItem("버전",e.intelamt.ver?"v"+e.intelamt.ver:"<i>알 수 없는</i>",i);var c={0:nobreak("활성화되지 않음 (Pre)"),1:nobreak("활성화되지 않음 (In)"),2:nobreak("활성화 됨")},u="";2==e.intelamt.state&&e.intelamt.flags&&(2&e.intelamt.flags?u=", 클라이언트 제어 모드 (CCM)":4&e.intelamt.flags&&(u=", 관리 제어 모드 (ACM)")),a+=addDetailItem("프로비저닝 상태",(e.intelamt.state?c[e.intelamt.state]:"<i>알 수 없는</i>")+u,i),a+=addDetailItem("보안",1==e.intelamt.tls?"TLS 보안":"TLS가 설정되지 않았습니다",i),""!=(a+=addDetailItem("관리자 자격 증명",null==e.intelamt.user||""==e.intelamt.user?"알려지지 않음":"알려진",i))&&o.push({name:"Intel&reg; Active Management Technology (Intel&reg; AMT)",html:a,img:"amt64.png"})}if(t.identifiers){a="";var p=t.identifiers;if(p.bios_vendor&&(a+=addDetailItem("공급업체",EscapeHtml(p.bios_vendor),i)),p.bios_version&&(a+=addDetailItem("버전",EscapeHtml(p.bios_version),i)),""!=a&&o.push({name:"BIOS",html:a,img:"chip64.png"}),a="",p.board_vendor&&(a+=addDetailItem("공급업체",EscapeHtml(p.board_vendor),i)),p.board_name&&(a+=addDetailItem("이름",EscapeHtml(p.board_name),i)),p.board_serial&&""!=p.board_serial&&(a+=addDetailItem("일련번호",EscapeHtml(p.board_serial),i)),p.board_version&&(a+=addDetailItem("버전",EscapeHtml(p.board_version),i)),p.product_uuid&&(a+=addDetailItem("식별자",EscapeHtml(p.product_uuid),i)),p.cpu_name&&(a+=addDetailItem("CPU",EscapeHtml(p.cpu_name).split("(TM)").join("&trade;").split("(R)").join("&reg;"),i)),p.gpu_name)for(var l in p.gpu_name)a+=addDetailItem("GPU",EscapeHtml(p.gpu_name[l]).split("(TM)").join("&trade;").split("(R)").join("&reg;"),i);""!=a&&o.push({name:"메인보드",html:a,img:"motherboard64.png"})}if(t.windows&&t.windows.memory){a="";for(var l in t.windows.memory.sort(function(e,t){return e.BankLabel>t.BankLabel?1:e.BankLabel<t.BankLabel?-1:0}),a+="<table style=width:100%>",t.windows.memory){d=t.windows.memory[l];a+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",a+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.BankLabel)+"</b></div>",d.Capacity&&(a+=addDetailItem("용량 / 속도",format("{0} Mb, {1} Mhz",d.Capacity/1024/1024,d.Speed),i)),d.PartNumber&&(a+=addDetailItem("부품번호",EscapeHtml(d.Manufacturer&&"Undefined"!=d.Manufacturer?d.Manufacturer+", ":"")+EscapeHtml(d.PartNumber),i)),a+="</div>"}""!=(a+="</table>")&&o.push({name:"메모리",html:a,img:"ram64.png"})}if(t.identifiers&&p.storage_devices){a="";for(var l in p.storage_devices.sort(function(e,t){return e.Caption>t.Caption?1:e.Caption<t.Caption?-1:0}),a+="<table style=width:100%>",p.storage_devices){(d=p.storage_devices[l]).Size&&(a+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>",a+="<div style=margin-bottom:3px><b>"+EscapeHtml(d.Caption)+"</b></div>",d.Model&&d.Model!=d.Caption&&(a+=addDetailItem("모델",EscapeHtml(d.Model),i)),d.Size&&("string"==typeof d.Size&&parseInt(d.Size)==d.Size&&(d.Size=parseInt(d.Size)),"number"==typeof d.Size&&(a+=addDetailItem("용량",format("{0} Mb",Math.floor(d.Size/1024/1024)),i)),"string"==typeof d.Size&&(a+=addDetailItem("용량",EscapeHtml(d.Size),i))),a+="</div>")}""!=(a+="</table>")&&o.push({name:"저장소",html:a,img:"storage64.png"})}a="";for(var l in o)null==o[l].img?a+="<div class=DevSt style=margin-bottom:3px;margin-left:16px><b>"+o[l].name+"</b></div><div style=margin-bottom:10px;margin-left:16px>"+o[l].html+"</div>":(a+="<table style=width:100%><tr>",a+="<td style=width:64px;vertical-align:top><img src=images/details/"+o[l].img+" border=0 width=64 /></td>",a+="<td><div class=DevSt style=margin-bottom:3px;margin-left:16px><b>"+o[l].name+"</b></div><div style=margin-bottom:10px;margin-left:16px>"+o[l].html+"</div></td>",a+="</tr></table>");""==a?QH("p17info","이 장치에 대한 정보가 없습니다."):QH("p17info",a)}}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 o=n.value;n.value=o.substring(0,o.length-1),t=1}else if(27==e.keyCode)n.value="",t=1;else if(38==e.keyCode||40==e.keyCode){var i=consoleHistory.indexOf(n.value);38==e.keyCode&&consoleHistory.length-1>i?n.value=consoleHistory[i+1]:40==e.keyCode&&0<i?n.value=consoleHistory[i-1]:40==e.keyCode&&0==i&&(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,o=e.selectionEnd;e.value=e.value.substring(0,n)+t+e.value.substring(o,e.value.length),e.setSelectionRange(o+1,o+1)}else e.value+=myValue}var consoleServerText="";function setupConsole(){if(115==xxcurrentView){var e="server"==consoleNode;consoleNode="server",QH("p15deviceName","내 서버 콘솔"),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)?"에이전트가 온라인 상태입니다.":"에이전트가 오프라인 상태입니다.";0!=(16&consoleNode.conn)&&(n+=", MQTT가 온라인 상태입니다."),QH("p15statetext",n),QE("p15consoleText",t),QE("p15uploadCore",0!=(1&consoleNode.conn)),QV("p15outputselecttd",17==(17&consoleNode.conn))}else QH("p15statetext","접근 거절됨"),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 o=consoleHistory.indexOf(t);0<=o&&consoleHistory.splice(o,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,"에이전트 작업 수행",3,p15uploadCoreEx,addHtmlValue("동작","<select id=d3coreMode style=width:230px><option value=1>기본 서버 코어 업로드</option><option value=2>코어 지우기</option><option value=6>복구 코어 업로드</option><option value=3>코어 파일 업로드</option><option value=4>소프트 연결해제 에이전트</option><option value=5>하드 분리 에이전트</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,"메시 에이전트 코어 업로드",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>검증된 휴대폰 번호</div><div style=font-size:20px>"+userinfo.phone+"</div>",setDialogMode(2,"휴대폰 알림",3,account_managePhoneRemove,e+="<div style=margin:10px><label><input id=d2delPhone type=checkbox onclick=account_managePhoneRemoveValidate() />휴대폰 번호 제거</label></div>"),account_managePhoneRemoveValidate()):(e='<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>',e+="<td>SMS 가능 전화 번호를 입력하십시오. 확인되면이 번호는 로그인 확인 및 기타 알림에 사용될 수 있습니다.",setDialogMode(2,"휴대폰 알림",3,account_managePhoneAdd,e+='<br /><br /><div style=width:100%;text-align:center>휴대폰 번호: <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,"이메일 인증",1,function(){e!=Q("email2facheck").checked&&meshserver.send({action:"otpemail",enabled:Q("email2facheck").checked})},"활성화되면, 보안 강화를 위해 각 로그인마다 이메일 계정으로 로그인 토큰을 받을 수 있는 옵션이 제공됩니다.<br /><br /><label><input id=email2facheck type=checkbox "+(e?"checked":"")+"/>2단계 이메일 인증을 사용합니다.</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,"2단계 인증 앱",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"<div id=d2optinfo>불러오는 중 ...</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,"2단계 인증 앱",3,function(){meshserver.send({action:"otpauth-clear"})},"2단계 인증 로그인 앱을 삭제하시겠습니까?")}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="추가할 키 이름을 입력하십시오.<br /><br />";t+=addHtmlValue("키 이름",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="나의 키" onkeyup=account_addhkeyValidate(event,2) />')}else if(2==e){t="키 이름을 입력하고, OTP 상자를 선택한 다음 YubiKey&trade;의 버튼를 누르십시오.<br /><br />";t+=addHtmlValue("키 이름",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="나의 키" 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,"보안 키 추가",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,"보안 키 추가",0,null,"<br />확인 중...<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:"아프리카 어",sq:"알바니아",ar:"아랍어 (표준)","ar-dz":"아랍어 (알제리)","ar-bh":"아랍어 (바레인)","ar-eg":"아랍어 (이집트)","ar-iq":"아랍어 (이라크)","ar-jo":"아랍어 (요르단)","ar-kw":"아랍어 (쿠웨이트)","ar-lb":"아랍어 (레바논)","ar-ly":"아랍어 (리비아)","ar-ma":"아랍어 (모로코)","ar-om":"아랍어 (오만)","ar-qa":"아랍어 (카타르)","ar-sa":"아랍어 (사우디 아라비아)","ar-sy":"아랍어 (시리아)","ar-tn":"아랍어 (튀니지)","ar-ae":"아랍어 (미국)","ar-ye":"아랍어 (예멘)",an:"아라곤어",hy:"아르메니아어",as:"아쌈어",ast:"아스투리아어",az:"아제르바이잔어",eu:"바스크어",bg:"불가리아어",be:"벨로루시어",bn:"벵골어",bs:"보스니아어",br:"브르타뉴어",my:"버마어",ca:"카탈로니아어",ch:"차모로어",ce:"체첸어",zh:"중국어","zh-hk":"중국어(홍콩)","zh-cn":"중국어(PRC)","zh-sg":"중국어(싱가포르)","zh-tw":"중국어(대만)",cv:"추바시어",co:"코르시카어",cr:"크리어",hr:"크로아티아어",cs:"체코어",da:"덴마크어",nl:"네덜란드어 (표준)","nl-be":"네덜란드어 (벨기에)",en:"영어","en-au":"영어 (호주)","en-bz":"영어 (벨리즈)","en-ca":"영어 (캐나다)","en-ie":"영어 (아일랜드)","en-jm":"영어 (자메이카)","en-nz":"영어 (뉴질랜드)","en-ph":"영어 (필리핀)","en-za":"영어 (남아프리카)","en-tt":"영어 (트리니다드 토바고)","en-gb":"영어 (영국)","en-us":"영어 (미국)","en-zw":"영어 (짐바브웨)",eo:"에스페란토어",et:"에스토니아어",fo:"페로어",fa:"페르시아어",fj:"피지어",fi:"핀란드어",fr:"프랑스어 (표준)","fr-be":"프랑스어 (벨기에)","fr-ca":"프랑스어 (캐나다)","fr-fr":"프랑스어 (프랑스)","fr-lu":"프랑스어 (룩셈부르크)","fr-mc":"프랑스어 (모나코)","fr-ch":"프랑스어 (스위스)",fy:"프리지아어",fur:"프리울리어",gd:"게일어 (Scots)","gd-ie":"게일어 (아일랜드어)",gl:"갈라시아어",ka:"조르지아어",de:"독일어 (표준)","de-at":"독일어 (오스트리아)","de-de":"독일어 (독일)","de-li":"독일어 (리히텐슈타인)","de-lu":"독일어 (룩셈부르크)","de-ch":"독일어 (스위스)",el:"그리스어",gu:"구주라티어",ht:"하이티어",he:"히브리어",hi:"힌디어",hu:"헝가리어",is:"아이슬란드어",id:"인도네시아어",iu:"이누트어",ga:"아일랜드어",it:"이탈리아어 (표준)","it-ch":"이탈리아어 (스위스)",ja:"일본어",kn:"칸나다어",ks:"카시미르어",kk:"카자흐어",km:"크메르어",ky:"키르기즈어",tlh:"클링온어",ko:"한국어","ko-kp":"조선어 (북한)","ko-kr":"한국어 (한국)",la:"라틴어",lv:"라트비아어",lt:"리투아니아어",lb:"룩셈부르크어",mk:"FYRO 마케도니아어",ms:"말레이어",ml:"말라얄람어",mt:"몰티즈어",mi:"마오리어",mr:"마라티어",mo:"몰다비아어",nv:"나바호어",ng:"은동가어",ne:"네팔어",no:"노르웨이어",nb:"노르웨이어 (Bokmal)",nn:"노르웨이어 (니 노르 스크)",oc:"오크어",or:"오리야어",om:"오로모어","fa-ir":"페르시아어 /이란",pl:"폴란드어",pt:"포르투갈인","pt-br":"포르투갈어 (브라질)",pa:"펀자브어","pa-in":"펀자브어 (인도)","pa-pk":"펀자브어 (파키스탄)",qu:"케추아어",rm:"로마어 (라에토)",ro:"루마니아어","ro-mo":"루마니아어 (몰다비아)",ru:"러시아어","ru-mo":"러시아어 (몰다비아)",sz:"사미어 (Lappish)",sg:"상고어",sa:"산스크리트어",sc:"사르디니아어",sd:"신디어",si:"싱할레스어",sr:"세르비아어",sk:"슬로바키아어",sl:"슬로베니아어",so:"소마니어",sb:"소르비아어",es:"스페인어","es-ar":"스페인어 (아르헨티나)","es-bo":"스페인어 (볼리비아)","es-cl":"스페인어 (칠레)","es-co":"스페인어 (콜롬비아)","es-cr":"스페인어 (코스타리카)","es-do":"스페인어 (도미니카 공화국)","es-ec":"스페인어 (에콰도르)","es-sv":"스페인어 (엘살바도르)","es-gt":"스페인어 (과테말라)","es-hn":"스페인어 (온두라스)","es-mx":"스페인어 (멕시코)","es-ni":"스페인어 (니카라과)","es-pa":"스페인어 (파나마)","es-py":"스페인어 (파라과이)","es-pe":"스페인어 (페루)","es-pr":"스페인어 (푸에르토 리코)","es-es":"스페인어 (스페인)","es-uy":"스페인어 (우루과이)","es-ve":"스페인어 (베네수엘라)",sx:"수투어",sw:"스와힐리어",sv:"스웨덴어","sv-fi":"스웨덴어 (핀란드)","sv-sv":"스웨덴어 (스웨덴)",ta:"타밀어",tt:"타타르어",te:"텔루가어",th:"태국어",tig:"티그레어",ts:"손가어",tn:"츠와나어",tr:"터키어",tk:"투르크멘어",uk:"우크라이나어",hsb:"어퍼 소르비아어",ur:"우르두어",ve:"벤다어",vi:"베트남어",vo:"볼라푸크어",wa:"왈론어",cy:"웨일스어",xh:"코사어",ji:"이디시어",zu:"줄루어"},loclistex={"zh-chs":"중국어(간체)"};function account_showLocalizationSettings(){if(xxdialogMode)return!1;var e=getstore("loctag",0),t="",n='<select id=d2locselect style=width:240px><option value="*">사용자 브라우저 값</option>';for(var o in loclist)n+='<option value="'+o+'"'+(e==o?" selected":"")+">"+o+" - "+loclist[o]+"</option>";if(n+="</select>",serverinfo.languages&&0<serverinfo.languages.length){t+="언어를 변경하면 페이지를 새로 고쳐야합니다.<br /><br />";var i='<select id=d2langselect style=width:240px><option value="*">사용자 브라우저 값</option>';for(var o in serverinfo.languages){var a=serverinfo.languages[o];i+='<option value="'+a+'"'+(userinfo.lang==a?" selected":"")+">"+a+" - "+(loclist[a]?loclist[a]:loclistex[a])+"</option>"}t+=addHtmlValue("언어",i+="</select>")}return t+=addHtmlValue("날짜 & 시간",n),4294967295==userinfo.siteadmin&&""==domain&&(t+='<br /><a rel="noreferrer noopener" target="_blank" href="translator.htm">MeshCentral 번역을 도와주세요</a>'),setDialogMode(2,"현지화 설정",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,"알림 설정",3,account_showAccountNotifySettingsEx,"<div><label><input id=p2notifyPlayNotifySound type=checkbox />알림 소리.</label></div><div><label><input id=p2notifyGroupName type=checkbox />장치 그룹 이름 표시</label></div><div><label><input id=p2notifyIntelDeviceConnect type=checkbox />장치가 연결되었습니다.</label></div><div><label><input id=p2notifyIntelDeviceDisconnect type=checkbox />장치 연결이 끊어졌습니다.</label></div><div><label><input id=p2notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT 데스크탑 및 직렬 이벤트.</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,"이메일 검증",3,account_showVerifyEmailEx,"검증용 메일을 보내려면 OK을 클릭하십시오:<br /><div style=padding:8px><b>"+EscapeHtml(userinfo.email)+"</b></div>검증을 받으려면 몇 분 정도 기다려주십시오."),!1}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){if(xxdialogMode)return!1;var e="여기에서 계정의 이메일 주소를 변경하십시오.<br /><br />";return setDialogMode(2,"이메일 주소 변경",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="이 계정을 삭제하려면 아래 두 상자에 계정 비밀번호를 입력하고 확인을 누르십시오.<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>암호:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>",e+="</tr><tr><td align=right>암호:</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,"계정 삭제",0,null,e+="</div><br /></form>"),account_validateDeleteAccount(),Q("apassword1").focus(),!1}function account_showChangePassword(){if(xxdialogMode)return!1;var e="아래 상자에 기존 비밀번호와 두 번의 새 비밀번호를 입력하여 계정 비밀번호를 변경하십시오.";if(e+="<br /><br />",e+="<table style=margin-left:60px>",e+="<tr><td align=right>"+nobreak("이전 비밀번호:")+"</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("새 비밀번호:")+"</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("새 비밀번호:")+"</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>비밀번호 힌트:</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 o in passRequirements)"reset"!=o&&"hint"!=o&&(t.push(o+":"+passRequirements[o]),n++);0<n&&(e+="<br /><span style=font-size:x-small>요구사항 :"+t.join(", ")+".</span>")}return setDialogMode(2,"비밀번호 변경",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,"새 장치 그룹",1,null,"이 계정에는 새 장치 그룹을 만들 수 있는 권한이 없습니다."),!1;if(!0!==userinfo.emailVerified&&1==serverinfo.emailcheck&&4294967295!=userinfo.siteadmin)return setDialogMode(2,"계정 보안",1,null,'이메일 주소가 확인 될 때까지 장치에 액세스 할 수 없습니다. 이것은 비밀번호 복구에 필요합니다. 이메일 주소를 변경하고 확인하려면 "내 계정" 탭으로 이동하십시오.'),!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,"계정 보안",1,null,'2단계 인증이 활성화 될 때까지 장치에 액세스 할 수 없습니다. 이것은 추가 보안을 위해 필요합니다. "내 계정"으로 이동하여 "계정 보안" 부분을 보십시오.'),!1;var e="아래 옵션을 사용하여 새 장치 그룹을 만듭니다.<br /><br />";return e+=addHtmlValue("이름","<input id=dp2meshname style=width:230px maxlength=64 onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate(event,1) />"),e+=addHtmlValue("유형","<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>소프트웨어 에이전트를 사용하여 관리</option><option value=1>오직 Intel&reg; AMT만, 에이전트 없음</option></select></div>"),setDialogMode(2,"새 장치 그룹",3,account_createMeshEx,e+=addHtmlValue("설명","<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&&"입력"==e.key&&0<Q("dp2meshname").value.length&&Q("dp2meshtype").focus(),2==t&&null!=e&&"입력"==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>강한<span>":60<=n?"<span style=color:blue>좋은 <span>":"<span style=color:red>약한<span>"}else{0==checkPasswordRequirements(Q("apassword1").value,passRequirements)&&(t=!1,e="<span style=color:red>정책<span>")}QH("dxPassWarn",e),QE("idx_dlgOkButton",t)}function checkPasswordStrength(e){var t=0,n={},o=0,i={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e)return 0;for(var a=0;a<e.length;a++)n[e[a]]=(n[e[a]]||0)+1,t+=5/n[e[a]];for(var s in i)o+=1==i[s]?1:0;return parseInt(t+10*(o-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,o=0,i=0,a=0,s=0;s<e.length;s++)/\d/.test(e[s])&&n++,/[a-z]/.test(e[s])&&o++,/[A-Z]/.test(e[s])&&i++,/\W/.test(e[s])&&a++;return!(t.numeric&&n<t.numeric)&&(!(t.lower&&o<t.lower)&&(!(t.upper&&i<t.upper)&&!(t.nonalpha&&a<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]),a="부분적인 권리";4294967295==o?a="전체 관리자":0==o&&(a="권한이 없습니다."),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>"+a+"</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="<span style = color : red>기존 서버 데이터를 삭제합니다.</ span> 기존에 백업된 자료를 사용하여 서버를 복원합니다. 어떤 결과가 일어날 지 알고 있는 경우에만 이 작업을 수행하십시오.<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=취소 style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>",e+="<input id=account_dlgOkButton type=submit value=확인 style=float:right;width:80px onclick=dialogclose(1)>",setDialogMode(2,"서버 복원",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 버전",1,null,"불러오는 중 ...","MeshCentralServerUpdate"),meshserver.send({action:"serverversion"})),!1}function server_showVersionDlgUpdate(){var e=Q("d2updateCheck1").checked,t=Q("d2updateCheck2").checked;QE("d2updateCheck1","알 수 없는"!=xxdialogTag.stable&&xxdialogTag.current!=xxdialogTag.stable&&0==t),QE("d2updateCheck2","알 수 없는"!=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 오류",1,null,"불러오는 중 ...","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>없음</i>"),0!=(1&e)&&(t='<span tabindex=0 title="장치 그룹 이름을 편집하려면 여기를 클릭하십시오." 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("알 수 없는 # {0}",currentMesh.mtype);1==currentMesh.mtype&&(n="오직 Intel&reg; AMT만, 에이전트 없음"),2==currentMesh.mtype&&(n="소프트웨어 에이전트로 관리됨");var o="";if(0!=(8&args.hide)&&(o+=addHtmlValue("이름",t)),o+=addHtmlValue("설명",addLinkConditional(currentMesh.desc&&""!=currentMesh.desc?EscapeHtml(currentMesh.desc):"<i>없음</i>","p20editmesh(2)",0!=(1&e))),o+=addHtmlValue("유형",n),2==currentMesh.mtype){var i=[];currentMesh.flags&&(1&currentMesh.flags&&i.push("자동 제거"),2&currentMesh.flags&&i.push("호스트 이름 동기화")),""==(i=i.join(", "))&&(i="<i>없음</i>"),o+=addHtmlValue("기능들",addLinkConditional(i,"p20editmeshfeatures()",1&e))}if(2==currentMesh.mtype){i=[];var a=0;currentMesh.consent&&(a=currentMesh.consent),serverinfo.consent&&(a|=serverinfo.consent),64&a&&8&a?i.push("데스크톱 프롬프트+도구모음"):64&a?i.push("데스크톱 툴바"):8&a?i.push("데스크탑 프롬프트"):1&a&&i.push("데스크탑 알림"),16&a?i.push("터미널 프롬프트"):2&a&&i.push("터미널 알림"),32&a?i.push("파일 프롬프트"):4&a&&i.push("파일 알림"),7==a&&(i=["항상 알림"]),56==(56&a)&&(i=["항상 묻기"]),""==(i=i.join(", "))&&(i="<i>없음</i>"),o+=addHtmlValue("사용자 연결 옵션",addLinkConditional(i,"p20editmeshconsent(1)",1&e))}var s=0,r=[];if(userinfo.links&&userinfo.links[currentMesh._id]&&userinfo.links[currentMesh._id].notify&&(s=userinfo.links[currentMesh._id].notify),2&s&&r.push("연결"),4&s&&r.push("연결 해제"),8&s&&r.push("Intel&reg; AMT"),0==r.length&&r.push("<i>없음</i>"),o+=addHtmlValue("알림",addLink(r.join(", "),"p20editMeshNotify()")),16777216&features&&2==currentMesh.mtype){var l="<i>없음</i>",d=!1;null!=currentMesh.invite&&(d=!0,l=currentMesh.invite.codes.join(", ")),o+=addHtmlValue("코드 초대",addLinkConditional(l,"p20editmeshInviteCode()",1&e||d))}var c="정책이 없습니다.";if(currentMesh.amt&&(1==currentMesh.amt.type?c="Deactivate Client Control Mode (CCM)":2==currentMesh.amt.type?(c="간단한 클라이언트 제어 모드 (CCM)",2==currentMesh.amt.cirasetup&&(c+=" + CIRA")):3==currentMesh.amt.type&&(c="간단한 관리 제어 모드 (ACM)",2==currentMesh.amt.cirasetup&&(c+=" + CIRA"))),o+=addHtmlValue("Intel&reg; AMT",addLinkConditional(c,"p20editMeshAmt()",1&e)),1&e&&(o+='<br><input type=button value=메모 title="이 장치 그룹에 대한 메모 보기" onclick=showNotes(false,"'+encodeURIComponentEx(currentMesh._id)+'") />'),o+="<br style=clear:both><br>",2&e&&(o+='<a href=# onclick="return p20showAddMeshUserDialog()" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> 사용자 추가</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&&(o+='<a href=# onclick="return p20showAddMeshUserDialog(2)" style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> 사용자 그룹 추가</a>')}4&e&&(1==currentMesh.mtype&&(o+="<a href=# onclick='return addCiraDeviceToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="인터넷에있는 새 Intel&reg; AMT 컴퓨터를 추가하십시오."><img src=images/icon-installmesh.png border=0 height=12 width=12> CIRA 설치</a>',o+="<a href=# onclick='return addDeviceToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="로컬 네트워크에있는 새 Intel&reg; AMT 컴퓨터를 추가하십시오."><img src=images/icon-installmesh.png border=0 height=12 width=12> 로컬 설치</a>',currentMesh.amt&&2==currentMesh.amt.type?o+="<a href=# onclick='return showCcmActivation(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Intel AMT 클라이언트 제어 모드 (CCM) 활성화를 수행하십시오."><img src=images/icon-installmesh.png border=0 height=12 width=12> 활성화</a>':currentMesh.amt&&3==currentMesh.amt.type&&0!=(1048576&features)&&(o+="<a href=# onclick='return showAcmActivation(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="Intel AMT 관리자 제어 모드 (ACM) 활성화를 수행하십시오."><img src=images/icon-installmesh.png border=0 height=12 width=12> 활성화</a>')),2==currentMesh.mtype&&(o+="<a href=# onclick='return addAgentToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="MeshAgent(매시 에이전트)를 설치하여 새로운 컴퓨터를 이 장치 그룹에 추가하십시오."><img src=images/icon-addnew.png border=0 height=12 width=12> 에이전트 추가</a>',o+="<a href=# onclick='return inviteAgentToMesh(\""+currentMesh._id+'")\' style=cursor:pointer;margin-right:10px title="이 장치 그룹에 메쉬 에이전트를 설치하도록 초대하십시오."><img src=images/icon-addnew.png border=0 height=12 width=12> 초대</a>')),o+='<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>사용자 인증</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),x=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="이 장치 그룹에 대한 사용자 권한 제거" 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/")&&(x=4);var y=EscapeHtml(decodeURIComponent(h[m].name));null!=usergroups&&h[m].id.startsWith("ugrp/")&&(y="<a tabindex=0 href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(h[m].id)+"\");haltEvent(event);'>"+y+"</a>"),null!=users&&h[m].id.startsWith("user/")&&(y="<a tabindex=0 href=# onclick='gotoUser(\""+encodeURIComponentEx(h[m].id)+"\");haltEvent(event);'>"+y+"</a>"),o+="<tr style="+(g%2==0?";background-color:#DDD":"")+'><td style=width:30%><div title="사용자" class=m'+x+"></div><div>&nbsp;"+y+"<div></div></div></td><td style=width:70%><div style=float:right>"+f+"</div><div>"+k+"</div></td></tr>",++g}o+="</tbody></table>",4294967295==e&&(o+="<div style=font-size:x-small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>그룹 삭제</a></span></div>"),QH("p20info",o);var b="";if(0==(268435456&features)&&20<=xxcurrentView&&xxcurrentView<=29&&null!=currentMesh){for(var m in b="?viewmode="+xxcurrentView+"&gotomesh="+currentMesh._id.split("/")[2],urlargs)b+="&"+m+"="+urlargs[m];try{window.history.replaceState({},document.title,window.location.pathname+b)}catch(e){}}}}function p20editMeshAmt(){if(!xxdialogMode){var e="",t="";0!=(1048576&features)&&(t="<option value=3>간단한 관리 제어 모드 (ACM)</option>"),1==currentMesh.mtype?e+=addHtmlValue("유형","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>정책이 없습니다.</option><option value=2>간단한 클라이언트 제어 모드 (CCM)</option>"+t+"</select>"):e+=addHtmlValue("유형","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>정책이 없습니다.</option><option value=1>클라이언트 제어 모드 (CCM) 비활성화</option><option value=2>간단한 클라이언트 제어 모드 (CCM)</option>"+t+"</select>"),setDialogMode(2,"Intel&reg; AMT 정책",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("암호*","<input id=dp20amtpolicypass type=password style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() autocomplete=off />"),t+=addHtmlValue("암호*","<input id=dp20amtpolicypass2 type=password style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() autocomplete=off />"),2==e&&2==currentMesh.mtype&&(t+=addHtmlValue("비밀번호 불일치","<select id=dp20amtbadpass style=width:230px><option value=0>아무것도 하지 마세요.</option><option value=1>Intel&reg; AMT 재활성화</option></select>")),0==(1024&features)&&(t+=addHtmlValue('<span title="클라이언트 시작 원격 액세스">CIRA</span>',2==e?"<select id=dp20amtcira style=width:230px><option value=0>구성하지 마십시오</option><option value=1>서버에 연결하지 마십시오</option><option value=2>서버에 연결</option></select>":"<select id=dp20amtcira style=width:230px><option value=0>구성하지 마십시오</option><option value=2>서버에 연결</option></select>")),t+='<br/><span style="font-size:10px">* 각 장치에 임의의 암호를 할당하려면 비워 두십시오.</span><br/>',2==currentMesh.mtype&&(2==e?(t+='<span style="font-size:10px">이 정책은 ACM 모드에서 Intel&reg; AMT가 설치된 장치에는 영향을 미치지 않습니다.</span><br/>',t+='<span style="font-size:10px">에이전트가 활성화를 수행하므로 이는 보안 정책이 아닙니다.</span>'):t+='<span style="font-size:10px">활성화하는 동안 에이전트는 관리자 비밀번호 정보에 액세스 할 수 있습니다.</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("그룹 {0}을(를) 삭제 하시겠습니까? 장치 그룹을 삭제하면 이 그룹 내 장치에 대한 모든 정보도 함께 삭제됩니다.",EscapeHtml(currentMesh.name))+"<br /><br />";return setDialogMode(2,"그룹 삭제",3,p20showDeleteMeshDialogEx,e+="<label><input id=p20check type=checkbox onchange=p20validateDeleteMeshDialog() />확인</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("이름","<input id=dp20meshname style=width:230px maxlength=32 onchange=p20editmeshValidate() onkeyup=p20editmeshValidate(event) />");setDialogMode(2,"장치 그룹 편집",3,p20editmeshEx,t+=addHtmlValue("설명","<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,o="";1==e&&(n=currentMesh.consent?currentMesh.consent:0,o="장치 그룹 사용자 연결 옵션 편집"),2==e&&(n=currentUser.consent?currentUser.consent:0,o="사용자 연결 옵션 편집"),3==e&&(n=currentNode.consent?currentNode.consent:0,o="장치 사용자 연결 옵션 편집"),t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px"><b>데스크탑</b></div>',t+="<div><label><input type=checkbox id=d20flag1 "+(1&n?"checked":"")+">사용자에게 알림</label></div>",t+="<div><label><input type=checkbox id=d20flag2 "+(8&n?"checked":"")+">사용자에게 연결을 요청함</label></div>",t+="<div><label><input type=checkbox id=d20flag7 "+(64&n?"checked":"")+">연결 도구모음 표시</label></div>",t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:8px"><b>터미널</b></div>',t+="<div><label><input type=checkbox id=d20flag3 "+(2&n?"checked":"")+">사용자에게 알림</label></div>",t+="<div><label><input type=checkbox id=d20flag4 "+(16&n?"checked":"")+">사용자에게 연결을 요청함</label></div>",t+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:8px"><b>파일</b></div>',t+="<div><label><input type=checkbox id=d20flag5 "+(4&n?"checked":"")+">사용자에게 알림</label></div>",setDialogMode(2,o,3,p20editmeshconsentEx,t+="<div><label><input type=checkbox id=d20flag6 "+(32&n?"checked":"")+">사용자에게 연결을 요청함</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":"")+">연결 해제 시 장치 제거</label><br></div>";setDialogMode(2,"장치 그룹 기능 편집",3,p20editmeshfeaturesEx,t+="<div><label><input type=checkbox id=d20flag2 "+(2&e?"checked":"")+">서버 장치 이름을 호스트 이름과 동기화</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?"사용자가 이 장치 그룹 및 그룹 내 장치를 관리 할 수 ​​있도록 허락합니다.":"사용자가 이 장치를 관리하도록 허락합니다.",524288&features&&(n+=" 장치 그룹에 추가하려면 이 서버에 한 번 로그인 해야합니다."),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 o="";if(null==t){var i=getOrderedList(meshes,"name");for(var a in i)null!=currentUser.links&&null!=currentUser.links[i[a]._id]||(o+="<option value="+encodeURIComponentEx(i[a]._id)+">"+EscapeHtml(i[a].name)+"</option>")}else o+="<option value="+t+">"+EscapeHtml(meshes[decodeURIComponent(t)].name)+"</option>";n+=addHtmlValue("장치 그룹","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%"+(t?" disabled":"")+">"+o+"</select></div>")}else if(2==e){if(null==usergroups)return;o="";var s=getOrderedList(usergroups,"name");for(var a in s)currentMesh._id.split("/")[1]==s[a]._id.split("/")[1]&&(null!=currentMesh.links&&null!=currentMesh.links[s[a]._id]||(o+="<option value="+encodeURIComponentEx(s[a]._id)+">"+EscapeHtml(s[a].name)+"</option>"));n+=addHtmlValue("사용자 그룹","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%>"+o+"</select></div>")}else if(6==e){if(null==usergroups)return;o="";if(null==t){s=getOrderedList(usergroups,"name");for(var a in s)currentNode._id.split("/")[1]==s[a]._id.split("/")[1]&&(null!=currentNode.links&&null!=currentNode.links[s[a]._id]||(o+="<option value="+encodeURIComponentEx(s[a]._id)+">"+EscapeHtml(s[a].name)+"</option>"))}else o+="<option value="+t+">"+EscapeHtml(usergroups[decodeURIComponent(t)].name)+"</option>";n+=addHtmlValue("사용자 그룹","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog() id=dp2groupid style=width:100%"+(t?" disabled":"")+">"+o+"</select></div>")}else if(3==e){o="";t=t&&decodeURIComponent(t);i=getOrderedList(meshes,"name");for(var a in i)null==t&&null!=currentUserGroup.links&&null!=currentUserGroup.links[i[a]._id]||(o+="<option value="+encodeURIComponentEx(i[a]._id)+(t==i[a]._id?" selected":" ")+">"+EscapeHtml(i[a].name)+"</option>");n+=addHtmlValue("장치 그룹","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog("+e+") id=dp2groupid style=width:100%>"+o+"</select></div>")}else if(4==e||7==e){o="";var r=null,l=null;null!=t&&null!=(l=getNodeFromId(decodeURIComponent(t)))&&(r=l.meshid);i=getOrderedList(meshes,"name");for(var a in i)null!=i[a].links[userinfo._id]&&7&i[a].links[userinfo._id].rights&&(null==r&&(r=i[a]._id),o+="<option value="+encodeURIComponentEx(i[a]._id)+(r==i[a]._id?" selected":" ")+">"+EscapeHtml(i[a].name)+"</option>");n+=addHtmlValue("장치 그룹","<div style=width:230px;margin:0;padding:0><select onchange=p20changeMeshAddMeshUserDialog("+e+") id=dp2meshid style=width:100%>"+o+"</select></div>"),o="";var d=getOrderedList(nodes,"name");for(var a in d)d[a].meshid==r&&(o+="<option value="+encodeURIComponentEx(d[a]._id)+(l==d[a]?" selected":" ")+">"+EscapeHtml(d[a].name)+"</option>");n+=addHtmlValue("장치","<div style=width:230px;margin:0;padding:0><select onchange=p20validateAddMeshUserDialog("+e+") id=dp2nodeid style=width:100%>"+o+"</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("{0}에 대한 그룹 권한",c)+"<br /><br />":n+=format("사용자 {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>전체 관리자</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editmesh>장치 그룹 편집</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20manageusers>장치 그룹 사용자 관리</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20managecomputers>장치 그룹 컴퓨터 관리</label><br>"),n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotecontrol>원격 제어</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remoteview style=margin-left:12px>오직 원격 보기만</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotelimitedinput style=margin-left:12px>오직 제한된 입력만</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20nodesktop style=margin-left:12px>데스크톱 접근 불가</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noterminal style=margin-left:12px>접근 가능한 터미널이 없습니다.</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20nofiles style=margin-left:12px>접근할 수 있는 파일이 없습니다.</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noamt style=margin-left:12px>Intel&reg; AMT 없음</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshagentconsole>메시 에이전트 콘솔</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshserverfiles>서버 파일</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20wakedevices>장치 깨우기(Wake)</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editnotes>장치 메모 편집</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20limitevents>오직 자신의 이벤트만 표시</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20chatnotify>채팅 및 알림</label><br>",n+="<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20uninstall>에이전트 제거</label><br>",n+="</div>",null==e)setDialogMode(2,"장치 그룹에 사용자 추가",3,p20showAddMeshUserDialogEx,n),QE("p20fulladmin",4294967295==GetMeshRights(currentMesh)),Q("dp20username").focus();else if(1===e)setDialogMode(2,null==t?"장치 그룹 권한 추가":"장치 그룹 권한 편집",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,"사용자 그룹 추가",3,p20showAddMeshUserDialogEx,n,e),QE("p20fulladmin",4294967295==GetMeshRights(currentMesh));else if(3===e)setDialogMode(2,null==t?"장치 그룹 추가":"장치 그룹 편집",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?"장치 권한 추가":"장치 권한 편집",t?7:3,p20showAddMeshUserDialogEx,n,e),QE("dp2meshid",null==t),QE("dp2nodeid",null==t);else if(7===e)setDialogMode(2,null==t?"장치 권한 추가":"장치 권한 편집",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?"사용자 장치 권한 편집":"사용자 장치 권한 추가",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?"사용자 그룹 장치 권한 편집":"사용자 그룹 장치 권한 추가",t?7:3,p20showAddMeshUserDialogEx,n,e),null!=t&&(u=currentNode.links[decodeURIComponent(t)].rights);else{e.startsWith("ugrp/")?setDialogMode(2,"장치 그룹 권한 편집",7,p20showAddMeshUserDialogEx,n,e):setDialogMode(2,"사용자 장치 그룹 권한 편집",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 o in nodes)nodes[o].meshid==n&&(t+="<option value="+encodeURIComponentEx(nodes[o]._id)+">"+EscapeHtml(nodes[o].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 o=0,i=decodeURIComponent(Q("dp2nodeid").value);""!=i&&null!=currentUser.links&&null!=currentUser.links[i]&&(o=currentUser.links[i].rights),Q("p20remotecontrol").checked=0!=(8&o),Q("p20meshagentconsole").checked=0!=(16&o),Q("p20meshserverfiles").checked=0!=(32&o),Q("p20wakedevices").checked=0!=(64&o),Q("p20editnotes").checked=0!=(128&o),Q("p20remoteview").checked=0!=(256&o),Q("p20noterminal").checked=0!=(512&o),Q("p20nofiles").checked=0!=(1024&o),Q("p20noamt").checked=0!=(2048&o),Q("p20remotelimitedinput").checked=0!=(4096&o),Q("p20limitevents").checked=0!=(8192&o),Q("p20chatnotify").checked=0!=(16384&o),Q("p20uninstall").checked=0!=(32768&o),Q("p20nodesktop").checked=0!=(65536&o),n=""!=i}if(Q("dp20username")){var a=Q("dp20username").value.split(",");for(var s in a){var r=a[s]=a[s].trim();0==r.length?n=!1:0<=r.indexOf('"')&&(n=!1)}var l=!1,d=!1;if(null!=users){var c=a[a.length-1].trim(),u=c.toLowerCase(),p=[];if(0<c.length){for(var s in users){var m=users[s]._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[s].name.toLowerCase().indexOf(u)&&(p.push([users[s]._id,users[s].name]),8<=p.length))break}}if(0==d&&0<p.length){var g="";for(var s in p){var h=p[s][0],v=p[s][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=""!=i,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 o=decodeURIComponent(Q("dp2groupid").value);null!=(a=meshes[o])&&meshserver.send({action:"addmeshuser",meshid:o,meshname:a.name,userids:[currentUser._id],meshadmin:n,remove:2==e})}else if(2===t){var i=decodeURIComponent(Q("dp2groupid").value);null!=(a=meshes[currentMesh._id])&&meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:i,meshadmin:n,remove:2==e})}else if(3===t){var a;o=decodeURIComponent(Q("dp2groupid").value);null!=(a=meshes[o])&&meshserver.send({action:"addmeshuser",meshid:o,meshname:a.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 s=Q("dp20username").value.split(","),r=[];for(var l in s)r.push(s[l].trim());meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,usernames:r,rights:n,remove:2==e})}else if(6===t){i=decodeURIComponent(Q("dp2groupid").value);null!=currentNode&&meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[i],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){s=Q("dp20username").value.split(","),r=[];for(var l in s)r.push(s[l].trim());meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,usernames:r,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),o=GetMeshRights(currentMesh,t);if(userinfo._id!=t&&(4294967295==n||0!=(2&n)&&4294967295!=o))p20showAddMeshUserDialog(e);else{var i=[];4294967295==o?i.push("전체 관리자 (모든 권한)"):(0!=(1&o)&&i.push("장치 그룹 편집"),0!=(2&o)&&i.push("장치 그룹 사용자 관리"),0!=(4&o)&&i.push("장치 그룹 컴퓨터 관리"),0!=(8&o)&&i.push("원격 제어"),0!=(16&o)&&i.push("에이전트 콘솔"),0!=(32&o)&&i.push("서버 파일"),0!=(64&o)&&i.push("장치 깨우기(Wake)"),0!=(128&o)&&i.push("메모 편집"),0!=(8&o)&&0!=(256&o)&&i.push("오직 원격 보기만"),0!=(8&o)&&0!=(65536&o)&&i.push("데스크톱 없음"),0!=(8&o)&&0!=(512&o)&&i.push("터미널이 없습니다."),0!=(8&o)&&0!=(1024&o)&&i.push("파일이 없습니다."),0!=(8&o)&&0!=(2048&o)&&i.push("Intel&reg; AMT 없음"),0!=(8&o)&&0!=(4096&o)&&0==(256&o)&&i.push("제한된 입력"),0!=(8192&o)&&i.push("오직 자체 이벤트만"),0!=(16384&o)&&i.push("채팅 및 알림"),0!=(32768&o)&&i.push("설치 제거")),0==i.length&&i.push("권한이 없습니다.");var a=t.split("/")[2];users&&users[t]&&(a=users[t].name),userinfo._id==t&&(a=userinfo.name);var s=1,r=addHtmlValue("사용자 이름",EscapeHtml(decodeURIComponent(a)));t.split("/")[2]!=a&&(r+=addHtmlValue("사용자 식별자",EscapeHtml(t.split("/")[2]))),r+=addHtmlValue("권한",i.join(", ")),userinfo._id!=t&&(4294967295==n||0!=(2&n)&&4294967295!=o)&&(s+=4),setDialogMode(2,"장치 그룹 사용자",s,p20viewuserEx,r,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,"사용자 권한 제거",3,p20viewuserEx2,format('사용자 "{0}"의 권한을 삭제하시겠습니까?',EscapeHtml(decodeURIComponent(n))),t),t.startsWith("ugrp/")&&setDialogMode(2,"사용자 그룹 권한 제거",3,p20viewuserEx2,format('사용자 그룹 "{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 o="활성화되면, 다음 공개 링크에서 이용된 초대 코드를 사용하여 이 장치 그룹에 장치를 가입시킬 수 있습니다.<br /><br />";o+='<div style=width:100%;text-align:center><a target=_blank href="'+e+'">'+e+"</a></div><br />",o+="<div style=margin-bottom:5px><label><input id=agentJoinCheck type=checkbox onclick=p20editmeshInviteCodeValidate() />초대 코드 사용</label></div>",o+=addHtmlValue("코드 초대",'<input id=agentInviteCode style=width:236px onkeyup=p20editmeshInviteCodeValidate() placeholder="code1, code2, code3" />'),setDialogMode(2,"코드 초대",3,p20editmeshInviteCodeEx,o+=addHtmlValue("설치 유형","<select id=agentInviteType style=width:236px><option value=0>백그라운드 실행 및 대화식</option><option value=2>오직 백그라운드 실행만</option><option value=1>오직 대화식만</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{o="초대 코드는 장치를 이 장치 그룹에 참가시킬 수 있습니다. 누구나 사용할 수 있습니다. 다음 공개 링크를 사용하십시오 : <br /><br />";o+='<div style=width:100%;text-align:center><a target=_blank href="'+e+'">'+e+"</a></div><br />",o+=addHtmlValue("코드 초대",currentMesh.invite.codes.join(", ")),setDialogMode(2,"코드 초대",1,null,o+=addHtmlValue("설치 유형",["백그라운드 실행 및 대화식","오직 백그라운드 실행만","오직 대화식만"][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 />장치가 연결되었습니다.</label></div>","<div><label><input id=p20notifyIntelDeviceDisconnect type=checkbox />장치 연결이 끊어졌습니다.</label></div>","<div><label><input id=p20notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT 데스크탑 및 직렬 이벤트.</label></div>",setDialogMode(2,"알림 설정",3,p20editMeshNotifyEx,"계정 설정에서도 알림 설정을 켜야합니다.<br /><br /><div><label><input id=p20notifyIntelDeviceConnect type=checkbox />장치가 연결되었습니다.</label></div><div><label><input id=p20notifyIntelDeviceDisconnect type=checkbox />장치 연결이 끊어졌습니다.</label></div><div><label><input id=p20notifyIntelAmtKvmActions type=checkbox />Intel&reg; AMT 데스크탑 및 직렬 이벤트.</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:["연결되지 않음","에이전트","인텔 AMT","에이전트 + 인텔 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>없음</i>"),0!=(1&e)&&(t='<span tabindex=0 title="장치 그룹 이름을 편집하려면 여기를 클릭하십시오." 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={},o={},i=[0,0,0,0],a=!1,s=!1,r=!1;for(var l in nodes)nodes[l].meshid==currentMesh._id&&(nodes[l].agent&&(a=!0,null==n[nodes[l].agent.id]?n[nodes[l].agent.id]=1:n[nodes[l].agent.id]++),nodes[l].pwr&&(s=!0,null==o[nodes[l].pwr]?o[nodes[l].pwr]=1:o[nodes[l].pwr]++),0==nodes[l].conn?(r=!0,i[0]++):0!=(6&nodes[l].conn)?(r=!0,0!=(1&nodes[l].conn)?i[3]++:i[2]++):0!=(1&nodes[l].conn)&&(r=!0,i[1]++));var d=[],c=[],u=[],p=[];for(var l in n)d.push(n[l]),c.push(agentsStr[l]);for(var l in o)u.push(o[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=i,window.meshConnChart.update();var m="",g=0;if(0<u.length){var h=[];for(var l in o)h.push([powerStatetable[l],o[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>전원 상태</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>에이전트 유형들</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(r){var f=[];for(l=g=0;l<4;l++)f.push([["연결되지 않음","에이전트","인텔 AMT","에이전트 + 인텔 AMT"][l],i[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>연결성</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>이 장치 그룹에 장치가 없습니다.</i>"),QH("p21info",m),QS("meshPowerChartDiv").display=s?"inline-block":"none",QS("meshOsChartDiv").display=2==currentMesh.mtype&&a?"inline-block":"none",QS("meshConnChartDiv").display=r?"inline-block":"none"}}var sortorder,filetreelocation=[];function updateFiles(){if(QV("MainMenuMyFiles",0==(8&features)),0==(8&features)){for(var e,t="",n="",o='<a href=# style=cursor:pointer onclick="return p5folderup(0)">최상위폴더</a>',i="Root",a=filetree,s=1,r=[],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==a.f||null==a.f[filetreelocation[u]])break;if(r.push(filetreelocation[u]),i+=" / "+filetreelocation[u],1==s){var p=filetreelocation[u].split("/");e=(""+window.location).split("?")[0]+p[0]+"files/"+p[2],filetreelinkpath+=filetreelocation[u]}else""!=filetreelinkpath&&(filetreelinkpath+="/"+filetreelocation[u],2<s&&(e+="/"+filetreelocation[u]));o+=' / <a href=# style=cursor:pointer onclick="return p5folderup('+s+')">'+(null!=(a=a.f[filetreelocation[u]]).n?a.n:filetreelocation[u])+"</a>",s++}filetreelocation=r;var m=i.toLowerCase().startsWith("root / "+userinfo._id+" / public"),g=p5sort_files(a.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 x="";null!=v.s&&(x=getFileSizeStr(v.s));var y="";if(v.t<3||4==v.t){y='<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 b=h,w="";m&&(w='<img src="images/link2.png" style=cursor:pointer title="공개 링크 표시" onclick=\'return p5showPublicLink("'+e+"/"+encodeURIComponentEx(v.nx)+'?download=1")\' width=10 height=10 /> <img src="images/link4.png" title="링크를 클립보드에 복사" style="cursor:pointer" onclick=copyTextToClip2("'+encodeURIComponentEx(e+"/"+encodeURIComponentEx(v.nx)+"?download=1")+'") width=10 height=10>'),0<v.s&&(b=w+' <a rel="noreferrer noopener" target="_blank" download href="downloadfile.ashx?link='+encodeURIComponentEx(filetreelinkpath+"/"+v.nx)+'">'+h+"</a>"),y='<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>"+x+"</span><span><div class=fileIcon"+v.t+"></div>"+b+"</span></div>"}v.t<3?t+=y:n+=y}if(QH("p5rightOfButtons",p5getQuotabar(a)),QH("p5files",t+n),QH("p5currentpath",o),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?"저장 용량 한도 초과":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 getNiceSize2(e){return e<=0?"없음":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("{1} 파일에서 {0} k. 최대 {2}k",t,e.c,Math.floor(e.maxbytes/1024/1024)):format("1 개의 파일에서 {0} k. 최대 {1} k ",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,"공개 링크",1,null,'<input type=text style=width:350px value="'+e+'" readonly /> <img src="images/link4.png" title="링크를 클립보드에 복사" 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 o in e)e[o].nx=o,null==e[o].n&&(e[o].n=o),e[o].ln=e[o].n.toLowerCase(),t.push(e[o]);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?"선택하지 않음":"모두 선택",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"),o=0;o<n.length;o++)!n[o].checked||0==e&&"3"!=n[o].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 o in e.f)setupBackPointers(e.f[o]),(e.f[o].parent=e).f[o].s&&(t+=e.f[o].s),e.f[o].c&&(n+=e.f[o].c),3==e.f[o].t&&n++;e.s=t,e.c=n}return e}function getFileSizeStr(e){return 1==e?"1바이트":format("{0} B",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,"새 폴더",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>재귀 삭제</label><br>":"<input type=checkbox id=p5recdeleteinput style='display:none'>";setDialogMode(2,"삭제",3,p5deletefileEx,1<e?format("선택한 항목 {0}을 삭제하시겠습니까?",e)+t:"선택한 항목을 삭제 하시겠습니까?"+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,"이름 바꾸기",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=/^\./,o=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function(e){return t.test(e)&&!n.test(e)&&!o.test(e)&&"."!=e[0]}}();function p5uploadFile(){setDialogMode(2,"파일 업로드",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')\" />덮어쓰시겠습니까?</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 o=filetree,i=[],a=0;for(var n in filetreelocation)null!=o.f&&null!=o.f[filetreelocation[n]]&&(o=o.f[filetreelocation[n]]);if(QE("idx_dlgOkButton",0<e.length),0<e.length){if(null!=o.f){for(var n in o.f)i.push(n);for(n=0;n<e.length;n++)0<=i.indexOf(e[n].name)&&a++}QV("p5confirmOverwriteSpan",0<a),0<a?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("{2} 항목 {1}의 {0}을 이 위치로 확정하시겠습니까?",0==p5clipboardCut?"copy":"move",p5clipboard.length,1<p5clipboard.length?"s":"")),setDialogMode(2,"붙여넣기",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("{2}에 대해 {1} 항목 {0}을 보유",p5clipboard.length,1<p5clipboard.length?"s":"",0==p5clipboardCut?"복사":"이동")+', <a href=# onclick="return p5clearClip()" style=cursor:pointer>지우기</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 o=filetree,i=[],a=0;for(var n in filetreelocation)null!=o.f&&null!=o.f[filetreelocation[n]]&&(o=o.f[filetreelocation[n]]);if(null!=o.f){for(var n in o.f)i.push(n);for(n=0;n<e.dataTransfer.files.length;n++)0<=i.indexOf(e.dataTransfer.files[n].name)&&a++}0==a?p5PerformUpload(1,t):setDialogMode(2,"파일 업로드",3,p5PerformUpload,format(1==a?"업로드하면 파일 1개를 덮어씁니다. 계속할까요?":"업로드하면 {0} 파일을 덮어씁니다. 계속할까요?",a),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 o=[],i=[],a=[],s=[],r=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];o.push(u.name),i.push(u.size),a.push(u.type),c.onload=function(e){s.push(e.target.result),0==--r&&(Q("p5fileDragName").value=o.join("*"),Q("p5fileDragSize").value=i.join("*"),Q("p5fileDragType").value=a.join("*"),Q("p5fileDragData").value=s.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 o=events[n],i=new Date(o.time);if(o.msg){null==o.h&&(o.h=Math.random()),printDate(i)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(i))+"</td></tr>");var a="si3";"ugrp"==o.etype&&(a="m4"),"user"==o.etype&&(a="m2"),"server"==o.etype&&(a="si3");var s=EscapeHtml(o.msg).split("(R)").join("&reg;");if(o.nodeid){var r=getNodeFromId(o.nodeid);null!=r&&(a="si"+r.icon,s="<a href=# onclick='gotoDevice(\""+o.nodeid+"\",10);haltEvent(event);'>"+EscapeHtml(r.name)+"</a> &rarr; "+s)}o.username&&(s=2&userinfo.siteadmin&&o.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(o.userid)+"\");haltEvent(event);'>"+EscapeHtml(o.username)+"</a> &rarr; "+s:EscapeHtml(o.username)+" &rarr; "+s),"relay"!=o.etype&&"relaylog"!=o.action||(a="relayIcon16"),e+="<tr onclick=showEventDetails("+o.h+",2)  onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+a+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(i)+" - "+s+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>이벤트가 없습니다.</i><br><br>"),QH("p3events",e)}function refreshEvents(){meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)})}function p3showDownloadEventsDialog(e){if(!xxdialogMode){var t="아래 파일 형식 중 하나를 사용하여 이벤트 목록을 다운로드하십시오.<br /><br />";t+=addHtmlValue("CSV 형식",'<a href=# style=cursor:pointer onclick="return p3downloadEventsDialogCSV('+e+')">eventslist.csv</a>'),setDialogMode(2,"이벤트 목록 내보내기",1,null,t+=addHtmlValue("JSON 형식",'<a href=# style=cursor:pointer onclick="return p3downloadEventsDialogJSON('+e+')">eventslist.json</a>'),e)}}function p3downloadEventsDialogCSV(e){var t,n;for(var o in 1==e&&(n=currentDeviceEvents),2==e&&(n=events),3==e&&(n=currentUserEvents),t="utc, 시간, 유형, 행동, 사용자, 장치, 메시지\r\n",n){var i="";if(n[o].nodeid){var a=getNodeFromId(n[o].nodeid);a&&a.name&&(i=a.name)}t+='"'+n[o].time+'","'+printDateTime(new Date(n[o].time))+'","'+n[o].etype+'","'+(null!=n[o].action?n[o].action:"")+'","'+(null!=n[o].username?n[o].username:"")+'","'+EscapeHtml(i)+'","'+(null!=n[o].msg?n[o].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 o in 1==e&&(t=currentDeviceEvents),2==e&&(t=events),3==e&&(t=currentUserEvents),t)n.push(events[o]);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 o in users)e.push(users[o]);e.sort(nameSort);var i=Q("UserSearchInput").value.toLowerCase(),a=i;i.startsWith("email:")?(i=null,a=a.substring(6)):i.startsWith("name:")?(a=null,i=i.substring(5)):i.startsWith("e:")?(i=null,a=a.substring(2)):i.startsWith("n:")&&(a=null,i=i.substring(2));var s="<table class=p3usersTable cellpadding=0 cellspacing=0>",r=!0;s+="<th>이름<th style=width:80px>장치 그룹<th style=width:120px>"+nobreak("마지막 접근")+"<th style=width:120px>권한";var l=[],d=document.getElementsByClassName("UserCheckbox");for(o=0;o<d.length;o++)d[o].checked&&l.push(d[o].value);for(var o in e){var c=e[o],u=null;null!=wssessions&&(u=wssessions[c._id]),null!=u&&(null!=i&&(""==i||0<=c.name.toLowerCase().indexOf(i))||null!=a&&null!=c.email&&0<=c.email.toLowerCase().indexOf(a))&&(0<t?(r&&(s+="<tr><td class=userTableHeader colspan=4>온라인 사용자",r=!1),s+=addUserHtml(c,u),t--):n++)}for(var o in r=!0,e){c=e[o],u=null;null!=wssessions&&(u=wssessions[c._id]),null==u&&(null!=i&&(""==i||0<=c.name.toLowerCase().indexOf(i))||null!=a&&null!=c.email&&0<=c.email.toLowerCase().indexOf(a))&&(0<t?(r&&(s+="<tr><td class=userTableHeader colspan=4>오프라인 사용자",r=!1),s+=addUserHtml(c,u),t--):n++)}s+="</table>",1==n?s+="<br />1명 이상의 사용자가 표시되지 않습니다. 검색 창을 사용하여 사용자를 찾으십시오.<br />":1<n&&(s+="<br />"+format("{0}명의 사용자가 더 이상 표시되지 않습니다. 검색창을 사용하여 사용자를 찾으십시오...",n)+"<br />"),100==t&&(s+="<br />사용자가 없습니다.<br />"),QH("p3users",s),d=document.getElementsByClassName("UserCheckbox");var p=encodeURIComponentEx(userinfo._id);for(o=0;o<d.length;o++)d[o].checked=0<=l.indexOf(d[o].value)&&d[o].value!=p;p3updateInfo(),null!=currentUser&&30==xxcurrentView&&gotoUser(encodeURIComponentEx(currentUser._id),!0)}else QH("p3users","")}function addUserHtml(e,t){var n="",o=" gray",i="",a=e._id!=userinfo._id,s="",r="";null!=t?(o="",a&&(i='<span style=float:right;margin-top:1px;margin-right:4px title=채팅><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>",i+="<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>"),s+=nobreak(1==t?"1세션":format("{0} 세션",t))):e.login&&(s+='<span title="'+format("마지막 로그인 : {0}",printDateTime(new Date(1e3*e.login)))+'">'+printDate(new Date(1e3*e.login))+"</span>"),a&&(r+="<a href=# style=cursor:pointer onclick='return showUserAdminDialog(event,\""+encodeURIComponentEx(e._id)+"\")'>"),null!=e.siteadmin&&0!=(32&e.siteadmin)&&4294967295!=e.siteadmin&&(r+="잠김,&nbsp;"),r+="<span title='서버 권한'>";var l=4294967071&e.siteadmin;null==e.siteadmin||0==l?r+="사용자":8==l?r+="사용자 + 파일":4294967295==e.siteadmin?r+="관리자":r+=0!=(2&l)?"관리자":"부분",null!=e.siteadmin&&4294967295!=e.siteadmin&&0!=(192&e.siteadmin)&&(r+="*"),r+="</span>",a&&(r+="</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="이메일이 검증되지 않았습니다.">&#x2717;</b>':' <b style=color:green title="이메일 검증">&#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="사용자에게 이메일을 보냅니다." 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="2단계 인증 활성화됨" style="margin-top:2px" />'),null!=e.phone&&(u+=' <img src="images/phone12.png" height=12 width=7 title="검증된 휴대폰 번호" 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="계정이 잠겼습니다." 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'+o+'"></div></div>',n+="<div class=g1></div><div class=g2></div><div>",n+="<div><span>"+u+"</span>"+i+"</div></div><td style=text-align:center>"+d+"<td style=text-align:center>"+s+"<td style=text-align:center>"+r}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?"선택하지 않음":"모두 선택"}function p3usersSelectallButtonFunction(){for(var e=encodeURIComponentEx(userinfo._id),t=document.getElementsByClassName("UserCheckbox"),n=0,o=0;o<t.length;o++)!0===t[o].checked&&n++;for(o=0;o<t.length;o++)t[o].checked=0==n&&t[o].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 o="선택한 모든 사용자에 대해 수행할 작업을 선택하십시오.<br /><br />";setDialogMode(2,"그룹 동작",3,p3usersGroupActionFunctionEx,o+=addHtmlValue("조작","<select style=width:240px id=d3groupop><option value=1>계정 잠금</option><option value=2>잠겨있지 않은 계정</option><option value=3>계정 삭제</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 o=Q("d3groupop").value;if(1==o)for(var n in t){0==(32&(a=null==(i=users[t[n]]).siteadmin?0:i.siteadmin))&&(a+=32,meshserver.send({action:"edituser",id:i._id,siteadmin:a}))}else if(2==o)for(var n in t){var i,a;0!=(32&(a=null==(i=users[t[n]]).siteadmin?0:i.siteadmin))&&(a-=32,meshserver.send({action:"edituser",id:i._id,siteadmin:a}))}else if(3==o){"<label><input id=d3check type=checkbox onchange=p3usersGroupActionFunctionDelCheck() />확인</label>",setDialogMode(2,"여러 계정 삭제",3,p3groupActionFunctionDelExec,"선택된 계정을 삭제하시겠습니까?<br /><br /><label><input id=d3check type=checkbox onchange=p3usersGroupActionFunctionDelCheck() />확인</label>"),QE("idx_dlgOkButton",!1)}}function p3usersGroupActionFunctionDelCheck(){QE("idx_dlgOkButton",Q("d3check").checked)}function p3groupActionFunctionDelExec(e){for(var t=document.getElementsByClassName("UserCheckbox"),n=[],o=0;o<t.length;o++)!0===t[o].checked&&n.push(decodeURIComponent(t[o].value));for(var o in n){var i=users[n[o]];meshserver.send({action:"deleteuser",userid:i._id,username:i.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 o="/messenger?id=meshmessenger/"+t+"/"+encodeURIComponentEx(userinfo._id)+"&title="+n;return null!=authCookie&&""!=authCookie&&(o+="&auth="+authCookie),window.open(o,"meshmessenger:"+t),meshserver.send({action:"meshmessenger",userid:decodeURIComponent(t)}),!1}function showSendSMS(e){xxdialogMode||(setDialogMode(2,"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}에게 알림",EscapeHtml(users[decodeURIComponent(t)].name)),3,showUserAlertDialogEx,'이 사용자에게 문자 알림을 보냅니다.<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,"사용자 계정 가져 오기",3,p4batchAccountCreateEx,'다음 형식의 JSON 파일을 가져 와서 한 번에 많은 계정을 만듭니다.<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,"사용자 계정 가져 오기",1,null,format("유효하지 않은 JSON 파일 : {0}.",e))}if(null!=t&&Array.isArray(t)){var n=!0;for(var o in t)("string"!=typeof t[o].user||t[o].user.length<1||64<t[o].user.length)&&(n=!1),("string"!=typeof t[o].pass||t[o].pass.length<1||256<t[o].pass.length)&&(n=!1),0==checkPasswordRequirements(t[o].pass,passRequirements)&&(n=!1),null!=t[o].email&&("string"!=typeof t[o].email||t[o].email.length<1||128<t[o].email.length)&&(n=!1);0==n?setDialogMode(2,"사용자 계정 가져 오기",1,null,"유효하지 않은 JSON 파일 형식입니다."):meshserver.send({action:"adduserbatch",users:t})}else setDialogMode(2,"사용자 계정 가져 오기",1,null,"유효하지 않은 JSON 파일 형식입니다.")},e.readAsText(Q("d4importFile").files[0])}function p4downloadUserInfo(){if(!xxdialogMode){var e="아래 파일 형식 중 하나를 가진 사용자 목록을 다운로드하십시오.<br /><br />";e+=addHtmlValue("CSV 형식","<a href=# style=cursor:pointer onclick='return p4downloadUserInfoCSV()'>userlist.csv</a>"),setDialogMode(2,"사용자 목록 내보내기",1,null,e+=addHtmlValue("JSON 형식","<a href=# style=cursor:pointer onclick='return p4downloadUserInfoJSON()'>userlist.json</a>"))}}function p4downloadUserInfoCSV(){var e="아이디, 이름, 이메일, 생성, 마지막 로그인, 그룹, 인증앱\r\n";for(var t in users){var n=!1,o=[];(0<users[t].otpsecret||0<users[t].otphkeys)&&(n=!0,0<users[t].otpsecret&&o.push("AuthApp"),0<users[t].otphkeys&&o.push("SecurityKey"),0<users[t].otpkeys&&o.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?o.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,"방송 메세지",3,showUserBroadcastDialogEx,'연결된 모든 사용자에게 메시지를 전달합니다.<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>사용자 이름</span>","<input id=p4name maxlength=64 autocomplete=username onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />")),e+=addHtmlValue("<span id=p4hemail>이메일</span>",'<input id=p4email maxlength=256 autocomplete="email" inputmode="email" onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />'),e+=addHtmlValue("<span id=p4hp1>암호</span>",'<input id=p4pass1 type=password maxlength=256 autocomplete="new-password" onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />'),e+=addHtmlValue("<span id=p4hp2>암호</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 />비밀번호를 무작위로 지정하십시오.</label></div>",e+="<div><label><input id=p4removeEvents onchange=showCreateNewAccountDialogValidate() type=checkbox />이 사용자 ID에 대한 과거 이벤트를 모두 제거하십시오.</label></div>",e+="<div><label><input id=p4resetNextLogin onchange=showCreateNewAccountDialogValidate() type=checkbox />다음에 로그인 할 때 비밀번호를 강제로 재설정하십시오.</label></div>",serverinfo.emailcheck&&(e+="<div><label><input id=p4verifiedEmail onchange=showCreateNewAccountDialogValidate() type=checkbox />이메일이 검증되었습니다.</label></div>",e+="<div><label><input id=p4invitationEmail type=checkbox title=Email verified and forced password reset required. />초대 이메일을 보냅니다.</label></div>"),passRequirements){var o=[],i=0;for(var n in passRequirements)"reset"!=n&&"hint"!=n&&(o.push(n+":"+passRequirements[n]),i++);0<i&&(e+="<div style=font-size:x-small;padding:6px>"+format("요구사항 : {0}.",o.join(", "))+"</div>")}setDialogMode(2,"계정 만들기",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 o=t&e;0==Q("p4randomPassword").checked&&(o&=n),QE("idx_dlgOkButton",o)}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()],o="";null!=n.groups&&(o=n.groups.join(", "));var i="쉼표로 구분된 관리 영역 이름의 목록을 입력하십시오.<br /><br />";return setDialogMode(2,"관리 영역",3,showUserGroupDialogEx,i+=addHtmlValue("영역",'<input id=dp4usergroups style=width:230px value="'+o+'" placeholder="이름1, 이름2, 이름3" 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("'"),o=e.split(",");for(var i in o)0==o[i].trim().length&&t++;QE("idx_dlgOkButton",""==e||-5==n&&t<1)}function showUserGroupDialogEx(e,t){var n=Q("dp4usergroups").value.split(","),o=[];for(var i in n){var a=n[i].trim();0<a.length&&o.push(a)}meshserver.send({action:"edituser",id:t._id,groups:o})}function showUserAdminDialog(e,t){if(!xxdialogMode){haltEvent(e),t=decodeURIComponent(t);var n=users[t.toLowerCase()];if(null!=n){var o=userinfo._id==n._id;return"<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>서버 파일</label>, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 id=ua_fileaccessquota>k 최대값, 공란으로 두면 기본값으로 적용됩니다.<br><hr/>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>전체 관리자</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>서버 백업</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>서버 복원</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>서버 업데이트</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>사용자 관리</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusergroups>사용자 그룹 관리</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>계정 잠금</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nonewgroups>새로운 장치 그룹이 없습니다.</label><br>","<label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nomeshcmd>도구가 없습니다. (MeshCmd / Router)</label><br>","</div>",setDialogMode(2,"서버 권한",2+(o?0:1),showUserAdminDialogEx,"<div><div id=d2AdminPermissions><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>서버 파일</label>, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 id=ua_fileaccessquota>k 최대값, 공란으로 두면 기본값으로 적용됩니다.<br><hr/><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>전체 관리자</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>서버 백업</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>서버 복원</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>서버 업데이트</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>사용자 관리</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusergroups>사용자 그룹 관리</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>계정 잠금</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nonewgroups>새로운 장치 그룹이 없습니다.</label><br><label><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_nomeshcmd>도구가 없습니다. (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",!o&&4294967295==userinfo.siteadmin),QE("ua_serverbackup",!o&&4294967295==userinfo.siteadmin),QE("ua_manageusers",!o&&4294967295==userinfo.siteadmin),QE("ua_manageusergroups",!o&&4294967295==userinfo.siteadmin),QE("ua_managerecordings",!o&&4294967295==userinfo.siteadmin),QE("ua_serverrestore",!o&&4294967295==userinfo.siteadmin),QE("ua_fileaccess",!o&&4294967295==userinfo.siteadmin),QE("ua_fileaccessquota",!o&&4294967295==userinfo.siteadmin),QE("ua_serverupdate",!o&&4294967295==userinfo.siteadmin),QV("d2AdminPermissions",4294967295==userinfo.siteadmin),QE("ua_lockedaccount",!o&&2&userinfo.siteadmin&&4294967295!=n.siteadmin&&userinfo._id!=n._id),QE("ua_nonewgroups",!o&&2&userinfo.siteadmin&&4294967295!=n.siteadmin&&userinfo._id!=n._id),QE("ua_nomeshcmd",!o&&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,o=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 i={action:"edituser",id:t._id,siteadmin:n};0==isNaN(o)&&(i.quota=1024*o),meshserver.send(i)}function onUserSearchInputChanged(){masterUpdate(16384)}function updateUserGroups(){var e=[],t="";if(usergroups)for(var n in usergroups)e.push(usergroups[n]);e.sort(nameSort);var o=[],i=document.getElementsByClassName("UserGroupCheckbox");for(n=0;n<i.length;n++)i[n].checked&&o.push(i[n].value);if(0==e.length)t+="<br />그룹이 없습니다.<br />",QV("DuplicateUserGroupButton",!1);else{for(var n in t+="<table class=p3usersTable cellpadding=0 cellspacing=0>",t+="<th>이름<th style=width:80px>사용자<th style=width:80px>장치 그룹<th style=width:80px>여러 장치",e)t+=addUserGroupHtml(e[n]);t+="</table>",QV("DuplicateUserGroupButton",!0)}QH("p50groups",t),i=document.getElementsByClassName("UserGroupCheckbox");for(n=0;n<i.length;n++)i[n].checked=0<=o.indexOf(i[n].value);p50updateInfo(),null!=currentUserGroup&&51==xxcurrentView&&gotoUserGroup(encodeURIComponentEx(currentUserGroup._id),!0)}function addUserGroupHtml(e){var t=0,n=0,o=0;if(e.links)for(var i in e.links)i.startsWith("user/")&&t++,i.startsWith("mesh/")&&n++,i.startsWith("node/")&&o++;var a=EscapeHtml(e.name);if(null!=serverinfo.crossDomain){var s=e._id.split("/")[1];""!=s&&(a+=", <span style=color:#26F>"+EscapeHtml(s)+"</span>")}var r="<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 r+="<div class=bar style=width:100%>",r+="<div class=baricon><input class=UserGroupCheckbox value="+encodeURIComponentEx(e._id)+" onclick=p50updateInfo() type=checkbox></div>",r+='<div class=baricon onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")><div class=m4></div></div>',r+='<div class=g1 onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")></div><div class=g2 onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")></div>',r+='<div onclick=gotoUserGroup("'+encodeURIComponentEx(e._id)+'")><span style=font-size:16px>'+a+"</span></div></div><td style=text-align:center>"+t+"<td style=text-align:center>"+n+"<td style=text-align:center>"+o}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?"선택하지 않음":"모두 선택"}function p50usersSelectallButtonFunction(){for(var e=encodeURIComponentEx(userinfo._id),t=document.getElementsByClassName("UserGroupCheckbox"),n=0,o=0;o<t.length;o++)!0===t[o].checked&&n++;for(o=0;o<t.length;o++)t[o].checked=0==n&&t[o].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 o="선택한 모든 사용자에 대해 수행할 작업을 선택하십시오.<br /><br />";setDialogMode(2,"그룹 동작",3,p50usersGroupActionFunctionEx,o+=addHtmlValue("조작","<select style=width:240px id=d50groupop><option value=1>그룹 삭제</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() />확인</label>",setDialogMode(2,"여러 사용자 그룹 삭제",3,p50groupActionFunctionDelExec,"선택된 사용자 그룹을 삭제하시겠습니까?<br /><br /><label><input id=d3check type=checkbox onchange=p50usersGroupActionFunctionDelCheck() />확인</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 o in usergroups)n+="<option value="+encodeURIComponentEx(o)+">"+EscapeHtml(usergroups[o].name)+"</option>";t+=addHtmlValue("사용자 그룹","<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 o in serverinfo.crossDomain)n+="<option value="+o+">"+(""==serverinfo.crossDomain[o]?"Default":EscapeHtml(serverinfo.crossDomain[o]))+"</option>";t+=addHtmlValue("Domain",n+="</select>")}t+=addHtmlValue("이름","<input id=p4name maxlength=64 onchange=showCreateUserGroupDialogValidate() onkeyup=showCreateUserGroupDialogValidate() />"),setDialogMode(2,1==e?"사용자 그룹 생성":"사용자 그룹 복제",3,showCreateUserGroupDialogEx,t+=addHtmlValue("설명",'<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 o=EscapeHtml(n.name);0==o.length&&(o="<i>없음</i>"),0!=(256&userinfo.siteadmin)&&(o='<span tabindex=0 title="사용자 그룹 이름을 편집하려면 여기를 클릭하십시오." onclick=p51editgroup(1) onkeyup="if (event.key == \'Enter\') p51editgroup(1)" style=cursor:pointer>'+o+' <img class=hoverButton src="images/link5.png" /></span>'),QH("p51groupName",o);var i=0,a=0,s=0;if(n.links)for(var r in n.links)r.startsWith("user/")&&i++,r.startsWith("mesh/")&&a++,r.startsWith("node/")&&s++;var l=n.desc;l=null==l||""==l?"<i>없음<i>":EscapeHtml(l);var d="<div style=min-height:80px><table style=width:100%>";if(0!=(8&args.hide)&&(d+="<br />"+addDeviceAttribute("이름",o)),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("설명","<span onclick=p51editgroup(2) style=cursor:pointer>"+l+' <img class=hoverButton src="images/link5.png" /></span>'):d+=addDeviceAttribute("설명",l),d+=addDeviceAttribute("사용자",i),d+=addDeviceAttribute("장치 그룹",a),d+=addDeviceAttribute("여러 장치",s),d+="</table></div><br />",0!=(256&userinfo.siteadmin)&&(d+='<input type=button value="방송" title="이 그룹의 모든 사용자에게 알림을 보냅니다." 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> 사용자 추가</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>그룹 멤버</th><th scope=col style=text-align:left></th></tr>';var u=1,p=[];for(var r in currentUserGroup.links)if(0!=r.startsWith("user/")){var m=r.split("/")[2];currentUserGroup.links[r].name&&(m=currentUserGroup.links[r].name),r==userinfo._id&&(m=userinfo.name),p.push({id:r,name:m,rights:currentUserGroup.links[r].rights})}for(var r 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[r].id)+'")\' title="이 장치 그룹에 대한 사용자 권한 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',h=EscapeHtml(decodeURIComponent(p[r].name));null!=users&&(h="<a href=# onclick='gotoUser(\""+encodeURIComponentEx(p[r].id)+"\");haltEvent(event);'>"+h+"</a>"),d+="<tr "+(u%2==0?"style=background-color:#DDD":"")+'><td><div title="사용자" 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>회원이 없습니다.</i><div></div></div></td><td></td></tr>"),d+="</tbody></table><br />";var v=0,f=!(u=1);for(var r in meshes)currentUserGroup._id.split("/")[1]==meshes[r]._id.split("/")[1]&&(v++,null!=currentUserGroup.links&&null!=currentUserGroup.links[r]||(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> 장치 그룹 추가</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>공유된 장치 그룹들</th><th scope=col style=text-align:left></th></tr>',currentUserGroup.links){var k=[];for(var r in currentUserGroup.links)r.startsWith("mesh/")&&null!=meshes[r]&&k.push(meshes[r]);for(var r in k=getOrderedList(k,"name")){var x=0,y=k[r],b=(g="",makeDeviceGroupRightsString(currentUserGroup.links[y._id].rights));userinfo.links&&null!=userinfo.links[y._id]&&null!=userinfo.links[y._id].rights&&(x=userinfo.links[y._id].rights);var w="<i>알 수 없는 장치 그룹</i>";y&&(w="<a href=# onclick='gotoMesh(\""+y._id+"\");haltEvent(event);'>"+y.name+"</a>"),0!=(2&x)&&(g="<a href=# onclick='return p51removeMeshFromUserGroup(event,\""+encodeURIComponentEx(y._id)+'")\' title="이 장치 그룹에 대한 사용자 그룹 권한 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',b='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(3,"'+encodeURIComponentEx(y._id)+'")>'+b+" <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="장치 그룹" class=m99></div><div>&nbsp;'+w+"<div></div></div></td><td style=width:70%><div style=float:right>"+g+"</div><div>"+b+"</div></td></tr>"}}if(1==u&&(d+="<tr><td><div style=padding:6px>&nbsp;<i>공유된 장치 그룹이 없습니다.</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> 장치 추가</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>공유된 장치</th><th scope=col style=text-align:left></th></tr>',currentUserGroup.links){var C=[];for(var r in currentUserGroup.links){if(r.startsWith("node/"))null!=(Q=getNodeFromId(r))&&C.push(Q)}for(var r in C=getOrderedList(C,"name")){var Q=C[r],D=(g="",b=makeUserDeviceRightsString(currentUserGroup.links[Q._id].rights),x=GetNodeRights(Q),"<i>알 수 없는 장치</i>");Q&&(D="<a href=# onclick='gotoDevice(\""+Q._id+"\");haltEvent(event);'>"+Q.name+"</a>"),0!=(2&x)&&(g="<a href=# onclick='return p51removeDeviceFromUserGroup(event,\""+encodeURIComponentEx(Q._id)+'")\' title="이 장치에 대한 사용자 그룹 권한을 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',b='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(7,"'+encodeURIComponentEx(Q._id)+'")>'+b+" <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="장치 그룹" class=m99></div><div>&nbsp;'+D+"<div></div></div></td><td style=width:70%><div style=float:right>"+g+"</div><div>"+b+"</div></td></tr>"}}1==u&&(d+="<tr><td><div style=padding:6px>&nbsp;<i>공유된 장치가 없습니다.</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>사용자 그룹 삭제</a></span></div>"),QH("p51group2",d),go(51);var M="";if(0==(268435456&features)&&51<=xxcurrentView&&xxcurrentView<=59&&null!=currentUserGroup){for(var r in M="?viewmode="+xxcurrentView+"&gotougrp="+(serverinfo.crossDomain?currentUserGroup._id:currentUserGroup._id.split("/")[2]),urlargs)M+="&"+r+"="+urlargs[r];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,"장치 권한 제거",3,p51removeDeviceFromUserGroupEx,format('"{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,"장치 그룹 권한 제거",3,p51removeMeshFromUserGroupEx,format('장치 그룹 "{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("이름","<input id=dp51name style=width:230px maxlength=32 onchange=p51editgroupValidate() onkeyup=p51editgroupValidate(event) />");setDialogMode(2,"사용자 그룹 편집",3,p51editgroupEx,t+=addHtmlValue("설명","<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("사용자 그룹 {0}을 삭제하시겠습니까?",EscapeHtml(currentUserGroup.name))+"<br /><br />";return setDialogMode(2,"사용자 그룹 삭제",3,p51showDeleteUserGroupDialogEx,e+="<label><input id=p51check type=checkbox onchange=p51validateDeleteGroupDialog() />확인</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,"사용자 회원권 제거",3,p51viewuserEx2,format('사용자 "{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="사용자가 이 장치 그룹 및 그룹 내 장치를 관리 할 수 ​​있도록 허락합니다.";return 524288&features&&(e+=" 장치 그룹에 추가하려면 이 서버에 한 번 로그인 해야합니다."),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,"사용자 그룹에 사용자 추가",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 o=t[n]=t[n].trim();0==o.length?e=!1:0<=o.indexOf('"')&&(e=!1)}var i=!1,a=!1;if(null!=users){var s=t[t.length-1].trim(),r=s.toLowerCase(),l=[];if(0<s.length){for(var n in users){var d=users[n]._id.split("/");if(currentUserGroup.domain==d[1]&&d[2]===r){a=!0;break}if(0<=users[n].name.toLowerCase().indexOf(r)&&currentUserGroup.domain==d[1]&&(l.push([users[n]._id,users[n].name]),8<=l.length))break}if(0==a&&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),i=!0}}}QV("dp51usersuggest",i)}QE("idx_dlgOkButton",e)}function p51showAddUserDialogEx(e,t){if(null==t){var n=Q("dp51username").value.split(","),o=[];for(var i in n)o.push(n[i].trim());meshserver.send({action:"addusertousergroup",ugrpid:currentUserGroup._id,usernames:o})}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 o=currentUser=users[decodeURIComponent(e)];if(null==o)return setDialogMode(0),void go(4);QH("p30userName",o.name),QH("p31userName",o.name);var i=o._id==userinfo._id,a=0;null!=wssessions&&wssessions[o._id]&&(a=wssessions[o._id]),Q("MainUserImage").classList.remove("gray"),0==a&&Q("MainUserImage").classList.add("gray");var s=o._id.split("/")[2];s.startsWith("~twitter:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/twitter64.png"):s.startsWith("~google:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/google64.png"):s.startsWith("~github:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/github64.png"):s.startsWith("~reddit:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/reddit64.png"):s.startsWith("~azure:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/azure64.png"):s.startsWith("~jumpcloud:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/jumpcloud64.png"):s.startsWith("~intel:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/intel64.png"):s.startsWith("~:")?(QV("p30userAuthServiceLogo",!0),Q("p30userAuthServiceLogo").src="images/login/generic64.png"):QV("p30userAuthServiceLogo",!1);var r=[],l="";null!=o.siteadmin&&0!=(32&o.siteadmin)&&4294967295!=o.siteadmin&&(l='<img src="images/padlock12.png" height=12 width=8 title="계정이 잠겼습니다." style="margin-top:2px" /> ',r.push("잠긴 계정")),null==o.siteadmin||0==(4294967071&o.siteadmin)?r.push("서버 권한이 없습니다."):8==o.siteadmin?r.push("서버 파일에 접근"):4294967295==o.siteadmin?r.push("전체 관리자"):r.push("부분적인 권리"),null!=o.siteadmin&&4294967295!=o.siteadmin&&0!=(192&o.siteadmin)&&r.push("제한사항");var d="<div style=min-height:80px><table style=width:100%>";0!=(8&args.hide)&&(d+="<br />"+addDeviceAttribute("이름",o.name));var c=o.email?EscapeHtml(o.email):"<i>설정되지 않음</i>",u="";if(serverinfo.emailcheck&&(u=1==o.emailVerified?'<b style=color:green;cursor:pointer title="이메일 검증">&#x2713</b> ':'<b style=color:red;cursor:pointer title="검증되지 않은 이메일">&#x2717;</b> '),serverinfo.crossDomain||0!=debugmode){var p=o._id.split("/")[1];d+=addDeviceAttribute("Domain",""!=p?EscapeHtml(p):"<i>Default</i>"),d+=addDeviceAttribute("사용자 식별자",EscapeHtml(o._id))}else o.name.toLowerCase()!=o._id.split("/")[2]&&(d+=addDeviceAttribute("사용자 식별자",EscapeHtml(o._id.split("/")[2])));4294967295!=o.siteadmin||4294967295==userinfo.siteadmin?d+=addDeviceAttribute("이메일",u+c+' <a href="mailto:'+o.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("이메일",u+c+' <a href="mailto:'+o.email+'" \'><img class=hoverButton src="images/link1.png" /></a>'),(33554432&features||null!=o.phone)&&(d+=addDeviceAttribute("휴대폰 번호",(o.phone?o.phone:"<i>없음</i>")+' <img class=hoverButton style=cursor:pointer src="images/link5.png" onclick=p30editPhone() />')),d+=addDeviceAttribute("서버 권한",l+r.join(", ")+" <img style=cursor:pointer class=hoverButton onclick='return showUserAdminDialog(event,\""+e+'")\' src="images/link5.png" />'),o.quota&&(d+=addDeviceAttribute("서버 할당량",EscapeHtml(parseInt(o.quota)/1024)+" k")),d+=addDeviceAttribute("생성",printDateTime(new Date(1e3*o.creation))),o.login&&(d+=addDeviceAttribute("마지막 로그인",printDateTime(new Date(1e3*o.login)))),-1==o.passchange?d+=addDeviceAttribute("암호","다음에 로그인하면 변경됩니다."):o.passchange&&(d+=addDeviceAttribute("암호",format("최근 변경 : {0}",printDateTime(new Date(1e3*o.passchange)))));var m=0,g="<i>없음<i>";if(o.links){for(var h in o.links)h.startsWith("mesh/")&&m++;1==m?g="1개의 그룹":1<m&&(g=format("{0} 그룹",m))}if(d+=addDeviceAttribute("장치 그룹",g),4294967295==userinfo.siteadmin||2&userinfo.siteadmin){var v="<i>없음</i>";if(o.groups)for(var h in v="",o.groups)v+='<span class="tagSpan">'+o.groups[h]+"</span>";d+=addDeviceAttribute("관리자 영역",addLinkConditional(v,'showUserGroupDialog(event,"'+e+'")',4294967295==userinfo.siteadmin||null==userinfo.groups&&userinfo._id!=o._id&&4294967295!=o.siteadmin))}var f=[],k=0;o.consent&&(k=o.consent),serverinfo.consent&&(k|=serverinfo.consent),64&k&&8&k?f.push("데스크톱 프롬프트+도구모음"):64&k?f.push("데스크톱 툴바"):8&k?f.push("데스크탑 프롬프트"):1&k&&f.push("데스크탑 알림"),16&k?f.push("터미널 프롬프트"):2&k&&f.push("터미널 알림"),32&k?f.push("파일 프롬프트"):4&k&&f.push("파일 알림"),7==k&&(f=["항상 알림"]),56==(56&k)&&(f=["항상 묻기"]),""==(f=f.join(", "))&&(f="<i>없음</i>"),d+=addDeviceAttribute("사용자 연결 옵션",addLinkConditional(f,"p20editmeshconsent(2)",!0));var x=0;if(0<o.otpsecret||0<o.otphkeys){x=1;var y=[];0<o.otpsecret&&y.push("2단계 인증 앱"),0<o.otphkeys&&y.push("보안 키"),0<o.otpkeys&&y.push("백업 코드"),null!=o.phone&&67108864&features&&y.push("SMS"),d+=addDeviceAttribute("보안",'<img src="images/key12.png" height=12 width=11 title="2단계 인증 활성화됨" style="margin-top:2px" /> '+y.join(", "))}d+="</table></div><br />",d+='<input type=button value="메모" title="이 사용자에 대한 메모 보기" onclick=showNotes(false,"'+e+'") />',o.phone&&33554432&features&&(d+='<input type=button value="SMS" title="이 사용자에게 SMS 메시지를 보냅니다." onclick=showSendSMS("'+e+'") />'),"string"==typeof o.email&&!0===o.emailVerified&&64&features&&(d+='<input type=button value="이메일" title="Send a email message to this user" onclick=showSendEmail("'+e+'") />'),!i&&0<a&&(d+='<input type=button value="알림" title="사용자 알림 보내기" onclick=showUserAlertDialog(event,"'+e+'") />'),QH("p30html",d),drawUserPermissions();var b=null!=userinfo.siteadmin&&2&userinfo.siteadmin&&4294967295!=o.siteadmin||4294967295==userinfo.siteadmin;d="<div style=float:right;font-size:x-small>",b&&(d+="<a href=# style=cursor:pointer onclick='return p30showDeleteUserDialog()' title=\"이 사용자 제거\">사용자 삭제</a>"),d+="</div><div style=font-size:x-small>",b&&0==(524288&features)&&"~"!=o._id.split("/")[2][0]&&(d+="<a href=# style=cursor:pointer onclick='return p30showUserChangePassDialog("+x+')\' title="이 사용자의 비밀번호 변경">비밀번호 변경</a>'),d+="</div><br>",QH("p30html3",d),d="",1==a?d="1개의 활성 세션":1<a&&(d=format("{0} 활성 세션",a)),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 가능 전화 번호입니다.<br />비워 두십시오.",setDialogMode(2,"휴대폰 알림",3,p30editPhoneEx,e+='<br /><br /><div style=width:100%;text-align:center>휴대폰 번호: <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("이메일","<input id=dp30email style=width:230px maxlength=32 onchange=p30validateEmail() onkeyup=p30validateEmail() />"),serverinfo.emailcheck&&(t+=addHtmlValue("상태","<select id=dp30verified style=width:230px onchange=p30validateEmail()><option value=0>확인되지 않음</option><option value=1>검증됨</option></select>")),setDialogMode(2,format("다음 이메일 주소를 변경 : {0}",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("암호","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>"),t+=addHtmlValue("암호","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=p30showUserChangePassDialogValidate(1) onkeyup=p30showUserChangePassDialogValidate(1)></input>"),65536&features&&(t+=addHtmlValue("비밀번호 힌트","<input id=p4hint type=text style=width:230px maxlength=256></input>")),passRequirements){var n=[],o=0;for(var i in passRequirements)"reset"!=i&&"hint"!=i&&(n.push(i+":"+passRequirements[i]),o++);0<o&&(t+="<div style=font-size:x-small;padding:6px>"+format("요구사항 : {0}.",n.join(", "))+"</div>")}t+="<div><label><input id=p4resetNextLogin type=checkbox />다음에 로그인 할 때 비밀번호를 강제로 재설정하십시오.</label></div>",1==e&&(t+="<div><label><input id=p4twoFactorRemove type=checkbox />2단계 인증을 모두 제거하십시오.</label></div>"),setDialogMode(2,format("다음의 비밀번호를 변경 : {0}",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 o={action:"changeuserpass",userid:currentUser._id,pass:Q("p4pass1").value,removeMultiFactor:n,resetNextLogin:Q("p4resetNextLogin").checked};65536&features&&(o.hint=Q("p4hint").value),meshserver.send(o)}}function p30showDeleteUserDialog(){xxdialogMode||(setDialogMode(2,format("사용자 {0} 삭제",EscapeHtml(currentUser.name)),3,p30showDeleteUserDialogEx,format("사용자 {0}를 삭제하시겠습니까?",EscapeHtml(currentUser.name))+"<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />확인</label>"),p10validateDeleteNodeDialog())}function p30showDeleteUserDialogEx(){meshserver.send({action:"deleteuser",userid:currentUser._id,username:currentUser.name})}function drawUserPermissions(){var e=1,t="",n=0,o=!1;for(var i in meshes)meshes[i]._id.split("/")[1]==currentUser._id.split("/")[1]&&(n++,null!=currentUser.links&&null!=currentUser.links[i]||(o=!0));if(0<n&&o&&(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> 장치 그룹 추가</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>공유된 장치 그룹들</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var a=[];for(var i in currentUser.links)i.startsWith("mesh/")&&null!=meshes[i]&&a.push(meshes[i]);for(var i in a=getOrderedList(a,"name")){var s=0,r=a[i],l="",d=makeDeviceGroupRightsString(h=currentUser.links[r._id].rights);if(null!=r){userinfo.links&&null!=userinfo.links[r._id]&&null!=userinfo.links[r._id].rights&&(s=userinfo.links[r._id].rights);var c="<i>알 수 없는 장치 그룹</i>";r&&(c="<a href=# onclick='gotoMesh(\""+r._id+"\");haltEvent(event);'>"+EscapeHtml(r.name)+"</a>"),currentUser._id!=userinfo._id&&0!=(2&s)&&(l="<a href=# onclick='return p30removeMeshFromUser(event,\""+encodeURIComponentEx(r._id)+'")\' title="이 장치 그룹에 대한 사용자 권한 제거" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>',d='<span style=cursor:pointer onclick=p20showAddMeshUserDialog(1,"'+encodeURIComponentEx(r._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="장치 그룹" 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>공유된 장치 그룹이 없습니다.</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 i in usergroups)usergroups[i]._id.split("/")[1]==currentUser._id.split("/")[1]&&(u++,null!=currentUser.links&&null!=currentUser.links[i]||(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> 사용자 그룹 추가</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>사용자 그룹 회원</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var m=[];for(var i in currentUser.links)i.startsWith("ugrp/")&&null!=usergroups[i]&&m.push(usergroups[i]);for(var i in m=getOrderedList(m,"name")){var g=m[i],h=currentUser.links[m[i]._id].rights,v=(l="","<i>알 수 없는 사용자 그룹</i>");null!=g&&(v=EscapeHtml(g.name),null!=usergroups&&(v="<a href=# onclick='gotoUserGroup(\""+encodeURIComponentEx(m[i]._id)+"\");haltEvent(event);'>"+v+"</a>")),0!=(256&userinfo.siteadmin)&&(l="<a href=# onclick='return p30RemoveUserGroup(event,\""+encodeURIComponentEx(m[i]._id)+'")\' title="사용자 그룹 회원 제거" 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="사용자 그룹" 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>사용자 그룹 회원이 없습니다,</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> 장치 추가</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>공유된 장치</th><th scope=col style=text-align:left></th></tr>',currentUser.links){var f=[];for(var i in currentUser.links){if(i.startsWith("node/"))null!=(k=getNodeFromId(i))&&f.push(k)}for(var i in f.sort(nameSort),f){var k=f[i];h=currentUser.links[k._id].rights,l="",s=GetNodeRights(k);userinfo.links&&null!=userinfo.links[i]&&null!=userinfo.links[i].rights&&(s=userinfo.links[i].rights);var x=k?EscapeHtml(k.name):"<i>알 수 없는 장치</i>";0!=(2&s)&&(l="<a href=# onclick='return p30removeNodeFromUser(event,\""+encodeURIComponentEx(k._id)+'")\' title="이 장치 그룹에 대한 사용자 권한 제거" 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>"),x="<a href=# onclick='gotoDevice(\""+k._id+"\",10);haltEvent(event);'>"+x+"</a>",t+="<tr "+(++e%2==0?"style=background-color:#DDD":"")+'><td style=width:30%><div title="장치" class=si'+k.icon+"></div><div>&nbsp;"+x+"<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>공유된 장치가 없습니다.</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,"장치 권한 제거",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:t._id,nodename:t.name,userids:[currentUser._id],rights:0,remove:!0})},format('"{0}" 장치의 접근 권한을 제거하시겠습니까?',n.name),n)}}function p30removeUserFromNode(e,n){if(!xxdialogMode){var t=null,o="";(n=decodeURIComponent(n)).startsWith("user/")?(users&&null!=(t=users[n])&&(o=t.name),setDialogMode(2,"사용자 권한 제거",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[n],rights:0,remove:!0})},o?format('사용자 "{0}"의 접근 권한을 삭제하시겠습니까?',o):"접근 권한을 삭제하시겠습니까?",t)):n.startsWith("ugrp/")&&(usergroups&&null!=(t=usergroups[n])&&(o=t.name),setDialogMode(2,"사용자 그룹 권한 제거",3,function(e,t){meshserver.send({action:"adddeviceuser",nodeid:currentNode._id,nodename:currentNode.name,userids:[n],rights:0,remove:!0})},o?format('사용자 그룹 "{0}"의 접근 권한을 삭제하시겠습니까?',o):"접근 권한을 삭제하시겠습니까?",t))}}function p30RemoveUserGroup(e,t){if(!xxdialogMode&&null!=usergroups){var n=decodeURIComponent(t),o=usergroups[n];setDialogMode(2,"사용자 그룹 회원 제거",3,p30RemoveUserGroupEx,format('사용자 그룹 "{0}"의 회원권을 삭제하시겠습니까?',null!=o?EscapeHtml(o.name):"<i>알 수 없는</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,"회원 추가",3,p30showAddUserGroupDialogEx,addHtmlValue("사용자 그룹","<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,"장치 그룹 권한 제거",3,p30removeMeshFromUserEx,format('장치 그룹 "{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 o=currentUserEvents[n],i=new Date(o.time);if(o.msg){null==o.h&&(o.h=Math.random()),printDate(i)!=t&&(null!=t&&(e+="</table>"),e+="<table class=p3eventsTable cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+(t=printDate(i))+"</td></tr>");var a="si3";"user"==o.etype&&(a="m2"),"server"==o.etype&&(a="si3");var s=EscapeHtml(o.msg).split("(R)").join("&reg;");if(o.nodeid){var r=getNodeFromId(o.nodeid);null!=r&&(a="si"+r.icon,s="<a href=# onclick='gotoDevice(\""+o.nodeid+"\",10);haltEvent(event);'>"+EscapeHtml(r.name)+"</a> &rarr; "+s)}o.username&&o.username!=currentUser.name&&(s=2&userinfo.siteadmin&&o.userid?"<a href=# onclick='gotoUser(\""+encodeURIComponentEx(o.userid)+"\");haltEvent(event);'>"+EscapeHtml(o.username)+"</a> &rarr; "+s:EscapeHtml(o.username)+" &rarr; "+s),"relay"!=o.etype&&"relaylog"!=o.action||(a="relayIcon16"),e+="<tr onclick=showEventDetails("+o.h+",3)  onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+a+"></div></td><td class=g1>&nbsp;</td><td class=style10>"+printTime(i)+" - "+s+"</td><td class=g2>&nbsp;</td></tr><tr style=height:2px></tr>"}}null!=t&&(e+="</table>"),""==e&&(e="<br><i>이벤트가 없습니다.</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 o="<table class=p3usersTable cellpadding=0 cellspacing=0>";if(o+="<th>Session<th style=width:110px>"+nobreak("Start Time")+"<th style=width:110px>지속<th style=width:110px>크기",null!=p52recordings){var i=null;for(var n in p52recordings){var a=p52recordings[n],s=printDate(new Date(a.time));s!=i&&(o+="<tr><td class=userTableHeader colspan=4>"+(i=s)),o+=addRecordingHtml(n,a)}}o+="</table>",QH("p52recordings",o),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 o=printTime(new Date(t.time));t.sessionStart&&(o=printTime(new Date(t.sessionStart)));var i="";t.size&&(i=format("{0} Kb",Math.round(t.size/1024)));var a="<i>알 수 없는</i>";t.name&&t.meshname&&(a=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)a+=" - "+format("{0} users",t.userids.length);else{var s=null;null!=users&&(s=users[t.userids[0]]),a+=null!=s?" - <a href=# onclick='gotoUser(\""+t.userids[0]+"\")'>"+EscapeHtml(s.name)+"</a>":" - "+EscapeHtml(t.userids[0].split("/")[2])}var r="",l="m0";1==t.present&&(l="m1",r="<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+'")>'+r+"<div style=font-size:16px>"+a+"</div></div></div><td style=text-align:center>"+o+"<td style=text-align:center>"+n+"<td style=text-align:center>"+i}function showRecordingDialog(e,t){if(!xxdialogMode&&"IMG"!=e.target.tagName&&"A"!=e.target.tagName){var n=p52recordings[t],o="";if(n.protocol){var i="알 수 없는";1==n.protocol&&(i="터미널"),2==n.protocol&&(i="데스크탑"),5==n.protocol&&(i="파일"),100==n.protocol&&(i="Intel AMT WSMAN"),101==n.protocol&&(i="Intel AMT Redirection"),o+=addHtmlValue4("프로토콜",i)}if(o+=addHtmlValue4("상태",1==n.present?"Present on server":"Not on server"),n.name&&(o+=addHtmlValue4("장치 이름",EscapeHtml(n.name))),n.meshname&&(o+=addHtmlValue4("장치 그룹",EscapeHtml(n.meshname))),n.size&&(o+=addHtmlValue4("크기",format("{0} B",n.size))),n.startTime&&(o+=addHtmlValue4("Start Time",printTime(new Date(n.startTime)))),n.time&&(o+=addHtmlValue4("End Time",printTime(new Date(n.time)))),n.lengthTime&&(o+=addHtmlValue4("지속",pad2(Math.floor(n.lengthTime/3600))+":"+pad2(Math.floor(n.lengthTime%3600/60))+":"+pad2(Math.floor(n.lengthTime%60)))),1==n.multiplex&&(o+=addHtmlValue4("Multiplexor","Enabled")),n.userids)for(var t in n.userids)o+=addHtmlValue4("사용자",n.userids[t].split("/")[2]);setDialogMode(2,"Recording Details",9,null,o)}}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,o=1,i=[],a=[],s=document.getElementsByName("fc"),r=0;r<s.length;r++)s[r].checked&&a.push(s[r].value);for(var r in d3filetreelinkpath="",d3filetreelocation){if(null==n.f||null==n.f[d3filetreelocation[r]])break;if(i.push(d3filetreelocation[r]),1==o){var l=d3filetreelocation[r].split("/");publicPath=window.location+l[0]+"files/"+l[2],d3filetreelocation[r]===userinfo._id?d3filetreelinkpath+="self":d3filetreelinkpath+=l[0]+"/"+l[2]}else""!=d3filetreelinkpath&&(d3filetreelinkpath+="/"+d3filetreelocation[r],2<o&&(publicPath+="/"+d3filetreelocation[r]));n=n.f[d3filetreelocation[r]],o++}d3filetreelocation=i;var d=p5sort_files(n.f);for(var r in d){var c,u=d[r],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>알림이 현재 아무것도 없습니다</div>";else for(var n in notifications){var o=notifications[n],i="",a=new Date(o.time),s=0;if(null!=o.title&&(i="<b>"+o.title+"</b>: "),null!=o.nodeid){var r=getNodeFromId(o.nodeid);null!=r&&(s=r.icon,i=16&e?"<b>"+meshes[r.meshid].name+" / "+r.name+"</b>: ":"<b>"+r.name+"</b>: ")}t+='<div title="'+format("{0}에 발생",printDateTime(a))+'" id="notifyx'+o.id+'" class=notification style="cursor:pointer;border-top:1px solid '+(""==t?"transparent":"orange")+'">',s&&(t+="<div class=j"+s+' onclick="notificationSelected('+o.id+')" style=margin:5px;float:left></div>'),t+='<div onclick="notificationDelete('+o.id+')" class=unselectable title="이 알림을 지우기" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected('+o.id+')" style=margin:5px>'+i+o.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">모두 지우기</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 o in notifications)notifications[o].id==e&&(n=o);-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 o in notifications)notifications[o].id==e&&(t=o);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 i=notifications[0];QS("notifyx"+i.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 o=e.text.split("&reg;").join("").split("<b>").join("").split("</b>").join("").split("<br />").join("\r\n");if(e.nodeid){var i=getNodeFromId(e.nodeid);i&&(n=16&t?new Notification("{{{title}}} - "+meshes[i.meshid].name+" - "+i.name,{tag:e.tag,body:o,icon:"/images/notify/icons128-"+i.icon+".png"}):new Notification("{{{title}}} - "+i.name,{tag:e.tag,body:o,icon:"/images/notify/icons128-"+i.icon+".png"}))}else{null==e.icon&&(e.icon=0);var a=e.title;a=null==a?"":" - "+e.title,n=new Notification("{{{title}}}"+a,{tag:e.tag,body:o,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:["사용된","비어 있는"]},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:["사용된","비어 있는"]},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:"서버 상태",AgentErrorCounters:"에이전트 오류 계수",UnknownGroup:"알 수 없는 그룹",InvalidPKCSsignature:"유효하지 않은 PKCS 서명",InvalidRSAsiguature:"유효하지 않은 RSA siguature",InvalidJSON:"유효하지 않은 JSON입니다.",UnknownAction:"알 수 없는 동작",BadWebCertificate:"잘못된 웹 인증서",BadSignature:"잘못된 서명",MaxSessionsReached:"최대 세션 수",UnknownDeviceGroup:"알 수 없는 장치 그룹",InvalidDeviceGroupType:"유효하지 않은 장치 그룹 유형입니다.",DuplicateAgent:"에이전트 복제",ConnectedIntelAMT:"연결된 Intel&reg; AMT",RelayErrors:"전달(Relay) 오류",UserAccounts:"사용자 계정",DeviceGroups:"장치 그룹",AgentSessions:"에이전트 세션들",ConnectedUsers:"연결된 사용자",UsersSessions:"사용자 세션",RelaySessions:"전달(Relay) 세션",RelayCount:"전달(Relay) 카운트"};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 부하</div><div><b title="최근 1분간 CPU 부하">'+Math.round(100*e.cpuavg[0])/100+'</b>, <b title="최근 5분간 CPU 부하">'+Math.round(100*e.cpuavg[1])/100+'</b>, <b title="최근 15분간 CPU 부하">'+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>메모리</div><div><b>"+getNiceSize2(e.freemem)+"</b> 비어 있는, <b>"+getNiceSize2(e.totalmem)+"</b> 합계</div>"),QS("serverMemoryChartView").display="inline-block",window.serverStatMemory.update());var o="<div style=width:100% cellpadding=0 cellspacing=0>";if("object"==typeof e.values)for(var i in e.values)for(var a in o+="<div class=userTableHeader style=margin-bottom:4px;width:200px>"+(t[i]?t[i]:i)+"</div>",e.values[i])o+="<div style=display:inline-block><table class=serverStateTableCell><tr><td class=h1></td><td><span>"+(t[a]?t[a]:a)+"</span><span style=float:right>"+e.values[i][a]+"</span></td><td class=h2></td></tr></table></div>";o+="</div>",QH("serverStatsTable",o)}}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="연결 계수",e={labels:[pastDate(0),n],datasets:[{label:"에이전트들",data:[],backgroundColor:"rgba(158, 151, 16, .1)",borderColor:"rgb(158, 151, 16)",fill:!0},{label:"사용자",data:[],backgroundColor:"rgba(16, 84, 158, .1)",borderColor:"rgb(16, 84, 158)",fill:!0},{label:"사용자 세션",data:[],backgroundColor:"rgba(255, 99, 132, .1)",borderColor:"rgb(255, 99, 132)",fill:!0},{label:"전달(Relay) 세션",data:[],backgroundColor:"rgba(39, 158, 16, .1)",borderColor:"rgb(39, 158, 16)",fill:!0},{label:"인텔 AMT",data:[],backgroundColor:"rgba(134, 16, 158, .1)",borderColor:"rgb(134, 16, 158)",fill:!0}]};for(var o=0;o<serverTimelineStats.length;o++){new Date(serverTimelineStats[o].time);1==serverTimelineStats[o].first&&(e.datasets[0].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[1].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[2].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[3].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[4].data.push({x:serverTimelineStats[o].time-1,y:NaN})),serverTimelineStats[o].conn&&(e.datasets[0].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].conn.ca}),e.datasets[1].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].conn.cu}),e.datasets[2].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].conn.us}),e.datasets[3].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].conn.rs}),null!=serverTimelineStats[o].conn.am&&e.datasets[4].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].conn.am}))}}else if(1==t){serverTimelineConfig.options.scales.yAxes[0].scaleLabel.labelString="메가바이트",e={labels:[pastDate(0),n],datasets:[{label:"외부",data:[],backgroundColor:"rgba(158, 151, 16, .1)",borderColor:"rgb(158, 151, 16)",fill:!0},{label:"사용된 힙",data:[],backgroundColor:"rgba(16, 84, 158, .1)",borderColor:"rgb(16, 84, 158)",fill:!0},{label:"힙 총계",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(o=0;o<serverTimelineStats.length;o++)1==serverTimelineStats[o].first&&(e.datasets[0].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[1].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[2].data.push({x:serverTimelineStats[o].time-1,y:NaN}),e.datasets[3].data.push({x:serverTimelineStats[o].time-1,y:NaN})),e.datasets[0].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].mem.external/1048576}),e.datasets[1].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].mem.heapUsed/1048576}),e.datasets[2].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].mem.heapTotal/1048576}),e.datasets[3].data.push({x:serverTimelineStats[o].time,y:serverTimelineStats[o].mem.rss/1048576})}serverTimelineConfig.data=e,window.serverMainStats.update()}function p40downloadEvents(){for(var e="시간, 연결 에이전트, 연결 사용자, 연결 사용자 세션, 연결 릴레이 세션, 연결 정보, 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>핵심 서버</b></div>',e+="<div><label><input type=checkbox id=p41c1 "+(0<=serverTraceSources.indexOf("cookie")?"checked":"")+">쿠키 인코더</label></div>",e+="<div><label><input type=checkbox id=p41c2 "+(0<=serverTraceSources.indexOf("dispatch")?"checked":"")+">메시지 디스패처</label></div>",e+="<div><label><input type=checkbox id=p41c3 "+(0<=serverTraceSources.indexOf("main")?"checked":"")+">메인 서버 메시지</label></div>",e+="<div><label><input type=checkbox id=p41c4 "+(0<=serverTraceSources.indexOf("peer")?"checked":"")+">MeshCentral 서버 피어링</label></div>",e+="<div><label><input type=checkbox id=p41c15 "+(0<=serverTraceSources.indexOf("agent")?"checked":"")+">MeshAgent 트래픽</label></div>",e+="<div><label><input type=checkbox id=p41c14 "+(0<=serverTraceSources.indexOf("agentupdate")?"checked":"")+">MeshAgent 업데이트</label></div>",e+="<div><label><input type=checkbox id=p41c16 "+(0<=serverTraceSources.indexOf("cert")?"checked":"")+">서버 인증서</label></div>",e+="<div><label><input type=checkbox id=p41c17 "+(0<=serverTraceSources.indexOf("db")?"checked":"")+">서버 데이터베이스</label></div>",e+="<div><label><input type=checkbox id=p41c18 "+(0<=serverTraceSources.indexOf("email")?"checked":"")+">이메일/SMS 트래픽</label></div>",e+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:5px"><b>웹 서버</b></div>',e+="<div><label><input type=checkbox id=p41c5 "+(0<=serverTraceSources.indexOf("web")?"checked":"")+">웹 서버</label></div>",e+="<div><label><input type=checkbox id=p41c6 "+(0<=serverTraceSources.indexOf("webrequest")?"checked":"")+">웹 서버 요청</label></div>",e+="<div><label><input type=checkbox id=p41c7 "+(0<=serverTraceSources.indexOf("relay")?"checked":"")+">웹 소켓 전달(Relay)</label></div>",e+='<div style="width:100%;border-bottom:1px solid gray;margin-bottom:5px;margin-top:5px"><b>인텔 AMT</b></div>',e+="<div><label><input type=checkbox id=p41c9 "+(0<=serverTraceSources.indexOf("webrelay")?"checked":"")+">연결 전달(Relay)</label></div>",e+="<div><label><input type=checkbox id=p41c10 "+(0<=serverTraceSources.indexOf("mps")?"checked":"")+">CIRA 서버</label></div>",setDialogMode(2,"서버 추적",7,setServerTracingEx,e+="<div><label><input type=checkbox id=p41c11 "+(0<=serverTraceSources.indexOf("mpscmd")?"checked":"")+">CIRA 서버 명령</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 o=1;o<19;o++)try{Q("p41c"+o).checked&&t.push(n[o-1])}catch(e){}meshserver.send({action:"traceinfo",traceSources:t})}function p41downloadServerTrace(){var e="시간, 출처, 메시지\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,o,i,a){setSessionActivity(),QV("uiMenu",!1),xxdialogMode=e,xxdialogFunc=o,xxdialogButtons=n,xxdialogTag=a,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 s=1;s<24;s++)QV("dialog"+s,s==e);QV("dialog",e),i&&(2==e?QH("id_dialogOptions",i):QH("id_dialogMessage",i))}function dialogclose(e){setSessionActivity();var t=xxdialogFunc,n=xxdialogButtons,o=xxdialogTag;setDialogMode(),(8&n||e)&&t&&t(e,o)}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 o="";for(var n in 10<=xxcurrentView&&xxcurrentView<=19?null!=currentNode&&(o="?viewmode="+xxcurrentView+"&gotonode="+currentNode._id.split("/")[2]):20<=xxcurrentView&&xxcurrentView<=29?null!=currentMesh&&(o="?viewmode="+xxcurrentView+"&gotomesh="+currentMesh._id.split("/")[2]):30<=xxcurrentView&&xxcurrentView<=39?null!=currentUser&&(o="?viewmode="+xxcurrentView+"&gotouser="+(serverinfo.crossDomain?currentUser._id:currentUser._id.split("/")[2])):51<=xxcurrentView&&xxcurrentView<=51?null!=currentUserGroup&&null!=currentUserGroup._id&&(o="?viewmode="+xxcurrentView+"&gotougrp="+(serverinfo.crossDomain?currentUserGroup._id:currentUserGroup._id.split("/")[2])):1<xxcurrentView&&(o="?viewmode="+xxcurrentView),urlargs)o+=(""==o?"?":"&")+n+"="+urlargs[n];try{window.history.replaceState({},document.title,window.location.pathname+o)}catch(e){}}var i=["MainMenuMyDevices","MainMenuMyAccount","MainMenuMyEvents","MainMenuMyFiles","MainMenuMyUsers","MainMenuMyServer"];for(var n in i)QC(i[n]).remove("fullselect"),QC(i[n]).remove("semiselect");var a=["LeftMenuMyDevices","LeftMenuMyAccount","LeftMenuMyEvents","LeftMenuMyFiles","LeftMenuMyUsers","LeftMenuMyServer"];for(var n in a)QC(a[n]).remove("lbbuttonsel"),QC(a[n]).remove("lbbuttonsel2");var s=e<9?"fullselect":"semiselect",r=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(s),QC("LeftMenuMyDevices").add(r)):2==e||2==l||0==l&&20<=e&&e<30?(QC("MainMenuMyAccount").add(s),QC("LeftMenuMyAccount").add(r)):3==e?(QC("MainMenuMyEvents").add(s),QC("LeftMenuMyEvents").add(r)):4==e||30<=e&&e<40||50==e||51==e||52==e?(QC("MainMenuMyUsers").add(s),QC("LeftMenuMyUsers").add(r)):5==e?(QC("MainMenuMyFiles").add(s),QC("LeftMenuMyFiles").add(r)):(6==e||115==e||40<=e&&e<50)&&(QC("MainMenuMyServer").add(s),QC("LeftMenuMyServer").add(r)),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 r={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=r[e.status].text,e.statusColor=r[e.status].color,null==e.versionHistoryUrl&&t.push("downgrade"),e.status||(e.version=" - "),e.upgradeAvail="확인 중...",null!=installedPluginList.version_info&&null!=installedPluginList.version_info[e._id]){var n=installedPluginList.version_info[e._id];n.hasUpdate?e.upgradeAvail='<a title="보기 변경 로그" target="_blank" href="'+n.changelogUrl+'">'+n.version+"</a>":(t.push("upgrade"),e.status?e.upgradeAvail="업데이트":e.upgradeAvail='<a title="보기 변경 로그" 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="버전이 호환되지 않습니다. MeshCentral를 먼저 업그레이드하십시오." 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 o=Object.entries(l[e.status]);for(var i in o)-1===t.indexOf(o[i][0])&&(e.actions+='<option value="'+o[i][0]+'">'+o[i][1]+"</option>");e.actions+="</select>";var a="<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>",s=d.insertRow(-1);s.innerHTML=a,s.classList.add("p42tblRow"),s.setAttribute("data-id",e._id),s.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 o in installedPluginList)installedPluginList[o]._id==t&&(n=installedPluginList[o]);setDialogMode(2,"플러그인 액션",3,pluginActionEx,format("{1}을 {0}에 플러그인 하시겠습니까?(이게 뭔말이야)",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,o=e.links[t];if(null!=o){if(4294967295==o.rights)return 4294967295;n=o.rights}var i=null;if(t==userinfo._id?i=userinfo:null!=users&&(i=users[t]),null!=i)for(var a in i.links)if(a.startsWith("ugrp/")&&null!=(o=e.links[a])){if(4294967295==o.rights)return 4294967295;n|=o.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 o in n.links)if(o.startsWith("ugrp/")&&null!=e.links[o])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 o in e.links)o.startsWith("ugrp/")&&null!=userinfo.links[o]&&null!=e.links[o].rights&&(n|=e.links[o].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,o="undefined"==typeof Uint8Array?new Array(1.5*t):new Uint8Array(3*t),i=0,a=0,s=0;s!==t;){if(i=e.charCodeAt(s),s+=1,55296<=i&&i<=56319){if(s===t){o[n+=1]=239,o[n+=1]=191,o[n+=1]=189;break}if(!(56320<=(a=e.charCodeAt(s))&&a<=57343)){o[n+=1]=239,o[n+=1]=191,o[n+=1]=189;continue}if(s+=1,65535<(i=1024*(i-55296)+a-56320+65536)){o[n+=1]=240|i>>>18,o[n+=1]=128|i>>>12&63,o[n+=1]=128|i>>>6&63,o[n+=1]=128|63&i;continue}}i<=127?o[n+=1]=0|i:(i<=2047?o[n+=1]=192|i>>>6:(o[n+=1]=224|i>>>12,o[n+=1]=128|i>>>6&63),o[n+=1]=128|63&i)}return"undefined"!=typeof Uint8Array?o.subarray(0,n+1):(o.length=n+1,o)},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 o=0,i=localStorage.length;o<i;++o){var a=localStorage.key(o);"_"!=a[0]&&(n[a]=localStorage.getItem(a),"desktopsettings"!=a&&"string"==typeof n[a]&&64<n[a].length&&delete n[a])}}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 o=document.createElement("option");o.text=t,o.value=n,Q(e).add(o)}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("통화 오류",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; 더 많이</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; 적은</a></div>'}function getSelectedOptions(e){for(var t,n=[],o=0,i=e.options.length;o<i;o++)(t=e.options[o]).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 o in e)if(e[o][t]==n)return e[o];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("&"),o=0;o<n.length;o++)0<(e=n[o].indexOf("="))&&(t[n[o].substring(0,e)]=n[o].substring(e+1,n[o].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={},o=e.split(/[\?&|\=]/);for(i in o.splice(0,1),o)switch(i%2){case 0:t=decodeURIComponent(o[i]);break;case 1:n[t]=decodeURIComponent(o[i]);var i=parseInt(n[t]);i==n[t]&&(n[t]=i)}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 o=t.toLowerCase().indexOf(e.toLowerCase());return-1==o?t:t.substring(0,o)+'<a href="'+n+'">'+e+"</a>"+t.substring(o+e.length)}function getOrderedList(e,i){var t=[];for(var n in e)t.push(e[n]);return t.sort(function(e,t){var n=e[i].toLowerCase(),o=t[i].toLowerCase();return o<n?1:n<o?-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>