<!doctypehtml><html lang=ko dir=ltr xmlns=http://www.w3.org/1999/xhtml><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="text/html; charset=utf-8"http-equiv=Content-Type><meta name=viewport content="user-scalable=1,initial-scale=1,minimum-scale=1,maximum-scale=1"><meta name=format-detection content="telephone=no"><meta name=robots content=noindex,nofollow><link rel=manifest href={{{domainurl}}}manifest.json><link rel="shortcut icon"href={{{domainurl}}}favicon.ico><link rel=icon type=image/png sizes=16x16 href={{{domainurl}}}favicon-16x16.png><link rel=icon type=image/png sizes=32x32 href={{{domainurl}}}favicon-32x32.png><link rel=apple-touch-icon href=/favicon-303x303.png><link type=text/css href=styles/xterm.css media=screen rel=stylesheet title=CSS><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=#ffffff><meta name=apple-mobile-web-app-title content={{{title}}}><script src=scripts/common-0.0.1{{{min}}}.js></script><script src=scripts/meshcentral{{{min}}}.js></script><script src=scripts/agent-redir-ws-0.1.1{{{min}}}.js></script><script src=scripts/agent-desktop-0.0.2{{{min}}}.js></script><script src=scripts/amt-0.2.0{{{min}}}.js></script><script src=scripts/amt-redir-ws-0.1.0{{{min}}}.js></script><script src=scripts/amt-desktop-0.0.2{{{min}}}.js></script><script src=scripts/xterm{{{min}}}.js></script><script src=scripts/xterm-addon-fit{{{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 keeplink=1 src=scripts/filesaver.min.js></script><meta name=msapplication-TileColor content=#00aba9><meta name=theme-color content=#ffffff><title>{{{title}}}</title><style>body{background-color:#fff}.night body{background-color:#000}#MxMESH{color:#000}.night #MxMESH{color:#d3d3d3}.textOverGray{color:#000}#dialog{z-index:1000;background-color:#eee;box-shadow:0 0 15px #666;font-family:Arial,Helvetica,sans-serif;border-radius:5px;position:fixed;top:90px;width:300px}.night #dialog{color:#000;background-color:#aaa}:focus{outline:0}a{color:#036;text-decoration:underline}.night a{color:#99f}#footer a{color:#fff;text-decoration:underline}#footer a:hover{text-decoration:none}.night #footer{color:gray}.i1{background:url(../images/icons50.png) 0 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i2{background:url(../images/icons50.png) -50px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i3{background:url(../images/icons50.png) -100px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i4{background:url(../images/icons50.png) -150px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i5{background:url(../images/icons50.png) -200px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i6{background:url(../images/icons50.png) -250px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i7{background:url(../images/icons50.png) -300px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.i8{background:url(../images/icons50.png) -350px 0;background-image:image-set(url(../images/icons50.png) 1x,url(../images/icons100.png) 2x);height:50px;width:50px;border:none}.m0{background:url(../images/images16.png) -32px 0;height:16px;width:16px;border:none;float:left}.m1{background:url(../images/images16.png) -16px 0;height:16px;width:16px;border:none;float:left}.m2{background:url(../images/images16.png) -96px 0;height:16px;width:16px;border:none;float:left}.m3{background:url(../images/images16.png) -112px 0;height:16px;width:16px;border:none;float:left}.m4{background:url(../images/images16.png) -128px 0;height:16px;width:16px;border:none;float:left}.NotifyIconSmall1{width:24px;height:24px;background:url(../images/notify24.png) 0 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall2{width:24px;height:24px;background:url(../images/notify24.png) -24px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall3{width:24px;height:24px;background:url(../images/notify24.png) -48px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall4{width:24px;height:24px;background:url(../images/notify24.png) -72px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall5{width:24px;height:24px;background:url(../images/notify24.png) -96px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall6{width:24px;height:24px;background:url(../images/notify24.png) -120px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall7{width:24px;height:24px;background:url(../images/notify24.png) -144px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall8{width:24px;height:24px;background:url(../images/notify24.png) -168px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.NotifyIconSmall9{width:24px;height:24px;background:url(../images/notify24.png) -192px 0;background-image:image-set(url(../images/notify24.png) 1x,url(../images/notify48.png) 2x)}.gray{filter:gray;-webkit-filter:grayscale(100%) opacity(60%)}.DevSt{padding-left:5px;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#ddd}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fileIcon1{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb49Y2Sj9LT2f///yH5BAEAAAMALAAAAAAQABAAAAImnI+py+1vhJwyUYAzHTL4D3qdlJWaIFJqmKod607sDKIiDUP63hQAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px}.fileIcon2{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAM2xV/Xur+XPgP///yH5BAEAAAMALAAAAAAQABAAAAJD3ISZIGHWUGihznesYDYATFVM+D2hJ4lgN1olxALAtAlmPCJvuMmJd6PJckDYwicrHhTD5o7plJmg0Uc0asNMkphHAQA7);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px}.fileIcon3{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb19IGBgbq6uv///yH5BAEAAAMALAAAAAAQABAAAAIy3ISpxgcPH2ouQgFEw1YmxnUXKEaaEZZnVWZk66JwzKpvuwZzwOgwb/C1gIOA8Yg8DgoAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px}.fileIcon4{background:url(../images/meshicon16.png);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px}.filelist{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;cursor:default;-khtml-user-drag:element;clear:both}.deviceNotifyDot{position:absolute;right:10px;top:0;height:16px}.deviceNotifyDotSub{text-align:center;color:#fff;width:16px;background-color:#00f;padding:2px;border-radius:10px;box-shadow:2px 2px 10px #000;cursor:pointer;margin-left:3px;float:left}.deviceNotifyDotSub:hover{background-color:#44f}.deviceNotifySmallDot{position:absolute;right:10px;top:0;height:10px}.deviceNotifySmallDotSub{text-align:center;color:#fff;width:10px;padding:2px;background-color:#00f;border-radius:10px;box-shadow:2px 2px 10px #000;cursor:pointer;margin-left:2px;float:left}.deviceNotifySmallDotSub:hover{background-color:#44f}.deviceNotifyLargeDot{position:absolute;right:10px;top:10px;height:40px}.deviceNotifyLargeDotSub{text-align:center;width:35px;height:35px;color:#fff;padding:2px;background-color:#00f;border-radius:20px;box-shadow:2px 2px 10px #000;cursor:pointer;margin-left:4px;font-size:30px;float:left}.deviceNotifyLargeDotSub:hover{background-color:#44f}.style10{background-color:#c9c9c9;color:#000}.night .style10{background-color:#888}.deviceBatteryLarge{position:absolute;right:10px;top:0;width:28px;height:48px;border:none;box-shadow:none}.deviceBatteryLarge1{background:url(../images/batteries48.png) 0 0}.deviceBatteryLarge2{background:url(../images/batteries48.png) -28px 0}.deviceBatteryLarge3{background:url(../images/batteries48.png) -56px 0}.deviceBatteryLarge4{background:url(../images/batteries48.png) -84px 0}.deviceBatteryLarge5{background:url(../images/batteries48.png) -112px 0}.deviceBatteryLarge6{background:url(../images/batteries48.png) -140px 0}.deviceBatteryLarge7{background:url(../images/batteries48.png) -168px 0}.deviceBatteryLarge8{background:url(../images/batteries48.png) -196px 0}.deviceBatteryLarge9{background:url(../images/batteries48.png) -224px 0}.deviceBatteryLarge10{background:url(../images/batteries48.png) -252px 0}.deviceBatteryLarge11{background:url(../images/batteries48.png) -280px 0}.deviceBatterySmall{position:absolute;left:6px;top:22px;width:14px;height:24px;border:none;box-shadow:none}.deviceBatterySmall1{background:url(../images/batteries24.png) 0 0}.deviceBatterySmall2{background:url(../images/batteries24.png) -14px 0}.deviceBatterySmall3{background:url(../images/batteries24.png) -28px 0}.deviceBatterySmall4{background:url(../images/batteries24.png) -42px 0}.deviceBatterySmall5{background:url(../images/batteries24.png) -56px 0}.deviceBatterySmall6{background:url(../images/batteries24.png) -70px 0}.deviceBatterySmall7{background:url(../images/batteries24.png) -84px 0}.deviceBatterySmall8{background:url(../images/batteries24.png) -98px 0}.deviceBatterySmall9{background:url(../images/batteries24.png) -112px 0}.deviceBatterySmall10{background:url(../images/batteries24.png) -126px 0}.deviceBatterySmall11{background:url(../images/batteries24.png) -140px 0}.meshList{width:auto;height:40px;background-color:#d3d3d3;margin-top:5px;margin-bottom:5px;margin-left:60px;padding-top:5px;padding-bottom:5px;border-radius:8px 0 0 8px}.night .meshList{background-color:gray}.devList1{height:50px;cursor:pointer;position:relative;margin-top:5px;margin-bottom:5px}.devList2{float:left;margin-left:4px}.devList3{width:auto;height:40px;background-color:#d3d3d3;margin-left:60px;padding-top:5px;padding-bottom:5px;border-radius:8px 0 0 8px}.night .devList3{background-color:gray}.devList4{padding-left:12px;padding-top:2px;color:#000}.devList5{padding-left:12px;padding-top:3px;color:#444}.night .devList5{color:#000}.deskButton{box-shadow:0 0 10px #000;border-radius:20px;position:absolute;right:10px;top:10px;cursor:pointer;background-color:#aaa;z-index:1000}.menuButton{box-shadow:0 0 10px #000;border-radius:10px;display:inline-block;width:120px;background-color:#aaa;text-align:center;padding:8px;cursor:pointer;margin:10px;z-index:1000}#notificationCount{min-width:28px;font-size:20px;background-color:orange;text-align:center;cursor:pointer;color:#000}.notifiyBox{font-size:16px;position:absolute;z-index:1000;top:60px;right:76px;width:300px;text-align:left;background-color:#f0eccd;border:4px solid #666;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;-webkit-box-shadow:2px 2px 4px #888;-moz-box-shadow:2px 2px 4px #888;box-shadow:2px 2px 4px #888;max-height:200px}.night .notifiyBox{color:#000}.notifiyBox:before{content:' ';position:absolute;width:0;height:0;right:5px;top:-30px;border:15px solid;border-color:transparent #666 #666 transparent}.notifiyBox:after{content:' ';position:absolute;width:0;height:0;right:7px;top:-24px;border:12px solid;border-color:transparent #f0eccd #f0eccd transparent}#p15statetext{padding:4px;height:15px}#p15agentConsole{background:#000;margin:0;padding:0;color:#d3d3d3;width:100%;position:relative}#p15coreName{padding:4px;display:inline-block}#p15agentConsoleText{position:absolute;margin:0;padding:0;top:0;bottom:0;left:0;right:0;overflow-y:scroll;overflow-x:auto}.areaHead{padding-top:2px;padding-bottom:2px;background:silver}.night .areaHead{color:#ccc;background:#333}.areaFoot{padding-top:2px;padding-bottom:2px;background:silver}.night .areaFoot{color:#ccc;background:#333}.toright2{float:right;text-align:right}#consoleTable{width:100%;height:100%;padding:0;margin-top:0}.night #consoleTable{color:#000}.menucurve{background-color:#fff;width:10px;height:10px;border-radius:10px 0 0 0;border-right:1px solid #fff;border-bottom:1px solid #fff}.night .menucurve{background-color:#000;border-right:1px solid #000;border-bottom:1px solid #000}#termTable{width:100%;padding:0;margin-top:0}.fulldesk #termTable{position:absolute;top:0;bottom:0;left:0;right:0}#termarea3x{background:#000;text-align:center;height:400px;position:relative}.viewSelector10{margin-left:2px;margin-top:2px;background:url(../images/views.png) -476px 0;height:28px;width:28px}.viewSelector11{margin-left:2px;margin-top:2px;background:url(../images/views.png) -504px 0;height:28px;width:28px}</style><body id=body onload='"undefined"!=typeof startup&&startup()'style="overflow-y:hidden;margin:0;padding:0;border:0;font-size:13px;font-family:\'Trebuchet MS\',Arial,Helvetica,sans-serif"><div id=container><div id=notifiyBox class=notifiyBox style=display:none></div><div id=mastheadx></div><div id=masthead style="background:url(logo.png) 0 0;background-size:341px 50px;background-color:#036;background-repeat:no-repeat;height:50px;width:100%;overflow:hidden"><div style="width:calc(100% - 50px);overflow:hidden"><div style=float:left;height:66px;color:#c8c8c8;padding-left:10px;padding-top:6px><strong><font style="font-size:36px;font-family:Arial,Helvetica,sans-serif;text-shadow:1px 1px 2px #000">{{{title1}}}</font></strong></div><div style=float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:10px><strong><font style="font-size:12px;font-family:Arial,Helvetica,sans-serif;text-shadow:1px 1px 2px #000">{{{title2}}}</font></strong></div></div><div id=devViewPageState class=noselect style=position:absolute;right:160px;top:10px;height:30px;line-height:30px;color:#c8c8c8;font-size:16px;display:none></div><img id=devViewPageButton2 class=noselect style=position:absolute;right:130px;top:10px;cursor:pointer;display:none onclick=onDeviceViewPageChange(2) src=/images/left-30.png width=20 height=30> <img id=devViewPageButton3 class=noselect style=position:absolute;right:100px;top:10px;cursor:pointer;display:none onclick=onDeviceViewPageChange(3) src=/images/right-30.png width=20 height=30><div id=notificationCount onclick=clickNotificationIcon() class=unselectable style=position:absolute;right:50px;top:0;font-size:28px;width:50px;height:50px;cursor:pointer;display:none title="현재 알림을 보려면 클릭하십시오."><div id=notificationCount2 style=padding-top:8px>0</div></div><img id=topMenuIcon class=noselect style=position:absolute;right:0;top:10px;color:#c8c8c8;font-size:44px;margin-right:8px;cursor:pointer;display:none onclick=topMenu() src=/images/3bars-30.png width=30 height=30></div><div id=page_content style=position:absolute;bottom:32px;top:50px;width:100%><div id=column_l style=width:100%;padding:0;position:absolute;bottom:0;top:0><div id=p0 style=display:none;width:100%;height:100%><div style=display:flex;align-items:center;width:100%;height:100%><div id=p0message style=text-align:center;width:100%><span id=p0span>서버 연결이 끊어졌습니다</span>,<href onclick=reload() style=cursor:pointer><u>다시 연결하려면 클릭하십시오.</u></href>.</div></div></div><div id=p1 style=display:none;width:100%;height:100%><div style=display:flex;align-items:center;width:100%;height:100%><div id=p1message style=text-align:center;width:100%></div></div></div><div id=p2 style=display:none;position:absolute;top:0;left:0;right:0;bottom:0><div id=xdevices style=position:absolute;overflow-y:auto;top:0;left:0;right:0;bottom:34px onscroll=onDevicesScroll() ontouchstart=onDeviceTouch(!0) ontouchend=onDeviceTouch(!1)></div><div id=xdevicesBar style=position:absolute;overflow-y:auto;height:34px;left:0;right:0;bottom:0;background-color:#aaa;color:#000><div style=margin:4px><span style=width:20px;display:inline-block;text-align:center;cursor:pointer;font-size:16px onclick=clearSearchInput()><b>X</b></span> <input id=SearchInput autocomplete=off type=search placeholder=필터 onchange=onDeviceSearchChanged(event) onclick=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) style=padding:2px;margin:0;height:20px;background-color:#fff>&nbsp; <label class=noselect><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox()>OS에서 설정한 이름</label> <label class=noselect><input type=checkbox id=OnlineCheckBox onclick=onOnlineCheckBox(event)>온라인</label></div></div></div><div id=p3 style=display:none;position:absolute;bottom:0;top:0;width:100%><table cellspacing=0 style=margin:0;padding:0;border-spacing:0;border:0><tr style=padding:0><td style=padding:0;color:#c8c8c8;text-align:center;cursor:pointer width=60px valign=top onclick=goBack()><div style=padding:0;background-color:#036;width:10px;height:10px;float:right;border:0><div class=menucurve></div></div><div style="padding:0;font-size:25px;background-color:#036;width:50px;border-radius:0 0 10px 0;height:36px">◀</div><td><div style=margin-left:5px><strong style=font-size:large><span id=p3userName></span></strong><br></div></table><div id=p3info style=overflow-y:auto;position:absolute;top:55px;bottom:0;width:100%><img id=p2AccountImage alt=""loading=lazy width=128 height=128 onclick=account_manageImage(0) src=images/user-256.png style="position:absolute;right:8px;top:7px;border-radius:8px;box-shadow:0 0 7px #000"><div style=margin-left:8px><div id=p3AccountActions><div id=p2AccountSecurity style=display:none><p><strong>계정 보안</strong><div style=margin-left:9px;margin-bottom:8px><div id=managePhoneNumber1 style=margin-top:5px;display:none><a onclick=account_managePhone() style=cursor:pointer>휴대폰 번호 관리</a> <span id=authPhoneNumberCheck><strong>✓</strong></span></div><div id=manageEmail2FA style=margin-top:5px;display:none><a onclick=account_manageAuthEmail() style=cursor:pointer>이메일 인증 관리</a> <span id=authEmailSetupCheck><strong>✓</strong></span></div><div id=manageAuthApp style=margin-top:5px;display:none><a onclick=account_manageAuthApp() style=cursor:pointer>2단계 인증앱 관리</a> <span id=authAppSetupCheck><strong>✓</strong></span></div><div id=manageOtp style=margin-top:5px;display:none><a onclick=account_manageOtp(0) style=cursor:pointer>백업 코드 관리</a> <span id=authCodesSetupCheck><strong>✓</strong></span></div><div style=margin-top:5px><a href=# onclick="return account_viewPreviousLogins()">이전 로그인보기</a></div></div></div><div id=p2AccountActions style=display:none><p><strong>계정 동작</strong><div style=margin-left:9px;margin-bottom:8px><div style=margin-top:5px><span id=managePhoneNumber2 style=display:none><a onclick=account_managePhone() style=cursor:pointer>휴대폰 번호 관리</a></span></div><div style=margin-top:5px><span id=verifyEmailId style=display:none><a onclick=account_showVerifyEmail() style=cursor:pointer>이메일 검증</a></span></div><div style=margin-top:5px><span id=changeEmailId style=display:none><a onclick=account_showChangeEmail() style=cursor:pointer>이메일 주소</a></span></div><div style=margin-top:5px><a onclick=account_showChangePassword() style=cursor:pointer>비밀번호 변경</a><span id=p2nextPasswordUpdateTime></span></div><div style=margin-top:5px><a onclick=account_showDeleteAccount() style=cursor:pointer>계정 삭제</a></div><div style=margin-top:5px id=setDarkModeLink><a onclick=toggleNightMode() style=cursor:pointer>다크 모드 설정</a></div><div style=margin-top:5px><a onclick=showNotes(!1) style=cursor:pointer>개인 메모</a></div></div><br style=clear:both></div></div><strong>장치 그룹</strong> <span id=p3createMeshLink1>( <a onclick=account_createMesh() style=cursor:pointer><img src=images/icon-addnew.png width=12 height=12 border=0> 새로운</a> )</span><br><br><div id=p3meshes></div><div id=p3noMeshFound style=margin-left:9px;display:none>장치 그룹이 없습니다.<span id=p3createMeshLink2> <a onclick=account_createMesh() style=cursor:pointer><strong>여기서 시작하십시오!</strong></a></span></div><br style=clear:both></div></div></div><div id=p5 style=display:none><table cellspacing=0 style=margin:0;padding:0;border-spacing:0;border:0><tr style=padding:0><td style=padding:0;color:#c8c8c8;text-align:center;cursor:pointer width=60px valign=top onclick=goBack()><div style=padding:0;background-color:#036;width:10px;height:10px;float:right;border:0><div class=menucurve></div></div><div style="padding:0;font-size:25px;background-color:#036;width:50px;border-radius:0 0 10px 0;height:36px">◀</div><td><img src=/images/user-50.png width=50 height=50><td><div style=margin-left:5px><strong style=font-size:large>내 파일</strong><br></div></table><div id=p5myfiles style=position:absolute;top:55px;bottom:0;width:100%><table id=p5toolbar style=width:100%;height:78px cellpadding=0 cellspacing=0><tr><td style=width:100%;background-color:#d3d9d6;text-align:left;padding:4px valign=bottom><div style=width:100%;text-align:center><input type=button style="width:calc(100%/5 - 5px)"id=p5FolderUp disabled onclick=p5folderup() value="상위 항목으로"> <input type=button style="width:calc(100%/5 - 5px)"id=p5SelectAllButton disabled onclick=p5selectallfile() value="모두 선택"onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5RenameFileButton disabled value="이름 바꾸기"onclick=p5renamefile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5DeleteFileButton disabled value=삭제 onclick=p5deletefile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5NewFolderButton disabled value=폴더 onclick=p5createfolder() onkeypress=return!1 onkeydown=return!1></div><div style=width:100%;text-align:center><input type=button style="width:calc(100%/5 - 5px)"id=p5UploadButton disabled value=업로드 onclick=p5uploadFile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5CutButton disabled value=잘라내기 onclick=p5copyFile(1) onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5CopyButton disabled value=복사 onclick=p5copyFile(0) onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5PasteButton disabled value=붙여넣기 onclick=p5pasteFile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p5RefreshButton value="새로 고침"onclick=p5refreshFiles() onkeypress=return!1 onkeydown=return!1></div><tr><td style=background-color:#e4e9e7;height:28px><table style=width:100%><tr><td id=p5currentpath style=overflow:hidden;padding-left:4px;padding-top:2px;color:#000><td style=text-align:right;padding-right:4px><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></table></table><div id=p5filetable style="width:100%;height:calc(100% - 102px);overflow:auto;-webkit-user-select:none"><span id=p5files></span></div><table id=p5toolbarBottom style=width:100%;height:22px;position:absolute;bottom:0;background-color:#d3d9d6 cellpadding=0 cellspacing=0><tr><td style=text-align:left;padding:3px>&nbsp;<span id=p5bottomstatus></span><td id=p5rightOfButtons style=text-align:right;padding:3px></table></div></div><div id=p10 style=display:none;position:absolute;bottom:0;top:0;width:100%;overflow:hidden><table id=p10deskTopTable cellspacing=0 style=margin:0;padding:0;border-spacing:0;border:0;position:absolute;top:0><tr style=padding:0><td style=padding:0;color:#c8c8c8;text-align:center;cursor:pointer width=60px valign=top onclick=goBack()><div style=padding:0;background-color:#036;width:10px;height:10px;float:right;border:0><div class=menucurve></div></div><div style="padding:0;font-size:25px;background-color:#036;width:50px;border-radius:0 0 10px 0;height:36px">◀</div><td><a id=MainComputerImage style=cursor:pointer onclick=p10showiconselector()></a><td><div style=margin-left:5px><strong><span id=p10deviceName></span></strong><br><span id=MainComputerState></span></div></table><div id=p10dialog style="z-index:1000;background-color:#eee;box-shadow:0 0 15px #666;font-family:Arial,Helvetica,sans-serif;border-radius:5px;position:fixed;top:30px;width:300px;left:30px;display:none"><div style="width:100%;background-color:#036;color:#fff;border-radius:5px 5px 0 0"><div style=padding:5px>키보드 단축키 사용자 정의</div><div style=width:100%;margin:6px></div></div><div style=margin-right:16px;margin-left:8px><div id=p10dialog2 style=margin:auto;margin:3px></div></div><div style=padding:10px;margin-bottom:20px><input type=button value=확인 style=float:right;width:80px onclick=deskCustomizeKeysEx()></div></div><div id=p10general style=overflow-y:scroll;position:absolute;top:55px;bottom:0;width:100%><div class=deviceNotifyLargeDot><img id=p10deviceStar class=deviceNotifyLargeDotSub src=images/icon-star-notify-40.png width=35 height=35><div id=p10deviceMsg onclick=showDeviceMessages(null,null,event) class=deviceNotifyLargeDotSub></div><img id=p10deviceNotify onclick=showDeviceSessions() class=deviceNotifyLargeDotSub src=images/icon-relay-notify-40.png width=35 height=35> <img id=p10deviceHelp onclick=showDeviceHelpRequests(null,null,event) class=deviceNotifyLargeDotSub src=images/icon-help-notify-40.png width=35 height=35></div><div id=p10deviceBattery class="deviceBatteryLarge deviceBatteryLarge1"></div><div id=p10html style=margin-left:8px;margin-right:8px></div><div id=p10html2></div><div id=p10html3 style=margin-left:8px></div></div><img id=deskkeybutton1 src=images/mobile-desk-exit.png class=deskButton style=top:10px;display:none onclick=exitButton()> <img id=deskkeybutton3a src=images/mobile-desk-menu-open.png class=deskButton style=top:60px;display:none onclick=toggleMenu(!1)> <img id=deskkeybutton3b src=images/mobile-desk-menu-close.png class=deskButton style=top:60px;display:none onclick=toggleMenu(!0)> <img id=deskkeybutton4a src=images/mobile-desk-mouse-left.png class=deskButton style=top:110px;display:none onclick=deskChangeMouseButton(0)> <img id=deskkeybutton4b src=images/mobile-desk-mouse-right.png class=deskButton style=top:110px;display:none onclick=deskChangeMouseButton(1)> <img id=deskkeybutton5a src=images/mobile-desk-scale-out.png class=deskButton style=top:160px;display:none onclick=deskChangeFullscreenZoom()> <img id=deskkeybutton5b src=images/mobile-desk-scale-in.png class=deskButton style=top:160px;display:none onclick=deskChangeFullscreenZoom()> <img id=deskkeybutton2a src=images/mobile-desk-keyboard-open.png class=deskButton style=top:210px;display:none onclick=toggleKeyboard()> <img id=deskkeybutton2b src=images/mobile-desk-keyboard-close.png class=deskButton style=top:210px;display:none onclick=toggleKeyboard()><div style=position:absolute;top:0;left:0;z-index:200;opacity:0;width:1px;height:1px><input id=softKeyboard autocapitalize=off autocomplete=off spellcheck=false style=z-index:200;opacity:0;width:1px;height:1px onfocus=keyboardFocusChange() onblur=keyboardFocusChange()></div><div id=deskButtonMenu style=display:none;position:absolute;top:10px;left:10px;right:55px;bottom:10px;z-index:1000></div><div id=p10desktop style=overflow:hidden;position:absolute;top:55px;bottom:0;width:100%;display:none><div id=deskarea1 style=position:absolute;top:0;width:100%;height:32px><div style=padding-top:2px;padding-bottom:2px;background:silver;height:32px><div style=float:right;text-align:right><span id=p14power></span>&nbsp; <input type=button id=deskFullScreen value="전체 화면"onclick=deskToggleFull(event) onkeypress=return!1 onkeydown=return!1 disabled style=height:28px;margin-right:3px></div><div style=margin-left:3px><input type=button id=connectbutton1 value=연결 onclick=connectDesktop(event,3) onkeypress=return!1 onkeydown=return!1 disabled style=height:28px> <input type=button id=connectbutton1h value="하드웨어 연결"onclick=connectDesktop(event,2) onkeypress=return!1 onkeydown=return!1 disabled style=height:28px> <input type=button id=disconnectbutton1 value="연결 해제"onclick=connectDesktop(event,0) onkeypress=return!1 onkeydown=return!1 style=height:28px> <span id=deskstatus style=color:#000>연결 해제</span></div></div></div><div id=deskarea3 style="position:absolute;top:32px;width:100%;height:calc(100% - 64px);background-color:#000;text-align:center"><div id=DeskParent style=height:100%><canvas id=Desk width=640 height=200 style=width:100%;-ms-touch-action:none;margin-left:0 oncontextmenu=return!1 onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel=dmousewheel(event)></canvas></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 style=position:absolute;bottom:0;width:100%;height:32px><div style=padding-top:2px;padding-bottom:2px;background:silver><div style=float:right;text-align:right><span id=DeskChatButton><img src=images/icon-chat.png onclick=deviceChat(event) height=16 width=16 style=padding-top:5px;cursor:pointer></span>&nbsp; <span id=DeskToastButton><img src=images/icon-notify.png onclick=deviceToastFunction() height=16 width=16 style=padding-top:5px;cursor:pointer></span>&nbsp;</div><div><input id=deskActionsBtn type=button style=margin-left:3px;height:28px onkeypress=return!1 onkeydown=return!1 value=동작 onclick=deviceActionFunction()> <input type=button value=설정 onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() style=height:28px> <input type=button onkeypress=return!1 onkeydown=return!1 value="전원 동작 ..."onclick=showPowerActionDlg() style=display:none;height:28px> <input type=button id=DeskScreens value=스크린 onkeypress=return!1 onkeydown=return!1 onclick=deskSelectScreens() style=display:none;height:28px> <label><span id=DeskControlSpan style=display:none><input id=DeskControl type=checkbox onkeypress=return!1 onkeydown=return!1>입력</span></label></div></div></div></div><div id=termButtonMenu style=display:none;position:absolute;top:10px;left:10px;right:55px;bottom:10px;z-index:1000></div><div id=p10terminal style=overflow:hidden;position:absolute;top:55px;bottom:0;width:100%;display:none;background-color:#333><div id=termTable style=position:absolute;top:0;bottom:0;left:0;right:0><div id=termarea1><div class=areaHead style=line-height:24px><div class=toright2><input type=button id=termFullScreen value="전체 화면"onclick=deskToggleFull(event) onkeypress=return!1 onkeydown=return!1 disabled style=height:28px;margin-right:3px><div id=terminalCustomUpperRight style=float:left;margin-right:6px></div></div><div><span id=connectbutton2span style=margin-left:3px><input type=button id=connectbutton2 value=연결 style=height:28px onclick=connectTerminal(event,1) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=connectbutton2sspan style=margin-right:4px><input type=button id=connectbutton2s value="SSH 연결"style=height:28px onclick=connectTerminal(event,3) onkeypress=return!1 onkeydown=return!1 disabled></span><span id=disconnectbutton2span style=margin-left:3px><input type=button id=disconnectbutton2 value="연결 해제"style=height:28px onclick=connectTerminal(event,0) onkeypress=return!1 onkeydown=return!1></span><span id=termstatus style=line-height:22px>연결 해제</span><span id=termtitle></span></div></div></div><div id=termarea3 style="width:100%;height:calc(100% - 60px)"cellpadding=0 cellspacing=0><div id=termarea3x style=width:100%;height:100%><div style=width:100%;height:100%;text-align:left id=termarea3xdiv></div></div></div><div id=termarea4 style=position:relative;height:32px><div class=areaFoot><div class=toright2></div><div style=height:28px><input id=termActionsBtn style=margin-left:3px;height:28px type=button title="장치에서 전원 작업 수행"onkeypress=return!1 onkeydown=return!1 value=동작 onclick=deviceActionFunction()></div></div></div><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=p10files style=position:absolute;top:55px;bottom:0;width:100%;display:none><table id=p13toolbar style=width:100%;height:111px cellpadding=0 cellspacing=0><tr><td style="background-color:silver;border-bottom:2px solid #000;padding:2px;line-height:24px"><div style=float:right;text-align:right><input id=filesActionsBtn type=button onkeypress=return!1 onkeydown=return!1 value=동작 onclick=deviceActionFunction() style=margin-right:2px><div id=filesCustomUpperRight style=float:left;margin-right:6px></div></div><div style=margin-left:2px><input id=p13AutoConnect value="자동 연결"onclick=autoConnectFiles(event) onkeypress=return!1 onkeydown=return!1 type=button style=display:none> <input id=p13Connect value=연결 onclick=connectFiles(event,1) onkeypress=return!1 onkeydown=return!1 type=button> <input id=p13Connects value="SFTP 연결"onclick=connectFiles(event,2) onkeypress=return!1 onkeydown=return!1 type=button> <input id=p13Disconnect value="연결 해제"onclick=connectFiles(event) onkeypress=return!1 onkeydown=return!1 type=button> <span class=textOverGray id=p13Status>연결 해제</span></div><tr><td style=width:100%;background-color:#d3d9d6;text-align:left;padding:4px valign=bottom><div style=width:100%;text-align:center><input type=button style="width:calc(100%/5 - 5px)"id=p13FolderUp disabled onclick=p13folderup() value="상위 항목으로"> <input type=button style="width:calc(100%/5 - 5px)"id=p13SelectAllButton disabled onclick=p13selectallfile() value="모두 선택"onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13RenameFileButton disabled value="이름 바꾸기"onclick=p13renamefile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13DeleteFileButton disabled value=삭제 onclick=p13deletefile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13NewFolderButton disabled value=폴더 onclick=p13createfolder() onkeypress=return!1 onkeydown=return!1></div><div style=width:100%;text-align:center><input type=button style="width:calc(100%/5 - 5px)"id=p13UploadButton disabled value=업로드 onclick=p13uploadFile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13CutButton disabled value=잘라내기 onclick=p13copyFile(1) onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13CopyButton disabled value=복사 onclick=p13copyFile(0) onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13PasteButton disabled value=붙여넣기 onclick=p13pasteFile() onkeypress=return!1 onkeydown=return!1> <input type=button style="width:calc(100%/5 - 5px)"id=p13RefreshButton disabled value="새로 고침"onclick=p13folderup(9999) onkeypress=return!1 onkeydown=return!1></div><tr><td style=background-color:#e4e9e7;height:28px><table style=width:100%><tr><td id=p13currentpath style=overflow:hidden;padding-left:4px;padding-top:2px;color:#000><td style=text-align:right;padding-right:4px><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></table></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 style="width:100%;height:calc(100% - 133px);overflow:auto;-webkit-user-select:none"><span id=p13files></span></div><table id=p13toolbarBottom style=width:100%;height:22px;position:absolute;bottom:0 cellpadding=0 cellspacing=0><tr><td style=text-align:left;padding:3px;text-align:center;background-color:#d3d9d6;color:#000>&nbsp;<span id=p13bottomstatus></span></table></div><div id=p10details style=overflow-y:scroll;position:absolute;top:55px;bottom:0;width:100%><div id=p10detailshtml style=margin-left:-3px></div></div><div id=p10console style=overflow:hidden;position:absolute;top:55px;bottom:0;width:100%><table id=consoleTable cellpadding=0 cellspacing=0><tr style=height:28px><td class=areaHead><div class=toright2><div id=p15coreName></div><input type=button id=p15uploadCore value="에이전트 동작"onclick=p15uploadCore(event)></div><div id=p15statetext></div><tr><td id=p15agentConsole style=position:relative><pre id=p15agentConsoleText></pre><tr style=height:28px><td class=areaFoot><table style=width:100%><tr><td style=width:99%><input id=p15consoleText style=width:100%;box-sizing:border-box onkeyup=p15consoleSend(event)><td id=p15outputselecttd><select id=p15outputselect onchange=setupConsole()><option id=p15outputselect1 value=1>에이전트<option id=p15outputselect3 value=3>푸시<option id=p15outputselect2 value=2>MQTT</select><td style=width:1%><input id=id_p15consoleClear type=button class=bottombutton value=지우기 onclick=p15consoleClear()></table></table></div></div><div id=p20 style=display:none;position:absolute;bottom:0;top:0;width:100%><table cellspacing=0 style=margin:0;padding:0;border-spacing:0;border:0;position:absolute;top:0><tr style=padding:0><td style=padding:0;color:#c8c8c8;text-align:center;cursor:pointer width=60px valign=top onclick=goBack()><div style=padding:0;background-color:#036;width:10px;height:10px;float:right;border:0><div class=menucurve></div></div><div style="padding:0;font-size:25px;background-color:#036;width:50px;border-radius:0 0 10px 0;height:36px">◀</div><td onclick=p20editmesh(1)><img src=/images/meshicon50.png width=50 height=50><td onclick=p20editmesh(1)><div style=margin-left:5px><strong style=font-size:large><span id=p20meshName></span></strong><br></div></table><div style=overflow-y:auto;position:absolute;top:55px;bottom:0;left:0;right:0><div id=p20info style=margin-left:8px;margin-right:8px></div></div></div></div></div><div id=footer style=height:32px;width:100%;text-align:center;background-color:#113962;position:absolute;bottom:0><table id=footerMenu cellpadding=0 cellspacing=0 style=height:32px;width:100%;color:#fff;cursor:pointer;table-layout:fixed></table></div></div><div id=dialog style=display:none><div style="width:100%;background-color:#036;color:#fff;border-radius:5px 5px 0 0"><div id=id_dialogclose style=float:right;padding:5px;cursor:pointer onclick=setDialogMode()><b>X</b></div><div id=id_dialogtitle style=padding:5px></div><div style=width:100%;margin:6px></div></div><div style=margin-right:16px;margin-left:8px><div id=dialog1 style=margin:auto;text-align:center;margin:3px><div id=id_dialogMessage style=padding:10px></div></div><div id=dialog2 style=margin:auto;margin:3px><div id=id_dialogOptions></div></div><div id=dialog3 style=margin:auto;margin:3px><select id=deskkeys style=width:100%><option value=10>Ctrl+Alt+Del<option value=11>Tab<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=12>Shift-F10</select></div><div id=dialog7 style=margin:auto;margin:3px><div id=d7meshkvm><h4 style="width:100%;border-bottom:1px solid gray">에이전트 원격 데스크톱</h4><table style=width:100%><tr><td>품질<td style=width:100px><select id=d7bitmapquality style=float:right;width:200px dir=rtl></select><tr><td>비율<td style=width:100px><select id=d7bitmapscaling style=float:right;width:200px 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><tr><td>등급<td style=width:100px><select id=d7framelimiter style=float:right;width:200px dir=rtl><option selected value=50>빠른<option value=100>중간<option value=400>느린<option value=1000>아주 느린</select><tr><td><td><label style=display:block id=d7deskAutoLockLabel><input type=checkbox id=d7deskAutoLock>연결 해제 시 잠금</label></table></div><div id=d7amtkvm><h4 style="width:100%;border-bottom:1px solid gray">Intel® AMT 하드웨어 KVM</h4><table style=width:100%><tr><td>인코딩<td style=width:100px><select id=d7desktopmode style=float:right;width:200px><option value=1>RLE8, 가장 빠름<option value=2>RLE16, 권장<option value=3>RAW8, 느림<option value=4>RAW16, 매우 느림</select></table></div></div></div><div id=idx_dlgButtonBar style=padding:10px;margin-bottom:20px><input id=idx_dlgCancelButton type=button value=취소 style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)> <input id=idx_dlgOkButton type=button value=확인 style=float:right;width:80px onclick=dialogclose(1)><div><input id=idx_dlgDeleteButton type=button value=삭제 style=display:none onclick=dialogclose(2)></div></div></div><div id=topMenu style="z-index:1000;background-color:#eee;box-shadow:0 0 15px #666;font-family:Arial,Helvetica,sans-serif;border-radius:0 0 5px 5px;position:fixed;top:50px;right:5px;width:170px;display:none"><div style="padding:12px;border-top:1px solid gray;color:#000;cursor:pointer"onclick=topMenu(2)>내 파일</div><div style="padding:12px;border-top:1px solid gray;color:#000;cursor:pointer"onclick=topMenu(1)>내 계정</div><div id=logoutMenuOption><a id=logoutMenuOptionRef href=/logout><div style="padding:12px;border-top:1px solid gray;color:#000;cursor:pointer">로그아웃</div></a></div></div><audio id=chimes><source src=sounds/chimes.mp3 type=audio/mp3></audio><iframe name=fileUploadFrame style=display:none></iframe><script>"use strict";var i,random="{{{randomlength}}}",webState="{{{webstate}}}";for(i in webState=""!=webState?JSON.parse(decodeURIComponent(webState)):webState)localStorage.setItem(i,webState[i]);webState&&!webState.loctag&&localStorage.removeItem("loctag");var files,terminal,deskPinchZoom,urlargs=parseUriArgs(),args=(null!=urlargs.key&&(urlargs.key=""+urlargs.key),urlargs.key&&0==isAlphaNumeric(urlargs.key)&&delete urlargs.key,urlargs.locale&&0==isAlphaNumeric(urlargs.locale)&&delete urlargs.locale,delete urlargs.user,delete urlargs.pass,delete urlargs.viewmode,delete urlargs.gotonode,delete urlargs.gotodevicename,delete urlargs.gotomesh,delete urlargs.panel,parseUriArgs()),debugLevel=(args.key&&0==isAlphaNumeric(args.key)&&delete args.key,args.locale&&0==isAlphaNumeric(args.locale)&&delete args.locale,parseInt("{{{debuglevel}}}")),features=parseInt("{{{features}}}"),features2=parseInt("{{{features2}}}"),sessionTime=parseInt("{{{sessiontime}}}"),sessionRefreshTimer=null,domain="{{{domain}}}",domainUrl="{{{domainurl}}}",authCookie="{{{authCookie}}}",authRelayCookie="{{{authRelayCookie}}}",logoutControls=JSON.parse(decodeURIComponent("{{{logoutControls}}}")),authCookieRenewTimer=null,webRelayPort=parseInt("{{{webRelayPort}}}"),webRelayDns="{{{webRelayDns}}}",meshserver=null,xdr=null,usergroups=null,stars={},serverinfo=null,nodes=[],meshes={},filetree={},userinfo=null,serverinfo=null,users=null,nodeShortIdent=0,serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}",debugmode=!1,attemptWebRTC=0!=(128&features),StatusStrs=["연결 해제","연결 중 ...","설치...","연결됨","Intel&reg; AMT 연결"],agentsStr=["알 수 없는","Windows 32비트 콘솔","Windows 64비트 콘솔","Windows 32비트 서비스","Windows 64비트 서비스","Linux 32bit","Linux 64bit","MIPS","XENx86","Android ARM","Linux ARM","macOS x86-32비트","Android x86","PogoPlug ARM","Android","Linux Poky x86-32비트","macOS x86-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","MIPS24KC (OpenWRT)","Apple Silicon","FreeBSD x86-64","알 수 없는","Linux ARM 64 bit (glibc/2.24 NOKVM)","Alpine Linux x86 64 Bit (MUSL)","어시스턴트 (Windows)","Armada370 - ARM32/HF(libc/2.26)","OpenWRT x86-64","OpenBSD x86-64","알 수 없는","알 수 없는","MIPSEL24KC (OpenWRT)","ARMADA/CORTEX-A53/MUSL (OpenWRT)","Windows ARM 64bit console","Windows ARM 64bit service"],passRequirements="{{{passRequirements}}}",sessionActivity=(""!=passRequirements&&(passRequirements=JSON.parse(decodeURIComponent(passRequirements))),Date.now()),deskKeyboardShortcuts=[],nightMode=setNightMode(),xterm=null,xtermfit=null,xtermResizeTimer=null,devicePagingState=null,p11DeskConsoleMsgTimer=null,p12TermConsoleMsgTimer=null,p13FilesConsoleMsgTimer=null,webpSupport=!1;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)}args.locale||null!=(e=getstore("loctag",0))&&"*"!=e&&(args.locale=e),(window.onresize=center)(),QV("changeEmailId",0==(2097152&features)),QH("p1message","연결 중 ..."),go(1),document.onkeypress=ondeskkeypress,document.onkeydown=ondeskkeydown,document.onkeyup=ondeskkeyup,document.onclick=function(e){999==xxdialogMode&&"topMenuIcon"!=e.target.id&&(QV("topMenu",!1),xxdialogMode=0)},(meshserver=MeshServerCreateControl(domainUrl)).onStateChanged=onStateChanged,meshserver.onMessage=onMessage,meshserver.trace=args.trace,meshserver.Start();try{stars=JSON.parse(getstore("stars","{}"))}catch(e){}logoutControls&&logoutControls.logoutUrl&&(Q("logoutMenuOptionRef").href=logoutControls.logoutUrl);var t,e=localStorage.getItem("desktopsettings"),n=(null!=e&&(desktopsettings=JSON.parse(e)),applyDesktopSettings(),null!=args.webrtc&&(attemptWebRTC=1==args.webrtc),10<=sessionTime&&(sessionRefreshTimer=setTimeout(refreshCookieSession,Math.round(6e4*sessionTime*.8))),QV("setDarkModeLink",0==(3145728&features2)),deskKeyboardShortcuts=[],getstore("deskKeyShortcuts","0x0A002E,0x100000,0x100028,0x100026,0x10004C,0x10004D,0x11004D,0x100052,0x020073,0x080057,0x020009,0x100025,0x100027").split(","));for(t in n)deskKeyboardShortcuts.push(parseInt(n[t]));updateDeskShortcutKeys(),updateTermShortcutKeys()}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 onStateChanged(e,t,n,o){if(0==t){if(setDialogMode(0),go(0),deleteAllNotifications(),"noauth"==o)return void QH("p0span","인증을 수행할 수 없습니다.");2==n?setTimeout(serverPoll,5e3):QH("p0span","웹 소켓을 연결할 수 없습니다"),null!=authCookieRenewTimer&&(clearInterval(authCookieRenewTimer),authCookieRenewTimer=null),devicePagingState=null,updateDevicePageState()}else 2==t&&(meshserver.send({action:"usergroups"}),meshserver.send({action:"meshes"}),meshserver.send({action:"nodes",skip:null==devicePagingState?0:devicePagingState.skip}),meshserver.send({action:"files"}),authCookieRenewTimer=setInterval(function(){meshserver.send({action:"authcookie"})},18e5));QV("topMenuIcon",2==t)}function serverPoll(){xdr=null;try{xdr=new XDomainRequest}catch(e){}(xdr=xdr||new XMLHttpRequest).open("HEAD",window.location.href),xdr.timeout=15e3,xdr.onload=function(){xdr.status<500?reload():setTimeout(serverPoll,1e4)},xdr.onerror=xdr.ontimeout=function(){setTimeout(serverPoll,1e4)},xdr.send()}function updateSelf(){var e,t,n=0!=(256&features2);userinfo&&(n=4294967295!=userinfo.siteadmin&&0!=(1024&userinfo.siteadmin)||0!=(256&features2)),QV("p3AccountActions",0==(4&features)&&0==serverinfo.domainauth&&0==n),QV("logoutMenuOption",0==(4&features)&&0==serverinfo.domainauth),QV("p2AccountSecurity",0==(4&features)&&0==serverinfo.domainauth&&0!=(4096&features)&&0==n),QV("p2AccountImage",!n),QV("verifyEmailId",!0!==userinfo.emailVerified&&null!=userinfo.email&&1==serverinfo.emailcheck),QV("manageAuthApp",1!=serverinfo.lock2factor&&4096&features&&(1==userinfo.otpsecret||0==(131072&features2))),QV("manageOtp",1!=serverinfo.lock2factor&&0==(262144&features2)&&4096&features&&(1==userinfo.otpsecret||0<userinfo.otphkeys)),QV("authPhoneNumberCheck",null!=userinfo.phone),QV("authEmailSetupCheck",1==userinfo.otpekey&&null!=userinfo.email&&1==userinfo.emailVerified),QV("authAppSetupCheck",1==userinfo.otpsecret),QV("authCodesSetupCheck",0<userinfo.otpkeys),QV("p2AccountActions",0==(4&features)&&0==serverinfo.domainauth&&null!=userinfo&&0==userinfo._id.split("/")[2].startsWith("~")),QV("p3createMeshLink1",!1),QV("p3createMeshLink2",!1),null!=userinfo.flags&&1&userinfo.flags?(null==userinfo.accountImageRnd&&(userinfo.accountImageRnd=Math.floor(9999999999*Math.random())),Q("p2AccountImage").src="userimage.ashx?rnd="+userinfo.accountImageRnd):Q("p2AccountImage").src="images/user-256.png","number"==typeof userinfo.passchange&&(-1==userinfo.passchange?QH("p2nextPasswordUpdateTime"," - 다음에 로그인할 때 초기화하십시오."):null!=passRequirements&&"number"==typeof passRequirements.reset&&((n=userinfo.passchange+86400*passRequirements.reset-Math.floor(Date.now()/1e3))<0?QH("p2nextPasswordUpdateTime"," - 다음에 로그인할 때 초기화하십시오."):n<3600?(t=Math.floor(n/60),QH("p2nextPasswordUpdateTime",format(1==t?" - 1분 후에 재설정하십시오.":" - {0}분 후에 재설정하십시오.",t))):n<86400?(e=Math.floor(n/3600),QH("p2nextPasswordUpdateTime",format(1==e?" - 1시간 후에 재설정합니다.":" - {0}시간 후에 재설정하십시오.",e))):(t=Math.floor(n/86400),QH("p2nextPasswordUpdateTime",format(1==e?" - 1일 후에 재설정합니다.":" - {0}일 후에 재설정하십시오.",t)))))}function setSessionActivity(){sessionActivity=Date.now()}function checkIdleSessionTimeout(){Date.now()-sessionActivity>serverinfo.timeout&&(window.location.href="logout")}function onMessage(e,t){switch(t.action){case"serverinfo":(serverinfo=t.serverinfo).timeout&&(setInterval(checkIdleSessionTimeout,1e4),checkIdleSessionTimeout()),null!=userinfo&&updateSelf(),null!=serverinfo.certExpire&&0<=(d=Math.floor((serverinfo.certExpire-Date.now())/864e5))&&d<20&&addNotification({text:format("인증서가 {0} 일 후에 만료됩니다.",d)}),QV("manageEmail2FA",8388608&features&&1!=serverinfo.lock2factor),QV("managePhoneNumber1",33554432&features&&67108864&features&&1!=serverinfo.lock2factor),QV("managePhoneNumber2",33554432&features&&!(67108864&features)&&1!=serverinfo.lock2factor);break;case"authcookie":authCookie=t.cookie,authRelayCookie=t.rcookie;break;case"userinfo":userinfo=t.userinfo,QH("p3userName",userinfo.name),null!=serverinfo&&updateSelf();break;case"users":for(var n in users={},t.users)users[t.users[n]._id]=t.users[n];null!=currentUser&&(currentUser=users[currentUser._id]),updateUsers();break;case"wssessioncount":wssessions=t.wssessions,updateUsers();break;case"meshes":for(var n in meshes={},t.meshes)meshes[t.meshes[n]._id]=t.meshes[n];null!=currentMesh&&(currentMesh=meshes[currentMesh._id]),updateMeshes(),mainUpdate(4);break;case"usergroups":var o=0;if(Array.isArray(t.ugroups))for(var i in usergroups={},t.ugroups)o++,usergroups[t.ugroups[i]._id]=t.ugroups[i];else for(var i in usergroups=t.ugroups,t.ugroups)o++;0==o&&(usergroups=null);break;case"files":filetree=setupBackPointers(t.filetree),updateFiles();break;case"nodes":for(var n in nodes=[],t.nodes)for(var s in t.nodes[n])t.nodes[n][s].namel=t.nodes[n][s].name.toLowerCase(),t.nodes[n][s].rname?t.nodes[n][s].rnamel=t.nodes[n][s].rname.toLowerCase():t.nodes[n][s].rnamel=t.nodes[n][s].namel,t.nodes[n][s].meshnamel=meshes[n]?meshes[n].name.toLowerCase():"*",t.nodes[n][s].meshid=n,t.nodes[n][s].state=t.nodes[n][s].state||0,t.nodes[n][s].desc=t.nodes[n][s].desc,t.nodes[n][s].icon||(t.nodes[n][s].icon=1),t.nodes[n][s].ident=++nodeShortIdent,nodes.push(t.nodes[n][s]);null!=currentNode&&0==IsNodeViewable(currentNode)&&(currentNode=null,go(2)),null!=currentNode&&(null!=(currentNode=getNodeFromId(currentNode._id))?gotoDevice(currentNode._id,xxcurrentView,!0):go(2)),devicePagingState=null==t.totalcount?null:{total:t.totalcount,skip:t.skip,limit:t.limit},updateDevicePageState(),mainUpdate(4),0==xxcurrentView&&go(parseInt("{{viewmode}}")),gotoDevice("{{currentNode}}",parseInt("{{viewmode}}"));break;case"powertimeline":if(t.nodeid==powerTimelineReq){for(var i in powerTimelineNode=t.nodeid,powerTimeline=t.timeline,powerTimelineUpdate=Date.now()+3e5,powerTimeline)i%2==1&&(powerTimeline[i]=1e3*powerTimeline[i]);currentNode._id==t.nodeid&&drawDeviceTimeline()}break;case"getsysinfo":t.nodeid==powerTimelineReq&&(!0===t.noinfo?updateDeviceDetails(getNodeFromId(t.nodeid)):updateDeviceDetails(getNodeFromId(t.nodeid),t.hardware));break;case"lastconnect":null!=(k=getNodeFromId(t.nodeid))&&(k.lastconnect=t.time,k.lastaddr=t.addr);break;case"msg":if(null!=t.nodeid){var a=-1;if(null!=nodes)for(var i in nodes)if(nodes[i]._id==t.nodeid){a=i;break}if(-1!=a)if("console"==t.type)p15consoleReceive(nodes[a],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,titleid:t.titleid,msgid:t.msgid,args:t.args};null!=t.id&&(s.id=t.id),null!=t.nodeid&&(s.nodeid=t.nodeid),null!=t.tag&&(s.tag=t.tag),null!=t.url&&(s.url=t.url),null!=t.username&&(s.username=t.username),"number"==typeof t.maxtime&&(s.maxtime=t.maxtime),addNotification(s)}else if("userSessions"==t.type&&null!=currentNode&&currentNode._id==t.nodeid&&null==desktop){var l=[];if(null!=t.data)for(var i in t.data)"Active"!=t.data[i].State&&"Console"!=t.data[i].StationName&&3!=debugmode||l.push(t.data[i]);if(0==l.length)connectDesktop(null,1,null,t.tag);else if(1==l.length)connectDesktop(null,1,l[0].SessionId,t.tag);else{var r="";for(i in l)r+='<div style="text-align:left;cursor:pointer;background-color:gray;margin:5px;padding:5px;border-radius:5px" onclick=connectDesktop(event,1,'+l[i].SessionId+","+t.tag+")>"+l[i].State+", "+l[i].StationName,l[i].Username&&(l[i].Domain?r+=" - "+l[i].Domain+"/"+l[i].Username:r+=" - "+l[i].Username),r+="</div>";QH("p11DeskSessionSelector",r),QV("p11DeskSessionSelector",!0)}}}else"notify"==t.type&&(s={text:t.value,title:t.title,icon:t.icon,titleid:t.titleid,msgid:t.msgid,args:t.args},null!=t.id&&(s.id=t.id),null!=t.tag&&(s.tag=t.tag),null!=t.url&&(s.url=t.url),null!=t.username&&(s.username=t.username),"number"==typeof t.maxtime&&(s.maxtime=t.maxtime),addNotification(s));break;case"getnetworkinfo":if(currentNode._id!=t.nodeid)return;updateDeviceDetails(getNodeFromId(t.nodeid),null,t);break;case"getNotes":(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":var d;2==xxdialogMode&&"otpauth-request"==xxdialogTag&&(null!=t.err?(d=["","2FA가 잠겨 있습니다.","백업 코드가 잠겨 있습니다.","사용 중인 로그인 토큰","OTP 2FA 허용되지 않음","계정이 잠겼습니다.","OTPLIB를 로드할 수 없습니다."],0<t.err&&t.err<d.length?QH("d2optinfo",d[t.err]):QH("d2optinfo",format("오류 #{0}",t.err))):(52==(d=t.secret).length?d=d.split(/(.............)/).filter(Boolean).join(" "):32==d.length&&(d=(d=d.split(/(....)/).filter(Boolean).join(" ")).substring(0,20)+"<br/>"+d.substring(20)),QH("d2optinfo",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 /><div style=width:100%;text-align:center><tt id=d2optsecret secret="'+t.secret+'" style=font-size:15px>'+d+'</tt><br /><br />Token: <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></div>'),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>. 응용 프로그램에서 비밀을 지우고 다시 시도하십시오. 올바른 코드를 입력하는 데 몇 분 밖에 걸리지 않습니다.");break;case"otpauth-clear":if(xxdialogMode)return;setDialogMode(2,"2단계 인증 앱",1,null,t.success?"<b style=color:green>2단계 로그인 활성화가 제거되었습니다 </b>. 언제든지 이 기능을 다시 활성화 할 수 있습니다.":"<b style=color:red>2 단계 로그인 활성화 제거에 실패했습니다 </b>. 다시 시도하십시오.");break;case"otpauth-getpasswords":if(xxdialogMode)return;r="일회성 토큰을 보조 인증으로 사용할 수 있습니다. 토큰들을 생성하고 인쇄하여 안전한 장소에 보관하십시오.";if(r+="<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 style=width:100%;text-align:center>",t.passwords){var u=0;for(i in t.passwords){++u%2&&(r+="<tr>");for(var c=""+t.passwords[i].p;c.length<8;)c="0"+c;!0===t.passwords[i].u?r+="<td>"+c.substring(0,4)+"&nbsp;"+c.substring(4):r+="<td><strike style=color:#BBB>"+c.substring(0,4)+"&nbsp;"+c.substring(4)}}else r+="<tr><td>활성화된 토큰이 없습니다";r=(r+="</table></div></div><br />")+"<div><input type=button value='닫기' onclick=setDialogMode(0) style=float:right></input>"+"<input type=button value='새 토큰' onclick='account_manageOtp(1);'></input>",null!=t.passwords&&(r+="<input type=button value='지우기' onclick='account_manageOtp(2);'></input>"),setDialogMode(2,"백업 코드 관리",8,null,r+="</div><br />","otpauth-manage");break;case"verifyPhone":if(xxdialogMode&&"verifyPhone"!=xxdialogTag)return;setDialogMode(2,"휴대폰 알림",3,account_managePhoneConfirm,r=(r='<table><tr><td><img src="images/phone80.png" style=padding:8px>')+"<td>Check your phone and enter the verification code."+'<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"previousLogins":if(2==xxdialogMode&&"previousLogins"==xxdialogTag){var r="",p="BBB";if(0==t.events.length)r+="No previous login.";else{for(var i in r+="<div style=max-height:260px;overflow-y:scroll;overflow-x:hidden>",t.events)107==(n=t.events[i].m)?(n="유효한 로그인",p="BBD1BB",0):108==n?(n="잘못된 2FA",p="DD9DC3",0):109==n?(n="잠긴 계정",p="E1BBBB",0):110==n&&(n="잘못된 비밀번호",p="E1BBBB",0),r+="<div style=width:260px;background-color:#"+p+";border-radius:6px;margin-bottom:4px;padding:4px><div><b>"+EscapeHtml(n)+"</b><br />"+printDateTime(new Date(t.events[i].t))+"</div><div style=font-size:x-small>"+EscapeHtml(t.events[i].a.join(", "))+"</div></div></tr>";r+="</div>"}setDialogMode(2,"이전 로그인",1,null,r)}break;case"event":if(!t.event.noact)switch(t.event.action){case"serverinfochange":null!=t.event.lock2factor&&(serverinfo.lock2factor=t.event.lock2factor,updateSelf());break;case"userWebState":if(null!=localStorage){var m=JSON.parse(t.event.state);for(i in m)localStorage.setItem(i,m[i]);if(null!=m.stars&&(stars=JSON.parse(m.stars)),null!=m.loctag&&m.loctag!=oldLoctag?(null!=m.loctag?args.locale=m.loctag:delete args.locale,mainUpdate(132)):null!=m.stars&&(mainUpdate(4),"*"==Q("SearchInput").value)&&onSearchInputChanged(),currentNode&&refreshDevice(currentNode._id),null!=m.deskKeyShortcuts){deskKeyboardShortcuts=[];var g=m.deskKeyShortcuts.split(",");for(i in g)deskKeyboardShortcuts.push(parseInt(g[i]));updateDeskShortcutKeys()}}break;case"accountchange":if("object"!=typeof t.event.account||null==t.event.account)return void console.log(t.event);userinfo.name==t.event.account.name&&(t.event.account.siteadmin,userinfo.siteadmin,(t.event.account.quota!=userinfo.quota||0==(8&userinfo.siteadmin)&&0!=(8&t.event.account.siteadmin))&&meshserver.send({action:"files"}),userinfo=t.event.account,updateSelf(),t.event.nodeListChange==userinfo._id)&&meshserver.send({action:"nodes",skip:null==devicePagingState?0:devicePagingState.skip});break;case"createusergroup":case"usergroupchange":var h=(usergroups=null==usergroups?{}: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,h.desc=t.event.desc,h.links=t.event.links,h.flags=t.event.flags),meshserver.send({action:"meshes"}),meshserver.send({action:"nodes",skip:null==devicePagingState?0:devicePagingState.skip});break;case"deleteusergroup":if(null!=usergroups&&null!=usergroups[t.event.ugrpid]){delete usergroups[t.event.ugrpid];p=0;for(i in usergroups)p++;0==p&&(usergroups=null)}break;case"createmesh":null!=meshes[t.event.meshid]||!userinfo.manageAllDeviceGroups&&null==t.event.mesh.links[userinfo._id]||(meshes[t.event.meshid]=t.event.mesh,mainUpdate(132),meshserver.send({action:"files"}));break;case"meshchange":if(null==meshes[t.event.meshid]){var f=!1;for(i in null!=t.event.links[userinfo._id]&&(f=!0),null!=userinfo.links[t.event.meshid]&&(f=!0),userinfo.links)i.startsWith("ugrp/")&&null!=t.event.links[i]&&(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,relayid:t.event.relayid},meshserver.send({action:"nodes",skip:null==devicePagingState?0:devicePagingState.skip}))}else{if(meshes[t.event.meshid].name!=t.event.name)for(var i in meshes[t.event.meshid].name=t.event.name,nodes)nodes[i].meshid==t.event.meshid&&(nodes[i].meshnamel=t.event.name.toLowerCase());if(meshes[t.event.meshid].desc=t.event.desc,meshes[t.event.meshid].links=t.event.links,null!=t.event.relayid&&(meshes[t.event.meshid].relayid=t.event.relayid),0==IsMeshViewable(t.event.meshid)){20==xxcurrentView&&currentMesh==meshes[t.event.meshid]&&go(2),delete meshes[t.event.meshid];var v=[];for(i in nodes)(nodes[i].meshid!=t.event.meshid||null!=userinfo.links&&null!=userinfo.links[nodes[i]._id])&&v.push(nodes[i]);nodes=v,10<=xxcurrentView&&xxcurrentView<20&&currentNode&&!IsNodeViewable(currentNode)&&(setDialogMode(0),go(2),currentNode=null)}}mainUpdate(132),meshserver.send({action:"files"}),20==xxcurrentView&&currentMesh._id==t.event.meshid&&p20updateMesh();break;case"deletemesh":meshes[t.event.meshid]&&(delete meshes[t.event.meshid],updateMeshes(),meshserver.send({action:"files"}));v=[];for(i in nodes)nodes[i].meshid!=t.event.meshid&&v.push(nodes[i]);nodes=v,mainUpdate(4),20<=xxcurrentView&&xxcurrentView<30&&currentMesh._id==t.event.meshid&&(setDialogMode(0),go(2)),10<=xxcurrentView&&xxcurrentView<20&&currentNode&&!IsNodeViewable(currentNode)&&(setDialogMode(0),go(2));break;case"addnode":var k=t.event.node;meshes[k.meshid]&&null==getNodeFromId(k._id)&&(k.namel=k.name.toLowerCase(),k.rname?k.rnamel=k.rname.toLowerCase():k.rnamel=k.namel,k.meshnamel=meshes[k.meshid]?meshes[k.meshid].name.toLowerCase():"*",k.state=0,k.icon||(k.icon=1),k.ident=++nodeShortIdent,nodes.push(k),mainUpdate(4));break;case"removenode":a=-1;for(i in nodes)if(nodes[i]._id==t.event.nodeid){a=i;break}-1!=a&&(k=nodes[a],currentNode==k&&(10<=xxcurrentView&&xxcurrentView<20&&(setDialogMode(0),go(2)),currentNode=null),nodes.splice(a,1),mainUpdate(4));break;case"changenode":a=-1;for(i in nodes)if(nodes[i]._id==t.event.nodeid){a=i;break}-1!=a&&((k=nodes[a]).name=t.event.node.name,k.rname=t.event.node.rname,k.host=t.event.node.host,k.desc=t.event.node.desc,k.publicip=t.event.node.publicip,k.iploc=t.event.node.iploc,k.wifiloc=t.event.node.wifiloc,k.gpsloc=t.event.node.gpsloc,k.tags=t.event.node.tags,k.ssh=t.event.node.ssh,k.rdp=t.event.node.rdp,k.userloc=t.event.node.userloc,k.rdpport=t.event.node.rdpport,k.rfbport=t.event.node.rfbport,k.sshport=t.event.node.sshport,k.httpport=t.event.node.httpport,k.httpsport=t.event.node.httpsport,k.consent=t.event.node.consent,k.pmt=t.event.node.pmt,null!=t.event.node.agent&&(null==k.agent&&(k.agent={}),null!=t.event.node.agent.ver&&(k.agent.ver=t.event.node.agent.ver),null!=t.event.node.agent.id&&(k.agent.id=t.event.node.agent.id),null!=t.event.node.agent.caps&&(k.agent.caps=t.event.node.agent.caps),null!=t.event.node.agent.root&&(k.agent.root=t.event.node.agent.root),null!=t.event.node.agent.core?k.agent.core=t.event.node.agent.core:k.agent.core&&delete k.agent.core,k.agent.tag=t.event.node.agent.tag),null!=t.event.node.intelamt&&(null==k.intelamt&&(k.intelamt={}),null!=t.event.node.intelamt.state&&(k.intelamt.state=t.event.node.intelamt.state),null!=t.event.node.intelamt.host&&(k.intelamt.user=t.event.node.intelamt.host),null!=t.event.node.intelamt.user&&(k.intelamt.user=t.event.node.intelamt.user),null!=t.event.node.intelamt.tls&&(k.intelamt.tls=t.event.node.intelamt.tls),null!=t.event.node.intelamt.ver&&(k.intelamt.ver=t.event.node.intelamt.ver),null!=t.event.node.intelamt.tag&&(k.intelamt.tag=t.event.node.intelamt.tag),null!=t.event.node.intelamt.uuid&&(k.intelamt.uuid=t.event.node.intelamt.uuid),null!=t.event.node.intelamt.realm&&(k.intelamt.realm=t.event.node.intelamt.realm),null!=t.event.node.intelamt.flags&&(k.intelamt.flags=t.event.node.intelamt.flags),null!=t.event.node.intelamt.warn?k.intelamt.warn=t.event.node.intelamt.warn:delete k.intelamt.warn),null!=t.event.node.av&&(k.av=t.event.node.av),null!=t.event.node.wsc&&(k.wsc=t.event.node.wsc),k.namel=k.name.toLowerCase(),k.rname?k.rnamel=k.rname.toLowerCase():k.rnamel=k.namel,t.event.node.icon&&(k.icon=t.event.node.icon),refreshDevice(k._id),updateDeviceViewDevice(k),currentNode==k)&&updateDeviceDetails();break;case"nodemeshchange":a=-1;for(i in nodes)if(nodes[i]._id==t.event.nodeid){a=i;break}if(-1!=a){k=nodes[a];null!=meshes[t.event.newMeshId]||null!=userinfo.links&&null!=userinfo.links[k._id]?(k.meshid=t.event.newMeshId,k.meshnamel=meshes[t.event.newMeshId]?meshes[t.event.newMeshId].name.toLowerCase():"*"):(10<=xxcurrentView&&xxcurrentView<20&&currentNode&&!IsNodeViewable(currentNode)&&(setDialogMode(0),go(2),currentNode=null),nodes.splice(a,1)),mainUpdate(4),refreshDevice(t.event.nodeid)}else{k=t.event.node;if(!meshes[k.meshid])break;k.namel=k.name.toLowerCase(),k.rname?k.rnamel=k.rname.toLowerCase():k.rnamel=k.namel,k.meshnamel=meshes[k.meshid]?meshes[k.meshid].name.toLowerCase():"*",k.state=0,k.icon||(k.icon=1),k.ident=++nodeShortIdent,nodes.push(k),mainUpdate(4)}break;case"nodeconnect":a=-1;for(i in nodes)if(nodes[i]._id==t.event.nodeid){a=i;break}-1!=a&&((k=nodes[a]).conn=t.event.conn,k.pwr=t.event.pwr,0==(1&k.conn)&&delete k.sessions,refreshDevice(k._id),updateDeviceViewDevice(k));break;case"login":null!=users&&users["user/"+domain+"/"+t.event.username.toLowerCase()]&&(users["user/"+domain+"/"+t.event.username.toLowerCase()].login=t.event.time);break;case"notify":s={text:t.event.value,title:t.event.title,icon:t.event.icon,titleid:t.titleid,msgid:t.msgid,args:t.args};null!=t.id&&(s.id=t.id),null!=t.event.tag&&(s.tag=t.event.tag),"number"==typeof t.maxtime&&(s.maxtime=t.maxtime),addNotification(s);break;case"sysinfohash":null!=currentNode&&t.event.nodeid==powerTimelineReq&&meshserver.send({action:"getsysinfo",nodeid:t.event.nodeid});break;case"ifchange":null!=currentNode&&currentNode._id==t.event.nodeid&&meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id});break;case"devicesessions":if(null!=(k=getNodeFromId(t.event.nodeid))){if(k.sessions=t.event.sessions,null!=k.sessions){for(var i in k.sessions)0==Object.keys(k.sessions[i]).length&&delete k.sessions[i];0==Object.keys(k.sessions).length&&delete k.sessions}refreshDevice(t.event.nodeid),updateDeviceViewDevice(k),xxdialogTag=="SESSIONS-"+t.event.nodeid&&showDeviceSessions(t.event.nodeid,!0),xxdialogTag=="HELPREQ-"+t.event.nodeid&&showDeviceHelpRequests(t.event.nodeid,!0)}}}}check_webp_feature("lossy",function(e,t){webpSupport=t});var updateNaggleTimer=null,updateNaggleFlags=0;function mainUpdate(e){updateNaggleFlags|=e,null==updateNaggleTimer&&(updateNaggleTimer=setTimeout(function(){1&updateNaggleFlags&&onSearchInputChanged(),4&updateNaggleFlags&&(updateDevices(),updateDeviceDetails()),128&updateNaggleFlags&&updateMeshes(),updateNaggleTimer=null,updateNaggleFlags=0,gotoStartViewPage()},150))}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(96==args.gotonode.length&&(args.gotonode=btoa(hex2rstr(args.gotonode)).split("+").join("@").split("/").join("$")),null==getNodeFromId("node/"+domain+"/"+args.gotonode))return;args.panel&&(currentDevicePanel=parseInt(args.panel)),gotoDevice("node/"+domain+"/"+args.gotonode,e)}else if(null!=args.gotodevicename){var t=null;if(null!=nodes)for(var n in nodes)nodes[n].name==args.gotodevicename&&(t=nodes[n]._id);t&&(gotoDevice(t,e),go(e))}else if(null!=args.gotomesh){if(null==meshes["mesh/"+domain+"/"+args.gotomesh])return;gotoMesh("mesh/"+domain+"/"+args.gotomesh),go(e)}else isNaN(e)?(setDialogMode(0),go(1)):go(e);delete args.gotonode,delete args.gotomesh,delete args.panel,xxcurrentView<2&&go(2)}}function topMenu(e){null!=xxdialogMode&&0!=xxdialogMode&&999!=xxdialogMode||(void 0===e?1==("none"==QS("topMenu").display)?0!=xxdialogMode&&null!=xxdialogMode||(QV("topMenu",!0),xxdialogMode=999):(QV("topMenu",!1),xxdialogMode=0):(QV("topMenu",!1),xxdialogMode=0,1==e&&3!=xxcurrentView&&goForward("account"),2==e&&5!=xxcurrentView&&goForward("files")))}var filetreelinkpath,backStack=[];function goBack(){xxdialogMode||(0<backStack.length&&backStack.pop(),goStack())}function goForward(e){xxdialogMode||(backStack.push(e),goStack())}function goStack(){var e,t;0==backStack.length?go(2):("node"==(t=(e=backStack[backStack.length-1]).split("/")[0])&&(setupDeviceMenu(0),gotoDevice(e)),"mesh"==t&&gotoMesh(e),"account"==t&&go(3),"devices"==t&&go(2),"files"==t&&go(5))}function updateFooterMenu(e){for(;null!=e&&e.length<3;)e.push({n:""});var t="",n="";if(null!=e)for(var o in e)t+='<td style="cursor:pointer'+(""==n?"":";border-left:solid 1px white")+'" onclick="'+e[o].f+'">'+e[o].n,n=e[o].n;QH("footerMenu","<tr>"+t)}function account_viewPreviousLogins(){xxdialogMode||(setDialogMode(2,"이전 로그인",1,null,"불러오는 중 ...","previousLogins"),meshserver.send({action:"previousLogins"}))}function account_manageImage(e){var t,n,o,i;xxdialogMode||(setDialogMode(2,"계정 이미지 관리",7,account_manageImageEx2,'<input id=p2file type=file style=width:100% accept="image/*" onchange=account_manageImageEx()><div style=width:100%><canvas id=p2canvas width=256 height=256 style="width:256px;height:256px;margin-left:12px;margin-top:8px;border-radius:16px;box-shadow: 0px 0px 15px #000" onclick=account_canvasClick() /></div>',(t=0==e?userinfo:currentUser)._id),n=Q("p2canvas").getContext("2d"),null==t.accountImageRnd&&(t.accountImageRnd=Math.floor(9999999999*Math.random())),o="",1==e&&(o="&id="+t._id.split("/")[2]),(i=new Image).onload=function(){n.clearRect(0,0,256,256),n.drawImage(i,0,0)},i.src=null!=t.flags&&1&t.flags?"userimage.ashx?rnd="+t.accountImageRnd+o:"images/user-256.png",QE("idx_dlgDeleteButton",null!=t.flags&&1&t.flags),QE("idx_dlgOkButton",!1))}function account_canvasClick(){Q("p2file").click()}function account_manageImageEx(){var e=Q("p2file").files[0],i=new Image;i.onload=function(){var e=0,t=0,n=Math.min(i.width,i.height),o=(i.width>n&&(e=(i.width-n)/2),i.height>n&&(t=(i.height-n)/2),Q("p2canvas").getContext("2d"));o.imageSmoothingEnabled=!0,o.webkitImageSmoothingEnabled=!0,o.mozImageSmoothingEnabled=!0,o.clearRect(0,0,256,256),o.drawImage(i,e,t,n,n,0,0,256,256),QE("idx_dlgOkButton",!0)},i.src=URL.createObjectURL(e)}function account_manageImageEx2(e,t){meshserver.send({action:"updateUserImage",userid:t,image:2==e?0:Q("p2canvas").toDataURL("image/jpeg",.8)})}function toggleNightMode(){var e;xxdialogMode||(setDialogMode(2,"야간 모드",3,toggleNightModeEx,"<input type=radio id=night0 name=nightmoderadio value=0 "+(0==(e=getstore("nightMode","0"))?"checked":"")+"><label for=night0>브라우저 기본값</label><br>"+("<input type=radio id=night2 name=nightmoderadio value=2 "+(2==e?"checked":"")+"><label for=night2>라이트 모드</label><br>")+("<input type=radio id=night1 name=nightmoderadio value=1 "+(1==e?"checked":"")+"><label for=night1>다크 모드</label><br>")),QV("uiMenu",!1))}function toggleNightModeEx(){var e="0";Q("night1").checked&&(e="1"),putstore("nightMode",e=Q("night2").checked?"2":e),setNightMode()}function setNightMode(){var e=getstore("nightMode","0");return nightMode=!1,0!=(1048576&features2)&&(e="1"),"1"==(e=0!=(2097152&features2)?"2":e)?nightMode=!0:"0"==e&&window.matchMedia&&(nightMode=window.matchMedia("(prefers-color-scheme: dark)").matches),nightMode?(QC("body").add("night"),QS("body")["background-color"]="#000",QS("body").color="lightgray"):(QC("body").remove("night"),QS("body")["background-color"]="#FFF",QS("body").color="black"),nightMode}function account_managePhone(){xxdialogMode||0==(33554432&features)||(null!=userinfo.phone?(setDialogMode(2,"휴대폰 알림",3,account_managePhoneRemove,'<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>'+("<td style=text-align:center><div style=padding:6px>검증된 휴대폰 번호</div><div style=font-size:20px>"+userinfo.phone+"</div>")+"<div style=margin:10px><label><input id=d2delPhone type=checkbox onclick=account_managePhoneRemoveValidate() />휴대폰 번호 제거</label></div>"),account_managePhoneRemoveValidate):(setDialogMode(2,"휴대폰 알림",3,account_managePhoneAdd,'<table style=width:100%><tr><td style=width:56px><img src="images/phone80.png" style=padding:8px>'+"<td>Enter your SMS capable phone number. Once verified, the number may be used for login verification and other notifications."+'<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(){var e;xxdialogMode||0==(8388608&features)||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=1==userinfo.otpekey&&null!=userinfo.email&&1==userinfo.emailVerified)?"checked":"")+"/>2단계 이메일 인증을 사용합니다.</label>")}function account_manageAuthApp(){xxdialogMode||0==(4096&features)||(1==userinfo.otpsecret?account_removeOtp:account_addOtp)()}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){2==xxdialogMode&&"otpauth-manage"==xxdialogTag&&dialogclose(0),xxdialogMode||0==(4096&features)||1!=userinfo.otpsecret&&userinfo.otphkeys<1||meshserver.send({action:"otpauth-getpasswords",subaction:e})}function account_showVerifyEmail(){xxdialogMode||1==userinfo.emailVerified||1!=serverinfo.emailcheck||setDialogMode(2,"이메일 검증",3,account_showVerifyEmailEx,"검증용 메일을 보내려면 OK을 클릭하십시오:<br /><div style=padding:8px><b>"+EscapeHtml(userinfo.email)+"</b></div>검증을 받으려면 몇 분 정도 기다려주십시오.")}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){xxdialogMode||(setDialogMode(2,"이메일 주소 변경",3,account_changeEmail,addHtmlValue("이메일","<input id=dp3email style=width:170px maxlength=256 onchange=account_validateEmail() onkeyup=account_validateEmail(event) />")),null!=userinfo.email&&(Q("dp3email").value=userinfo.email),account_validateEmail(),Q("dp3email").focus())}function account_validateEmail(e,t){QE("idx_dlgOkButton",validateEmail(Q("dp3email").value)&&Q("dp3email").value!=userinfo.email),null!=e&&13==e.keyCode&&dialogclose(1)}function account_changeEmail(){meshserver.send({action:"changeemail",email:Q("dp3email").value})}function account_showDeleteAccount(){xxdialogMode||(setDialogMode(2,"계정 삭제",0,null,"<form method=post><table style=margin-left:10px><input type=hidden name=action value=deleteaccount /><input type=hidden name=authcookie value="+authCookie+" /><tr>"+"<td align=right>암호:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>"+"</tr><tr><td align=right>암호:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>"+"</tr></table><div style=padding:10px;margin-bottom:4px>"+'<input id=account_dlgCancelButton type=button value="취소" style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>'+'<input id=account_dlgOkButton type=submit value="확인" style="float:right;width:80px" onclick=dialogclose(1)>'+"</div><br /></form>"),account_validateDeleteAccount(),Q("apassword1").focus())}function account_showChangePassword(){if(!xxdialogMode){var e="<table style=margin-left:10px>",e=(e=(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>")+("<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>"))+("<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>");if(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=[],o=0;for(t in passRequirements)"reset"!=t&&"hint"!=t&&(n.push(t+":"+passRequirements[t]),o++);0<o&&(e+="<br /><span style=font-size:x-small>"+format("요구사항 : {0}.",n.join(", "))+"</span>")}setDialogMode(2,"비밀번호 변경",3,account_showChangePasswordEx,e+="<br />"),Q("apassword0").focus(),account_validateNewPassword()}return!1}function account_showChangePasswordEx(){var e;Q("apassword1").value==Q("apassword2").value&&(e={action:"changepassword",oldpass:Q("apassword0").value,newpass:Q("apassword1").value},65536&features&&(e.hint=Q("apasswordhint").value),meshserver.send(e))}function account_createMesh(){var e;xxdialogMode||(4294967295!=userinfo.siteadmin&&0!=(64&userinfo.siteadmin)?setDialogMode(2,"새 장치 그룹",1,null,"이 계정에는 새 장치 그룹을 만들 수 있는 권한이 없습니다."):!0!==userinfo.emailVerified&&1==serverinfo.emailcheck&&4294967295!=userinfo.siteadmin?setDialogMode(2,"계정 보안",1,null,'이메일 주소가 확인 될 때까지 장치에 액세스 할 수 없습니다. 이것은 비밀번호 복구에 필요합니다. 이메일 주소를 변경하고 확인하려면 "내 계정"으로 이동하십시오.'):262144&features&&!(1==userinfo.otpsecret||0<userinfo.otphkeys||0<userinfo.otpkeys||8388608&features&&1==userinfo.otpekey)?setDialogMode(2,"계정 보안",1,null,'2단계 인증이 활성화 될 때까지 장치에 액세스 할 수 없습니다. 이것은 추가 보안을 위해 필요합니다. "내 계정" 탭으로 이동하여 "계정 보안" 부분을 보십시오.'):(e=addHtmlValue("이름","<input id=dp3meshname style=width:170px maxlength=64 onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate() />"),setDialogMode(2,"장치 그룹 만들기",3,account_createMeshEx,e=(e+=addHtmlValue("유형","<div style=width:170px;margin:0;padding:0><select id=dp3meshtype style=width:100% onchange=account_validateMeshCreate() ><option value=2>소프트웨어 에이전트 그룹</option><option value=1>오직 Intel&reg; AMT만</option></select></div>"))+addHtmlValue("설명","<div style=width:170px;margin:0;padding:0><textarea id=dp3meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>")),account_validateMeshCreate(),Q("dp3meshname").focus()))}function account_validateMeshCreate(){QE("idx_dlgOkButton",0<Q("dp3meshname").value.length)}function account_createMeshEx(e,t){meshserver.send({action:"createmesh",meshname:Q("dp3meshname").value,meshtype:parseInt(Q("dp3meshtype").value),desc:Q("dp3meshdesc").value})}function account_validateDeleteAccount(){QE("account_dlgOkButton",0<Q("apassword1").value.length&&Q("apassword1").value==Q("apassword2").value)}function account_validateNewPassword(){var e,t="",n=0<Q("apassword0").value.length&&0<Q("apassword1").value.length&&Q("apassword1").value==Q("apassword2").value&&Q("apassword0").value!=Q("apassword1").value;65536&features&&Q("apasswordhint").value==Q("apassword1").value&&(n=!1),""!=Q("apassword1").value&&(null==passRequirements||""==passRequirements?t=80<=(e=checkPasswordStrength(Q("apassword1").value))?"<span style=color:green>Strong<span>":60<=e?"<span style=color:blue>&#9679;<span>":"<span style=color:red>&#9679;<span>":0==checkPasswordRequirements(Q("apassword1").value,passRequirements)&&(n=!1,t="<span style=color:red>정책<span>")),QH("dxPassWarn",t),QE("idx_dlgOkButton",n)}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 s,a=0;a<e.length;a++)n[e[a]]=(n[e[a]]||0)+1,t+=5/n[e[a]];for(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,s=0,a=0;a<e.length;a++)/\d/.test(e[a])&&n++,/[a-z]/.test(e[a])&&o++,/[A-Z]/.test(e[a])&&i++,/\W/.test(e[a])&&s++;return!(t.numeric&&n<t.numeric||t.lower&&o<t.lower||t.upper&&i<t.upper||t.nonalpha&&s<t.nonalpha)}function updateMeshes(){var e="",t=0;for(i in meshes){t++;var n=GetMeshRights(meshes[i]),o="부분적인 권리";4294967295==n?o="전체 관리자":0==n&&(o="권한이 없습니다."),e=(e=(e+="<div style=cursor:pointer onclick=goForward('"+i+"')>")+'<div style="float:left;margin-left:4px"><img src="/images/meshicon50.png" width=50 height=50 /></div>'+"<div class=meshList>")+("<div><div style=color:black;padding-left:12px;padding-top:2px><b>"+EscapeHtml(meshes[i].name)+"</b></div><div style=padding-left:12px;padding-top:3px;color:black>"+o+"</div></div>")+"</div></div>"}QH("p3meshes",e),QV("p3noMeshFound",0==t)}function gotoMesh(e){null==(currentMesh=meshes[e])&&goBack(),p20updateMesh(),go(20)}var sortorder,filetreelocation=[];function p5refreshFiles(){meshserver.send({action:"files"})}function updateFiles(){if(QV("MainMenuMyFiles",0==(8&features)),0==(8&features)){for(var e,t,n="",o="",i="<a style=cursor:pointer;color:black onclick=p5folderup(0)>최상위폴더</a>",s="Root",a=filetree,l=1,r=[],d=filetreelinkpath,u=[],c=document.getElementsByName("fc"),p=0;p<c.length;p++)c[p].checked&&u.push(c[p].value);for(p in filetreelinkpath="",filetreelocation){if(null==a.f||null==a.f[filetreelocation[p]])break;r.push(filetreelocation[p]),s+=" / "+filetreelocation[p],1==l?(e=filetreelocation[p].split("/"),t=window.location+e[0]+"files/"+e[2],filetreelinkpath+=filetreelocation[p]):""!=filetreelinkpath&&(filetreelinkpath+="/"+filetreelocation[p],2<l)&&(t+="/"+filetreelocation[p]),a=a.f[filetreelocation[p]],i+=" / <a style=cursor:pointer;color:black onclick=p5folderup("+l+")>"+EscapeHtml(null!=a.n?a.n:filetreelocation[p])+"</a>",l++}filetreelocation=r;var m=s.toLowerCase().startsWith("root / "+userinfo._id+" / public"),g=p5sort_files(a.f);for(p in g){var h,f=g[p],v=f.n,k=40<v.length?EscapeHtml(v.substring(0,40))+"...":EscapeHtml(v),x="",y=(null!=f.s&&(x=getFileSizeStr(f.s)),"");y=f.t<3||4==f.t?(h=1==f.t||4==f.t?p5getQuotabar(f):"","<div class=filelist file=999><input file=999 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+EscapeHtml(v)+"'>&nbsp;<span style=float:right;padding-right:4px>"+h+"</span><span><div class=fileIcon"+f.t+'></div><a style=cursor:pointer onclick=p5folderset("'+encodeURIComponent(f.nx)+'")>'+k+"</a></span></div>"):(v=k,h="",m&&(h=" (<a style=cursor:pointer onclick='p5showPublicLink(\""+t+"/"+f.nx+"\")'>링크</a>)"),0<f.s&&(v='<a rel="noreferrer noopener" target="_blank" href="downloadfile.ashx?link='+encodeURIComponent(filetreelinkpath+"/"+f.nx)+'">'+k+"</a>"+h),"<div class=filelist file=3><input file=3 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+f.nx+"'>&nbsp;<span style=float:right;padding-right:4px>"+EscapeHtml(x)+"</span><span><div class=fileIcon"+f.t+"></div>"+v+"</span></div>"),f.t<3?n+=y:o+=y}if(QH("p5rightOfButtons",p5getQuotabar(a)),QH("p5files",n+o),QH("p5currentpath",i),QE("p5FolderUp",0!=filetreelocation.length),QV("p5PublicShare",m),d==filetreelinkpath)for(c=document.getElementsByName("fc"),p=0;p<c.length;p++)c[p].checked=0<=u.indexOf(c[p].value);p5setActions()}}function getNiceSize(e){return e<=0?"저장 용량 초과":e<2048?format("{0}b 남음",e):e<2097152?format("{0} k 남음",Math.round(e/1024)):e<2147483648?format("{0}분 남음",Math.round(e/1024/1024)):format("{0}g 남음",Math.round(e/1024/1024/1024))}function p5getQuotabar(e){for(;1<e.t&&4!=e.t;)e=e.parent;return 1!=e.t&&4!=e.t||null==e.maxbytes?"":getNiceSize(e.maxbytes-e.s)+" <progress style=height:10px;width:100px value="+e.s+" max="+e.maxbytes+" />"}function p5showPublicLink(e){setDialogMode(2,"공개 링크",1,null,'<input type=text style=width:100% value="'+e+'" readonly />')}function p5sort_filename(e,t){return e.ln>t.ln?+sortorder:e.ln<t.ln?-1*sortorder:0}function p5sort_timestamp(e,t){return e.d>t.d?+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=[],o=Q("p5sortdropdown").value;for(t in e)e[t].nx=t,null==e[t].n&&(e[t].n=t),e[t].ln=e[t].n.toLowerCase(),n.push(e[t]);return sortorder=1,3<o&&(sortorder=-1,o-=3),1==o?n.sort(p5sort_filename):2==o?n.sort(p5sort_bysize):3==o&&n.sort(p5sort_timestamp),n}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,n=0,o=0;for(t in e.f)setupBackPointers(e.f[t]),(e.f[t].parent=e).f[t].s&&(n+=e.f[t].s),e.f[t].c&&(o+=e.f[t].c),3==e.f[t].t&&o++;e.s=n,e.c=o}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="'+encodeURIComponent(filetreelinkpath)+'" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=hidden name=authCookie value='+authCookie+" /><input type=submit id=p5loginSubmit style=display:none /></form>"),updateUploadDialogOk("p5uploadinput")}function p5uploadFileEx(){Q("p5loginSubmit").click()}function updateUploadDialogOk(e){QE("idx_dlgOkButton",""!=Q(e).value)}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&&p5clipboard.push(t[n].value);p5updateClipview()}function p5pasteFile(){var e="";setDialogMode(2,"붙여넣기",3,p5pasteFileEx,e=null!=p5clipboard&&0<p5clipboard.length?format("{2} 항목 {1}의 {0}을 이 위치로 확정하시겠습니까?",0==p5clipboardCut?"copy":"move",p5clipboard.length,1<p5clipboard.length?"s":""):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(haltEvent(e),QV("bigfail",!1),QV("bigok",!1),null!=e.dataTransfer&&0!=e.dataTransfer.files.length&&0!=filetreelocation.length)for(var t=[],n=[],o=[],i=[],s=e.dataTransfer.files.length,a=0;a<e.dataTransfer.files.length;a++){var l=new FileReader,r=e.dataTransfer.files[a];t.push(r.name),n.push(r.size),o.push(r.type),l.onload=function(e){i.push(e.target.result),0==--s&&(Q("p5fileDragName").value=t.join("*"),Q("p5fileDragSize").value=n.join("*"),Q("p5fileDragType").value=o.join("*"),Q("p5fileDragData").value=i.join("*"),Q("p5fileDragLink").value=encodeURIComponent(filetreelinkpath),Q("p5loginSubmit2").click())},l.readAsDataURL(r)}}var p5dragtimer=null;function p5fileDragOver(e){haltEvent(e),null!=p5dragtimer&&(clearTimeout(p5dragtimer),p5dragtimer=null);e=!0;0==filetreelocation.length&&(e=!1),QV("bigok",e),QV("bigfail",!e)}function p5fileDragLeave(e){haltEvent(e),"p5filetable"!=e.target.id?(QV("bigfail",!1),QV("bigok",!1)):p5dragtimer=setTimeout("QV('bigfail',false);QV('bigok',false);p5dragtimer=null;",200)}function onRealNameCheckBox(){putstore("showRealNames",(showRealNames=Q("RealNameCheckBox").checked)?1:0),mainUpdate(5)}function onOnlineCheckBox(e){putstore("onlineOnly",Q("OnlineCheckBox").checked?1:0),onSearchInputChanged()}function updateDevicePageState(){var e,t;null==devicePagingState||devicePagingState.total<=devicePagingState.limit?(QV("devViewPageState",!1),QV("devViewPageButton2",!1),QV("devViewPageButton3",!1)):(e=Math.floor((devicePagingState.skip+devicePagingState.limit)/devicePagingState.limit),t=Math.ceil(devicePagingState.total/devicePagingState.limit),QV("devViewPageState",!0),QV("devViewPageButton2",!0),QV("devViewPageButton3",!0),QH("devViewPageState",e+"/"+t))}function onDeviceViewPageChange(e){if(null!=devicePagingState){var t=Math.floor((devicePagingState.skip+devicePagingState.limit)/devicePagingState.limit),n=Math.ceil(devicePagingState.total/devicePagingState.limit);switch(e){case 2:1<t&&meshserver.send({action:"nodes",skip:(t-2)*devicePagingState.limit});break;case 3:t<n&&meshserver.send({action:"nodes",skip:t*devicePagingState.limit})}}}function onDeviceSearchChanged(e){setTimeout(function(){onSearchInputChanged()},10)}function clearSearchInput(){Q("SearchInput").value="",Q("OnlineCheckBox").checked=!1,onSearchInputChanged()}function onSearchInputChanged(){var e=Q("SearchInput").value.toLowerCase().trim(),t=(putstore("_search",Q("SearchInput").value),QS("SearchInput")["background-color"]=""==e?"#FFFFFF":"#FDFFBE",null),n=null,o=null,i=null,s=null,a=null,l=null,r=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.startsWith("atag :".toLowerCase())?s=Q("SearchInput").value.trim().substring("atag :".length).toLowerCase():e.startsWith("a:".toLowerCase())?s=Q("SearchInput").value.trim().substring("a:".length).toLowerCase():e.startsWith("os :".toLowerCase())?l=Q("SearchInput").value.trim().substring("os :".length).toLowerCase():e.startsWith("amt :".toLowerCase())?r=Q("SearchInput").value.trim().substring("amt :".length).toLowerCase():"wsc:ok"==e?a=1:"wsc:noav"==e?a=2:"wsc:noupdate"==e?a=3:"wsc:nofirewall"==e?a=4:"wsc:any"==e&&(a=5),""==e)for(var d in nodes)nodes[d].v=!0;else if(null!=n)for(var d in nodes)nodes[d].v=null!=nodes[d].ip&&0<=nodes[d].ip.indexOf(n);else if(null!=o)for(var d in nodes)nodes[d].v=0<=meshes[nodes[d].meshid].name.toLowerCase().indexOf(o);else if(null!=i)for(var d in nodes)nodes[d].v=null==nodes[d].tags&&""==i||null!=nodes[d].tags&&0<=nodes[d].tags.indexOf(i);else if(null!=s)for(var d in nodes)nodes[d].v=null!=nodes[d].agent&&null==nodes[d].agent.tag&&""==s||null!=nodes[d].agent&&null!=nodes[d].agent.tag&&0<=nodes[d].agent.tag.toLowerCase().indexOf(s);else if(null!=t){for(var d in nodes)if(nodes[d].v=!1,nodes[d].users&&0<nodes[d].users.length)for(var u in nodes[d].users)0<=nodes[d].users[u].toLowerCase().indexOf(t)&&(nodes[d].v=!0)}else if(null!=l)for(var d in nodes)nodes[d].v=null!=nodes[d].osdesc&&0<=nodes[d].osdesc.toLowerCase().indexOf(l);else if(null!=r)for(var d in nodes)nodes[d].v=null!=nodes[d].intelamt&&(""==r||nodes[d].intelamt.state==r);else if(null!=a)for(var d in nodes)nodes[d].v=!1,!nodes[d].wsc||(1==a&&"OK"==nodes[d].wsc.antiVirus&&"OK"==nodes[d].wsc.autoUpdate&&"OK"==nodes[d].wsc.firewall||(2==a||5==a)&&"OK"!=nodes[d].wsc.antiVirus||(3==a||5==a)&&"OK"!=nodes[d].wsc.autoUpdate||(4==a||5==a)&&"OK"!=nodes[d].wsc.firewall)&&(nodes[d].v=!0);else if("*"==e)for(var d in nodes)nodes[d].v=1==stars[nodes[d]._id];else try{var c=e.split(/\s+/).join("|"),p=new RegExp(c);for(d in nodes)nodes[d].v=32768&features2?p.test(nodes[d].name.toLowerCase())||null!=nodes[d].rnamel&&p.test(nodes[d].rnamel.toLowerCase()):showRealNames?null!=nodes[d].rnamel&&p.test(nodes[d].rnamel.toLowerCase()):p.test(nodes[d].name.toLowerCase())}catch(e){for(var d in nodes)nodes[d].v=!0}if(Q("OnlineCheckBox").checked)for(var d in nodes)null!=nodes[d].conn&&0!=nodes[d].conn||(nodes[d].v=!1);mainUpdate(4)}var gotKeyPressEvent=!1;function ondeskkeypress(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel){if(gotKeyPressEvent=!0,Q("softKeyboard").value="",null!=currentNode){var n=GetMeshRights(currentNode.meshid);if(0==(0==(8192&features2)&&(4294967295==n||0!=(8&n)&&0==(256&n))))return!1;n=4294967295!=n&&0!=(8&n)&&0==(256&n)&&0!=(4096&n);if(1==n&&(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(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&1!==t){if(1==e.altKey)return!0;gotKeyPressEvent=!0,Q("softKeyboard").value="";n=0;return 0!=e.charCode?n=e.charCode:0!=e.keyCode&&(n=e.keyCode),0!=n&&("sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+String.fromCharCode(n)):terminal.sendText(String.fromCharCode(n))),!1}}function ondeskkeydown(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel){if(gotKeyPressEvent=!1,Q("softKeyboard").value="",null!=currentNode){var n=GetMeshRights(currentNode.meshid);if(0==(0==(8192&features2)&&(4294967295==n||0!=(8&n)&&0==(256&n))))return!1;n=4294967295!=n&&0!=(8&n)&&0==(256&n)&&0!=(4096&n);if(1==n&&(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(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&1!==t){if(1==e.altKey)return!0;Q("softKeyboard").value="",gotKeyPressEvent=!1;n=0;0!=e.charCode?n=e.charCode:0!=e.keyCode&&(n=e.keyCode),8==n?terminal.sendText(String.fromCharCode(n)):e.ctrlKey&&64<=n&&n<=95&&("sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+String.fromCharCode(n-64)):terminal.sendText(String.fromCharCode(n-64)))}}function ondeskkeyup(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel){var n=Q("softKeyboard").value;if(Q("softKeyboard").value="",null!=currentNode){var o=GetMeshRights(currentNode.meshid);if(0==(0==(8192&features2)&&(4294967295==o||0!=(8&o)&&0==(256&o))))return!1;o=4294967295!=o&&0!=(8&o)&&0==(256&o)&&0!=(4096&o);if(1==o&&(1==e.altKey||1==e.ctrlKey||e.keyCode<32&&8!=e.keyCode&&13!=e.keyCode||90<e.keyCode))return!1}if(!(0==gotKeyPressEvent&&0<n.length&&desktop.m.SendKeyUnicode))return desktop.m.handleKeyUp(e);o=n[n.length-1].charCodeAt(0);desktop.m.SendKeyUnicode(desktop.m.KeyAction.DOWN,o),desktop.m.SendKeyUnicode(desktop.m.KeyAction.UP,o)}if(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&0==gotKeyPressEvent&&1!==t)return 1==e.altKey||(n=Q("softKeyboard").value,Q("softKeyboard").value="","sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+n):n&&terminal.sendText(n),!1)}var deviceHeaderCount,sort=0,deviceHeaderId=0,deviceHeaders={},showRealNames=!1,deviceHeaderTotal=0,deviceHeaders={},deviceHeadersTitles={};function updateDevices(){var e,t="",n=0,o=null,i=0,s={};for(a in deviceHeaderCount={},deviceHeaders={},deviceHeadersTitles={},(deviceHeaderTotal=deviceHeaderId=0)==sort?nodes.sort(meshSort):1==sort?nodes.sort(powerSort):2==sort&&(1==showRealNames?nodes.sort(deviceHostSort):nodes.sort(deviceSort)),nodes)0!=nodes[a].v&&(0==sort?(nodes.sort(meshSort),(meshes[nodes[a].meshid]?nodes[a].meshid:"*")!=o&&(deviceHeaderSet(),e="",null!=meshes[nodes[a].meshid]&&1==meshes[nodes[a].meshid].mtype&&(e="<span style=color:lightgray>, Intel&reg; AMT 만</span>"),null!=o&&(2==n&&(t+="<td><div style=width:301px></div></td>"),""!=t)&&(t+="</tr></table>"),t+="<div class=DevSt style=padding-top:4px><span style=float:right>",s[o=meshes[nodes[a].meshid]?(t+='</span><span id=MxMESH style=cursor:pointer onclick=goForward("'+nodes[a].meshid+'")>'+EscapeHtml(meshes[nodes[a].meshid].name)+"</span>"+e+"<span id=DevxHeader"+deviceHeaderId+" style=color:lightgray></span></div>",nodes[a].meshid):(t+="</span><span id=MxMESH><i>개별 장치</i></span><span id=DevxHeader"+deviceHeaderId+" style=color:lightgray></span></div>","*")]=1,n=0)):1==sort?nodes[a].pwr!==o&&(deviceHeaderSet(),null!==o&&(2==n&&(t+="<td><div style=width:301px></div></td>"),""!=t)&&(t+="</tr></table>"),t+="<div class=DevSt style=width:100%;padding-top:4px><span>"+PowerStateStr2(nodes[a].pwr)+"</span><span id=DevxHeader"+deviceHeaderId+" style=color:lightgray></span></div>",o=nodes[a].pwr,n=0):2==sort&&null==o&&(o="1"),i++,t+="<div name=xxdevice onclick=goForward('"+nodes[a]._id+"') class=devList1 id='"+nodes[a]._id+"'></div>",deviceHeaderTotal++,void 0===deviceHeaderCount[nodes[a].state]?deviceHeaderCount[nodes[a].state]=1:deviceHeaderCount[nodes[a].state]++);if(""==t&&0<nodes.length&&""!=Q("SearchInput").value&&(t='<div style="margin:30px">이 검색과 일치하는 기기가 없습니다.</div>'),0==sort&&""==Q("SearchInput").value)for(var a in meshes){var l=meshes[a];null==s[l._id]&&IsMeshViewable(l)&&(""!=o&&""!=t&&(t+="</tr></table>"),t=(t+="<div><div colspan=3 class=DevSt><span style=float:right>")+'</span><span id=MxMESH style=cursor:pointer onclick=goForward("'+l._id+'")>'+EscapeHtml(l.name)+"</span></div>",1==l.mtype&&(t+="<div style=padding:10px><i>이 그룹에 Intel&reg; AMT 장치가 없습니다"),1<l.mtype&&(t+="<div style=padding:10px><i>이 그룹에 기기가 없습니다."),t+=".</i></div></div>",o=l._id,i++)}for(a in 0==i?""!=Q("SearchInput").value||Q("OnlineCheckBox").checked?QH("xdevices",'<div style="margin-top:50px;text-align:center"><span style="font-size:30px">기기가 없습니다</span><br /><br />이 검색과 일치하는 기기가 없습니다. <a onclick=clearSearchInput() style=cursor:pointer>검색 필터 지우기</a></div>'):QH("xdevices",'<div style="margin-top:50px;text-align:center"><span style="font-size:30px">기기가 없습니다</span><br /><br />이 웹 사이트의 데스크탑 버전을 사용하여 장치를 추가하십시오.</div>'):QH("xdevices",t),deviceHeaderSet(),deviceHeaders)QH(a,deviceHeaders[a]);for(a in deviceHeadersTitles)Q(a).title=deviceHeadersTitles[a];onDevicesScrollEx()}var onDevicesTouchActive=!1,onDevicesScrollnagleTimer=null;function onDevicesScroll(){null==onDevicesScrollnagleTimer&&(onDevicesScrollnagleTimer=setTimeout(onDevicesScrollEx,250))}function onDeviceTouch(e){onDevicesTouchActive!=e&&0==(onDevicesTouchActive=e)&&onDevicesScrollEx()}function onDevicesScrollEx(){var e=document.getElementsByName("xxdevice");onDevicesScrollnagleTimer=null;for(var t=0;t<e.length;t++){var n=getNodeFromId(e[t].id);if(null==n)break;updateDeviceViewHtml(e[t],n)}}function updateDeviceViewDevice(e){var t;null!=e&&null!=(t=Q(e._id))&&""!=t.innerHTML&&updateDeviceViewHtml(t,e)}function updateDeviceViewHtml(e,t){var n,o,i,s,a,l=Q("xdevices").scrollTop-250,r=Q("xdevices").scrollTop+Q("xdevices").clientHeight+250;e.offsetTop>=l&&e.offsetTop<r?(EscapeHtml(t.name).length,null!=t.rname&&0<t.rname.length&&EscapeHtml(t.rname),l=EscapeHtml(t.name),0==(l=1==showRealNames&&null!=t.rname?EscapeHtml(t.rname):l).length&&(l="<i>없음</i>"),n=r="",1==stars[t._id]&&(n+="<img class=deviceNotifyDotSub src=images/icon-star-notify-16.png width=16 height=16>"),null!=t.sessions&&(null!=t.sessions.msg&&(n+='<div style="width:16;height:16" class=deviceNotifyDotSub>'+Object.keys(t.sessions.msg).length+"</div>"),null==t.sessions.kvm&&null==t.sessions.terminal&&null==t.sessions.files&&null==t.sessions.tcp&&null==t.sessions.udp||(n+="<img class=deviceNotifyDotSub src=images/icon-relay-notify.png width=16 height=16>"),null!=t.sessions.help&&(n+="<img class=deviceNotifyDotSub src=images/icon-help-notify-16.png width=16 height=16>"),null!=t.sessions.battery)&&(o="","ac"==(s=t.sessions.battery).state?o="장치가 연결되었습니다.":"dc"==s.state&&(o="기기는 배터리로 작동합니다."),i="",a=-1,"number"==typeof s.level&&0<=s.level&&s.level<=100&&(i=s.level+"%",5<(a=Math.floor((s.level+10)/25)+1)&&(lvl=5),"ac"==s.state)&&(100==s.level?a=11:a+=5),0<a)&&(r+='<div class="deviceBatterySmall deviceBatterySmall'+a+'" title="'+(null!=o?o+", "+i:i)+'"></div>'),""!=n&&(r+="<div class=deviceNotifyDot>"+n+"</div>"),s=t.icon,a=NodeStateStr(t),t.conn&&0!=t.conn||3==t.mtype||(s+=" gray"),e.innerHTML="<div>"+r+'<div class="i'+s+' devList2"></div><div class=devList3><div class=devList4><b>'+l+"</b></div><div class=devList5>"+a+"</div></div></div>"):e.innerHTML=""}function showDeviceHelpRequests(e,t,n){if(n&&haltEvent(n),!xxdialogMode||t){var o=null,i="";if(null==(o=null==e?currentNode:getNodeFromId(e))||null==o.sessions)setDialogMode(0);else{if(null!=o.sessions.help)for(var s in o.sessions.help)i+="<div style=margin-bottom:6px><b>"+EscapeHtml(s)+"</b></div><div style=margin-bottom:6px>"+EscapeHtml(o.sessions.help[s])+"</div>";""!=i?setDialogMode(2,"도움 요청 - "+EscapeHtml(o.name),1,null,i,"HELPREQ-"+o._id):setDialogMode(0)}}return!1}function showDeviceSessions(e,t,n){if(!(!0!==t&&xxdialogMode||null==currentNode)){var o,i=currentNode,s="";for(o in i.sessions)if("kvm"==o&&null==i.sessions.multidesk)for(var a in s+="<u>원격 데스크탑</u>",i.sessions.kvm)a.startsWith("user/")?(l="",a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("kvm", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.kvm[a]?"1세션":nobreak(format("{0} 세션",i.sessions.kvm[a])))+l)):"busy"==a&&(s+=addHtmlValue2("기기가 사용 중입니다.",1==i.sessions.kvm[a]?"1세션":nobreak(format("{0} 세션",i.sessions.kvm[a]))));else if("multidesk"==o)for(var a in s+="<u>원격 데스크탑</u>",i.sessions.multidesk){var l="";a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("multidesk", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.multidesk[a]?"1세션":nobreak(format("{0} 세션",i.sessions.multidesk[a])))+l)}else if("terminal"==o)for(var a in s+="<u>터미널</u>",i.sessions.terminal){l="";a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("terminal", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.terminal[a]?"1세션":nobreak(format("{0} 세션",i.sessions.terminal[a])))+l)}else if("files"==o)for(var a in s+="<u>파일</u>",i.sessions.files){l="";a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("files", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.files[a]?"1세션":nobreak(format("{0} 세션",i.sessions.files[a])))+l)}else if("tcp"==o)for(var a in s+="<u>TCP 라우팅</u>",i.sessions.tcp){l="";a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("tcp", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.tcp[a]?"1세션":nobreak(format("{0} 세션",i.sessions.tcp[a])))+l)}else if("udp"==o)for(var a in s+="<u>UDP 라우팅</u>",i.sessions.udp){l="";a!=userinfo._id&&4294967295!=GetNodeRights(i)||(l=' <a href=# onclick=\'return endDeviceSession("udp", "'+encodeURIComponentEx(i._id)+'", "'+encodeURIComponentEx(a)+'")\' title="이 세션 연결 끊기" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),s+=addHtmlValue4(getUserName(a),(1==i.sessions.udp[a]?"1세션":nobreak(format("{0} 세션",i.sessions.udp[a])))+l)}""!=s?setDialogMode(2,"세션 - "+EscapeHtml(i.name),1,null,s,"SESSIONS-"+i._id):setDialogMode(0)}}function endDeviceSession(e,t,n){var n=decodeURIComponent(n).split("/"),o=n[0]+"/"+n[1]+"/"+n[2],i=null;4==n.length&&n[3].startsWith("guest:")&&(i=atob(n[3].substring(6))),"multidesk"==e?meshserver.send({action:"endDesktopMultiplex",nodeid:decodeURIComponent(t),xuserid:o,guestname:i,guestname:i}):meshserver.send({action:"msg",type:"endtunnel",nodeid:decodeURIComponent(t),xuserid:o,guestname:i,guestname:i,protocol:e})}function showDeviceMessages(e,t,n){if(n&&haltEvent(n),!xxdialogMode||t){var o=null,i="<div style=max-height:200px;width:100%;overflow-y:auto;overflow-x:hidden>",s=0;if(null==(o=null==e?currentNode:getNodeFromId(e))||null==o.sessions||null==o.sessions.msg)setDialogMode(0);else{for(var a in o.sessions.msg){var l=a,r=5;"string"==typeof o.sessions.msg[a].msg&&(l=o.sessions.msg[a].msg),i+="<table style=width:100%><td style=width:24px><div class=NotifyIconSmall"+(r=(r="number"==typeof o.sessions.msg[a].icon?o.sessions.msg[a].icon:r)<1||9<r?5:r)+'></div><td><div style="border-radius:5px;background-color:#BBB;width:calc(100% - 18px);padding:8px">'+EscapeHtml(l)+"</div></table>",s++}i+="</div>",0<s&&setDialogMode(2,"에이전트 메시지 - "+EscapeHtml(o.name),1,null,i,"MESSAGES-"+o._id)}}return!1}var powerStatetable=["","전원이 켜짐","절전","절전","절전","최대 절전 모드","전원 끄기","현재","끄다"],powerStateStrings=["","전원이 켜짐","절전 중","절전 중","최대 절전 모드","최대 절전 모드","소프트-오프","현재","끄다"],powerStateStrings2=["","장치의 전원이 공급되었습니다.","장치가 절전 상태입니다 (S1)","장치가 절전 상태입니다 (S2)","장치가 최대 절전 상태입니다 (S3).","장치가 최대 절전 모드입니다 (S4).","장치가 소프트 오프 상태입니다 (S5)","장치가 있지만 전원 상태를 확인할 수 없습니다.","장치의 전원이 꺼져 있습니다."],powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];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>"+(4==e.mtype?"PDU"==e.porttype?"스위치":"IP-KVM":"에이전트")+"</span>"),0!=(2&e.conn)?t.push("<span>CIRA</span>"):0!=(4&e.conn)&&t.push("<span>Intel&reg; AMT</span>"),0!=(8&e.conn)&&t.push("<span>전달(Relay)</span>"),0!=(16&e.conn))&&t.push("<span>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 onSortSelectChange(e){sort=document.getElementById("sortselect").selectedIndex,e||putstore("sort",sort),mainUpdate(4)}function deviceHeaderSet(){if(0==deviceHeaderId)deviceHeaderId=1;else{deviceHeaders["DevxHeader"+deviceHeaderId]=", "+deviceHeaderTotal+(1==deviceHeaderTotal?"기기":"기기들");var e,t="";for(e in deviceHeaderCount)0<t.length&&(t+=", "),t+=deviceHeaderCount[e]+" "+PowerStateStr2(e);deviceHeadersTitles["DevxHeader"+deviceHeaderId]=t,deviceHeaderId++,deviceHeaderCount={},deviceHeaderTotal=0}}var sortCollator=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function meshSort(e,t){var n=sortCollator.compare(e.meshnamel,t.meshnamel);return 0!=n||0!=(n=sortCollator.compare(e.meshid,t.meshid))?n:1==showRealNames?sortCollator.compare(e.rnamel,t.rnamel):sortCollator.compare(e.namel,t.namel)}function powerSort(e,t){var n=e.pwr||0,o=t.pwr||0;return o<n?-1:n<o?1:n==o?1==showRealNames?sortCollator.compare(e.rnamel,t.rnamel):sortCollator.compare(e.namel,t.namel):void 0}function deviceSort(e,t){return sortCollator.compare(e.namel,t.namel)}function deviceHostSort(e,t){return sortCollator.compare(e.rnamel,t.rnamel)}function refreshDevice(e){currentNode&&currentNode._id==e&&gotoDevice(e,xxcurrentView,!0)}var currentNode,currentDevicePanel=0,powerTimelineNode=null,powerTimelineReq=null,powerTimelineUpdate=null,powerTimeline=null;function getCurrentNode(){return currentNode}function gotoDevice(e,t,n){if(!0!==userinfo.emailVerified&&1==serverinfo.emailcheck&&4294967295!=userinfo.siteadmin)setDialogMode(2,"계정 보안",1,null,'이메일 주소가 확인 될 때까지 장치에 액세스 할 수 없습니다. 이것은 비밀번호 복구에 필요합니다. 이메일 주소를 변경하고 확인하려면 "내 계정"으로 이동하십시오.');else if(262144&features&&!(1==userinfo.otpsecret||0<userinfo.otphkeys||0<userinfo.otpkeys||8388608&features&&1==userinfo.otpekey))setDialogMode(2,"계정 보안",1,null,'2단계 인증이 활성화 될 때까지 장치에 액세스 할 수 없습니다. 이것은 추가 보안을 위해 필요합니다. "내 계정" 탭으로 이동하여 "계정 보안" 부분을 보십시오.');else{var o=getNodeFromId(e);if(null==o)goBack();else{var i=meshes[o.meshid],s=GetNodeRights(o),e=null==currentNode||currentNode._id!=e;if(!currentNode||currentNode._id!=o._id||1==n){currentNode=o,QV("p10deviceNotify",null!=currentNode.sessions&&(null!=o.sessions.kvm||null!=o.sessions.terminal||null!=o.sessions.files||null!=o.sessions.tcp||null!=o.sessions.udp)),QV("p10deviceStar",1==stars[currentNode._id]),QV("p10deviceHelp",null!=currentNode.sessions&&null!=currentNode.sessions.help),null!=currentNode.sessions&&null!=currentNode.sessions.msg?(QV("p10deviceMsg",!0),QH("p10deviceMsg",Object.keys(currentNode.sessions.msg).length)):QV("p10deviceMsg",!1),QV("p10deviceBattery",!1),null!=currentNode.sessions&&null!=currentNode.sessions.battery?(n="","ac"==(l=currentNode.sessions.battery).state&&(n="장치가 연결되었습니다."),"dc"==l.state&&(n="기기는 배터리로 작동합니다."),r="",a=-1,"number"==typeof l.level&&0<=l.level&&l.level<=100&&(r=l.level+"%",5<(a=Math.floor((l.level+10)/25)+1)&&(lvl=5),"ac"==l.state)&&(100==l.level?a=11:a+=5),0<a&&(Q("p10deviceBattery").title=null!=n?n+", "+r:r,QV("p10deviceBattery",!0),Q("p10deviceBattery").className="deviceBatteryLarge deviceBatteryLarge"+a)):QV("p10deviceBattery",!1);var a,l=EscapeHtml(o.name),n=(0==l.length&&(l="<i>없음</i>"),0!=(4&s)&&(l="<span onclick=showEditNodeValueDialog(0) style=cursor:pointer>"+l+"</span>"),QH("p10deviceName",l),"<table style=width:100%>"),r=(i&&(n+=addDeviceAttribute("<span>그룹</span>",'<a onclick=goForward("'+o.meshid+'") style=cursor:pointer>'+EscapeHtml(meshes[o.meshid].name)+"</a>")),null!=o.rname&&(n+=addDeviceAttribute("<span>이름</span>","<span>"+EscapeHtml(o.rname)+"</span>")),(0==(1&features)&&4!=o.mtype||3==o.mtype)&&(0!=(4&s)?o.host?n+=addDeviceAttribute("호스트 이름","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>"+EscapeHtml(o.host)+"</span>"):n+=addDeviceAttribute("호스트 이름","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer><i>없음</i></span>"):n+=addDeviceAttribute("호스트 이름",EscapeHtml(o.host))),o.desc?EscapeHtml(o.desc):"<i>없음</i>"),i=(n+=addDeviceAttribute("설명",0!=(4&s)?"<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>"+r+"</span>":r),4==o.mtype&&(null!=o.portnum&&(n+=addDeviceAttribute("포트 번호",o.portnum)),null!=o.porttype)&&(n+=addDeviceAttribute("포트 유형",o.porttype)),null!=o.agent&&null!=o.agent.id&&3==o.mtype?(4==o.agent.id&&(n+=addDeviceAttribute("기기 종류","Windows")),6==o.agent.id&&(n+=addDeviceAttribute("기기 종류","Linux")),29==o.agent.id&&(n+=addDeviceAttribute("기기 종류","맥 OS"))):null!=o.agent&&null!=o.agent.id&&null!=o.agent.ver&&(c="",c=o.agent.id<=agentsStr.length?agentsStr[o.agent.id]:agentsStr[0],0!=o.agent.ver&&(c+=" v"+o.agent.ver),14==o.agent.id&&(c=o.agent.core),!1===o.agent.root&&0!=(1&o.conn)&&(c+=", 한정된"),n+=addDeviceAttribute("메시 에이전트",c)),null!=o.intelamt&&(c="",a={0:nobreak("활성화되지 않음 (Pre)"),1:nobreak("활성화되지 않음 (In)"),2:nobreak("활성화 됨")},null!=o.intelamt.ver&&null==o.intelamt.state?c+="<i>"+nobreak("알 수 없는 상태")+"</i>, v"+EscapeHtml(o.intelamt.ver):null==o.intelamt.ver&&2==o.intelamt.state?c+="<i>활성화 됨</i>":null==o.intelamt.ver||null==o.intelamt.state?c+="<i>알 수 없는 버전 및 상태</i>":(c+=a[o.intelamt.state],o.intelamt.flags&&(2&o.intelamt.flags?c=" <span>CCM</span>":4&o.intelamt.flags&&(c=" <span>ACM</span>")),c+=", v"+EscapeHtml(o.intelamt.ver)),2==o.intelamt.state&&(1==o.intelamt.tls&&(c+=', <span title="Intel&reg; AMT는 TLS 네트워크 보안으로 설치되었습니다.">TLS</span>'),l=!1,null==o.intelamt.user||""==o.intelamt.user?0!=(4&s)?(c+=', <i style=color:#FF0000;cursor:pointer title="Intel&reg; AMT 자격 증명 편집" onclick=editDeviceAmtSettings("'+o._id+'")>자격 증명이 없습니다.</i>',l=!0):c+=", <i style=color:#FF0000>자격 증명이 없습니다.</i>":0!=(1&features2)&&null!=o.intelamt.warn&&(i=null,0!=(1&o.intelamt.warn)&&(i="잘못된 자격 증명"),null!=(i=0!=(8&o.intelamt.warn)?"자격 증명 시도":i))&&(0!=(4&s)?(c+=', <i style=color:#FF0000;cursor:pointer title="Intel&reg; AMT 자격 증명 편집" onclick=editDeviceAmtSettings("'+o._id+'")>'+i+"</i>",l=!0):c+=", <i style=color:#FF0000>"+i+"</i>"),c+=" ",l=0!=(4&s)&&0==(1&features2)||l)&&(c+='<img src=images/link4.png height=10 width=10 title="Intel&reg; AMT 자격 증명 편집" style=cursor:pointer onclick=editDeviceAmtSettings("'+o._id+'")>'),r="Intel&reg; ME","number"==typeof o.intelamt.sku&&(0!=(8&o.intelamt.sku)?r="Intel&reg; AMT":0!=(16&o.intelamt.sku)&&(r="Intel&reg; SM")),n+=addDeviceAttribute(r,c)),null!=o.agent&&null!=o.agent.tag&&"mailto:"!=o.agent.tag&&(n+=addDeviceAttribute("에이전트 태그",a=(a=EscapeHtml(o.agent.tag)).startsWith("mailto:")?'<a href="'+a+'">'+a.substring(7)+"</a>":a)),o.conn),d=(i&&1<i&&(l=[],0!=(1&o.conn)&&l.push("<span>"+(4==o.mtype?"PDU"==o.porttype?"스위치":"IP-KVM":"에이전트")+"</span>"),0!=(2&o.conn)?l.push("<span>Intel&reg; AMT CIRA</span>"):0!=(4&o.conn)&&l.push("<span>Intel&reg; AMT</span>"),0!=(8&o.conn)&&l.push("<span>에이전트 전달(Relay)</span>"),0!=(16&o.conn)&&l.push("<span>MQTT</span>"),n+=addDeviceAttribute("연결성",l.join(", "))),"<i>없음</i>");if(null!=o.tags)for(var u in d="",o.tags)d+='<span style="background-color:lightgray;padding:3px;border-radius:5px">'+EscapeHtml(o.tags[u])+"</span> ";n+=addDeviceAttribute("태그",0!=(4&s)?"<span onclick=showEditNodeValueDialog(3) style=cursor:pointer;color:black>"+d+"</span>":"<span style=line-height:26px;color:black>"+d+"</span>"),null==o.ssh&&null==o.rdp||(r=[],0!=(4&s)?(null!=o.ssh&&r.push("<span onclick=showClearSshDialog(3) style=cursor:pointer>"+(1==o.ssh?"SSH-사용자+패스":2==o.ssh?"SSH-사용자+키+패스":"SSH-사용자+키")+' <img class=hoverButton src="images/link5.png" width=10 height=10 /></span>'),null!=o.rdp&&r.push('<span onclick=showClearRdpDialog(3) style=cursor:pointer>RDP <img class=hoverButton src="images/link5.png" width=10 height=10 /></span>')):(null!=o.ssh&&r.push(1==o.ssh?"SSH-사용자+패스":2==o.ssh?"SSH-사용자+키+패스":"SSH-사용자+키"),null!=o.rdp&&r.push("RDP")),n+=addDeviceAttribute("신임장",r.join(", "))),n+="</table><br />",0!=(262220&s)&&o.mtype<3&&(n+='<input type=button value="동작" onclick=deviceActionFunction() />'),n+='<input type=button value="메모" onclick=showNotes('+(0==(128&s))+',"'+encodeURIComponent(o._id)+'") />',4==o.mtype&&1&i&&("PDU"==o.porttype?1==o.pwr?262144&s&&(n+='<input type=button value="끄다" title="끄다" onclick=setIpPduState(0) />'):8==o.pwr&&64&s&&(n+='<input type=button value="켜다" title="켜다" onclick=setIpPduState(1) />'):8&s&&(n+='<input type=button value="원격 제어" title="원격 제어" onclick=openIpKvmRemoteControl("'+encodeURIComponentEx(o._id)+'") />')),QH("p10html",n),3==o.mtype&&null!=o.agent&&4<o.agent.id&&512&features2&&(o.agent.caps=6),setupTerminal(),setupFiles(),16&s&&setupConsole(),n="<div style=float:right;font-size:x-small;margin-right:10px>",0!=(32768&s)&&(n+='<a style=cursor:pointer onclick=p10showDeleteNodeDialog("'+o._id+'")>장치 삭제</a>'),n+="</div><div style=font-size:x-small>",0!=webRelayPort&&(n=(n+='<a onclick=p10WebRouter("'+o._id+'",1,'+(o.httpport||80)+")>HTTP"+(o.httpport&&80!=o.httpport?"/"+o.httpport:"")+"</a>&nbsp;")+'<a onclick=p10WebRouter("'+o._id+'",2,'+(o.httpsport||443)+")>HTTPS"+(o.httpsport&&443!=o.httpsport?"/"+o.httpsport:"")+"</a>&nbsp;"),n+="</div><br>",QH("p10html3",n);var c=PowerStateStr(o.state);0!=(1&i)&&(0<c.length&&(c+=", "),c+=4==o.mtype?"PDU"==o.porttype?"스위치":"IP-KVM":"메시 에이전트"),0!=(2&i)?(0<c.length&&(c+=", "),c+="Intel&reg; AMT 연결"):0!=(4&i)&&(0<c.length&&(c+=", "),c+="Intel&reg; AMT 감지"),0!=(16&i)&&(0<c.length&&(c+=", "),c+="MQTT 채널 연결"),("PDU"==o.porttype||1<o.pwr&&7!=o.pwr)&&(0<c.length&&(c+=", "),c+=powerStateStrings[o.pwr]),QH("MainComputerState","<span style=font-size:12px>"+c+"</span>"),QH("MainComputerImage",'<div class="i'+o.icon+'"></div>'),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("p10detailshtml","")),e&&(p11clearConsoleMsg(),p13clearConsoleMsg()),QV("p11DeskSessionSelector",!1),QH("p11DeskSessionSelector","")}setupDesktop(),go(t=t||10),10==xxcurrentView&&setupDeviceMenu()}}}function setIpPduState(e){0==e?setDialogMode(2,"전원 작동",3,function(){meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:2})},"전원을 끄시겠습니까?"):setDialogMode(2,"전원 작동",3,function(){meshserver.send({action:"wakedevices",nodeids:[currentNode._id]})},"전원을 켜시겠습니까?")}function openIpKvmRemoteControl(e){xxdialogMode||safeNewWindow("/ipkvm.ashx/"+(e=decodeURIComponent(e).split("/")[2])+"/","ipkvm:"+e)}function deviceToastFunction(){xxdialogMode||setDialogMode(2,"장치 토스트",3,deviceToastFunctionEx,"<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function setupDeviceMenu(e,t){var n=GetNodeRights(currentNode),e=(null!=e&&(currentDevicePanel=e),QV("p10general",0==currentDevicePanel),QV("p10desktop",1==currentDevicePanel),QV("p10files",2==currentDevicePanel),QV("p10details",3==currentDevicePanel),QV("p10console",4==currentDevicePanel),QV("p10terminal",5==currentDevicePanel),[]);0!=currentDevicePanel&&e.push({n:"일반",f:"setupDeviceMenu(0)"}),1!=currentDevicePanel&&null!=currentNode&&(8&n||256&n)&&(4294967295==n||0==(65536&n))&&(null==currentNode.agent&&currentNode.intelamt&&("number"!=typeof currentNode.intelamt.sku||0!=(8&currentNode.intelamt.sku))||currentNode.agent&&1&currentNode.agent.caps)&&e.push({n:"데스크탑",f:"setupDeviceMenu(1)"}),5!=currentDevicePanel&&null!=currentNode&&(8&n||256&n)&&(4294967295==n||0==(512&n))&&(null==currentNode.agent&&currentNode.intelamt&&("number"!=typeof currentNode.intelamt.sku||0!=(8&currentNode.intelamt.sku))||currentNode.agent&&2&currentNode.agent.caps)&&e.push({n:"터미널",f:"setupDeviceMenu(5)"}),2!=currentDevicePanel&&null!=currentNode&&8&n&&(4294967295==n||0==(1024&n))&&1!=currentNode.mtype&&currentNode.agent&&4&currentNode.agent.caps&&e.push({n:"파일",f:"setupDeviceMenu(2)"}),3!=currentDevicePanel&&null!=currentNode&&currentNode.mtype<3&&0!=(1048576&n)&&e.push({n:"세부사항",f:"setupDeviceMenu(3)"}),4!=currentDevicePanel&&null!=currentNode&&16&n&&2==currentNode.mtype&&e.push({n:"콘솔",f:"setupDeviceMenu(4)"}),updateFooterMenu(e),updateCurrentUrl(),1==currentDevicePanel&&deskAdjust()}function deviceActionFunction(){var e,t,n,o,i;xxdialogMode||(e=GetNodeRights(currentNode),t=0,n="이 장치에서 수행할 작업을 선택하십시오.<br /><br />",o="<select id=d2deviceop style=float:right;width:170px onchange=deviceActionFunctionValidate()>",i="",null!=currentNode.agent&&14==currentNode.agent.id?0!=(1&currentNode.conn)&&0!=(8&e)&&(t++,o+="<option value=400>플래시</option><option value=401>떨리다</option>",i+="<div id=d2devicetimediv>"+addHtmlValue("시간","<select id=d2devicetime style=float:right;width:170px><option value=1000>1 초</option><option value=5000>5 초</option><option value=10000>10 초</option></select>")+"</div>"):(0!=(64&e)&&(t++,o+="<option value=100>깨우기(Wake-up)</option>"),0!=currentNode.conn&&0!=(262144&e)&&(t++,o+="<option value=4>절전</option><option value=3>초기화</option><option value=2>전원 끄기</option>"),null!=currentNode.intelamt&&2==currentNode.intelamt.state&&0!=(6&currentNode.conn)&&0!=(262144&e)&&(t++,o+="<option value=310>인텔 &reg; AMT 재설정</option><option value=308>Intel&reg; AMT 전원 끄기</option>"),null!=currentNode.intelamt&&2==currentNode.intelamt.state&&0!=(6&currentNode.conn)&&0!=(64&e)&&(t++,o+="<option value=302>Intel&reg; AMT 전원 켜기</option>")),n+=addHtmlValue("조작",o+="</select>"),setDialogMode(2,"장치 동작",0==t?2:3,deviceActionFunctionEx,(n=0==t?"현재이 기기에 사용할 수있는 작업이 없습니다.":n)+i),0<t&&deviceActionFunctionValidate())}function deviceActionFunctionValidate(){var e=Q("d2deviceop").value;try{QV("d2devicetimediv",400==e||401==e)}catch(e){}}function deviceActionFunctionEx(){var e=Q("d2deviceop").value;100==e?meshserver.send({action:"wakedevices",nodeids:[currentNode._id]}):103!=e&&104!=e&&106!=e&&107!=e&&(302==e?setDialogMode(2,"인텔 &reg; AMT 전원 작동",3,function(){meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e)})},"인텔 &reg; AMT 전원을 켜시겠습니까?"):308==e?setDialogMode(2,"인텔 &reg; AMT 전원 작동",3,function(){meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e)})},"인텔 &reg; AMT 전원 끄기를 수행 하시겠습니까?"):310==e?setDialogMode(2,"인텔 &reg; AMT 전원 작동",3,function(){meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e)})},"인텔 &reg; AMT 재설정을 수행 하시겠습니까?"):400==e||401==e?meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e),time:parseInt(Q("d2devicetime").value)}):meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:parseInt(e)}))}function showNotes(e,t){xxdialogMode||(e="<textarea id=d2devNotes ro="+e+" noteid="+(t=null==t?encodeURIComponentEx("p"+userinfo._id):t)+" readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea>",t.startsWith("node%2F%2F")&&(e+="<span style=font-size:10px>다른 장치 그룹 관리자가 장치 그룹 메모를 보고 변경할 수 있습니다.<span>"),setDialogMode(2,"메모",3,showNotesEx,e,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(t){xxdialogMode||setDialogMode(2,"장치 동작",3,function(){var e="/messenger?id=meshmessenger/"+encodeURIComponentEx(currentNode._id)+"/"+encodeURIComponentEx(userinfo._id)+"&title="+currentNode.name;""!=serverinfo.domainsuffix&&(e="/"+serverinfo.domainsuffix+e),null!=authCookie&&""!=authCookie&&(e+="&auth="+authCookie),t&&1==t.shiftKey?safeNewWindow(e,"meshmessenger:"+currentNode._id):safeNewWindow(e,"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 updateDeviceTimeline(){2==meshserver.State&&null!=powerTimelineNode&&null!=powerTimelineUpdate&&null!=currentNode&&3!=currentNode.mtype&&powerTimelineNode==powerTimelineReq&&currentNode._id==powerTimelineNode&&powerTimelineUpdate<Date.now()&&(powerTimelineUpdate=null,meshserver.send({action:"powertimeline",nodeid:currentNode._id}))}function drawDeviceTimeline(){if(3==currentNode.mtype)QH("p10html2","<br />");else{var e=null,t=Date.now(),n=(currentNode._id==powerTimelineNode&&(e=powerTimeline),new Date),o=(n.setHours(0,0,0,0),(n=new Date(n.getTime()-5184e5)).getTime(),[]);if(null!=e&&1<e.length){o.push([0,e[1],e[0]]);for(var i=e[1],s=2;s<e.length;s+=2){var a=e[s],l=t;e.length>s+1&&(l=e[s+1]),o.push([i,i+l,a]),i+=l}}var r="",d=1,u=new Date,c=Q("masthead").offsetWidth-122;u.setHours(0,0,0,0);for(s=0;s<7;s++){var p,m="",g=u.getTime(),h=g+864e5;for(p in o){var f,v,k=o[p];1==isTimeBlockInside(g,h,k[0],k[1])&&(f=Math.max(g,k[0]),v=Math.min(Math.min(h,k[1]),t),0<(v=Math.round((v-f)*c/864e5)))&&(m+="<div style=display:table-cell;width:"+v+"px;background-color:"+powerColor(k[2])+";height:16px></div>")}r+="<tr style="+(d%2==0?"background-color:#DDD":"")+"><td><div>&nbsp;"+printDate(u)+"<div></div></div></td><td><div>"+m+"</div></td></tr>",++d,u=new Date(u.getTime()-864e5)}QH("p10html2",'<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse;width:calc(100% - 18px);margin:9px" border=0 cellpadding=2 cellspacing=0><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:center;width:90px>일</th><th scope=col style=text-align:center>전원 상태</th></tr>'+r+"</tbody></table>")}}function powerColor(e){return e<powerColorTable.length?powerColorTable[e]:"yellow"}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 style=width:100px;color:gray>"+e+"</td><td style=overflow:hidden>"+t+"</td></tr>"}function editDeviceAmtSettings(e,t){var n,o;xxdialogMode||(n="",o=3,0!=(4&GetNodeRights(e=getNodeFromId(e)))&&(n=(n+=addHtmlValue("사용자 이름",'<input id=dp10username style=width:170px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />'))+addHtmlValue("암호","<input id=dp10password type=password style=width:170px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />"),0==(1&features2)&&(n+=addHtmlValue("보안","<select id=dp10tls style=width:176px><option value=0>TLS 보안이 없습니다.</option><option value=1>TLS 보안 필요</option></select>")),setDialogMode(2,"Intel&reg; AMT 자격 증명 편집",o=null!=e.intelamt.user&&""!=e.intelamt.user?7:o,editDeviceAmtSettingsEx,n,{node:e,func:t}),null!=e.intelamt.user&&""!=e.intelamt.user?Q("dp10username").value=e.intelamt.user:Q("dp10username").value="admin",0==(1&features2)&&(Q("dp10tls").value=e.intelamt.tls),validateDeviceAmtSettings()))}function validateDeviceAmtSettings(){QE("idx_dlgOkButton",passwordcheck(Q("dp10password").value))}function editDeviceAmtSettingsEx(e,t){var n;2==e?meshserver.send({action:"changedevice",nodeid:t.node._id,intelamt:{user:"",pass:""}}):(""==(e=Q("dp10username").value)&&(e="admin"),n=Q("dp10password").value,e={action:"changedevice",nodeid:t.node._id,intelamt:{user:e=""==n?"":e,pass:n}},0==(1&features2)&&(e.intelamt.tls=parseInt(Q("dp10tls").value)),meshserver.send(e),t.func&&setTimeout(t.func,1e3))}function p10showDeleteNodeDialog(e){xxdialogMode||(setDialogMode(2,"기기 삭제",3,p10showDeleteNodeDialogEx,format("{0}을 삭제 하시겠습니까?",EscapeHtml(currentNode.name))+"<br /><br /><label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />확인</label>",e),p10validateDeleteNodeDialog())}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(e,t){meshserver.send({action:"removedevices",nodeids:[t]})}function p10WebRouter(e,t,n,o){var i=null,s=getNodeFromId(e),a=(3==s.mtype&&(a=meshes[s.meshid])&&a.relayid&&(i=a.relayid,o=s.host),serverinfo.name),s=(-1!=a.indexOf(".")&&0==(2&features)||(a=window.location.hostname),"https://"+(a=""!=webRelayDns?webRelayDns:a)+":"+webRelayPort+"/control-redirect.ashx?n="+e+"&p="+n+"&appid="+t+"&c="+authRelayCookie);return null!=o&&(s+="&addr="+o),null!=i&&(s+="&relayid="+i),safeNewWindow(s,"WebRelay"),!1}function p10showiconselector(){xxdialogMode||0!=(4&GetNodeRights(currentNode))&&(setDialogMode(2,"아이콘 선택",0,null,"<table align=center><td style=text-align:center><div style=display:inline-block class=i1 onclick=p10setIcon(1)></div><div style=display:inline-block class=i2 onclick=p10setIcon(2)></div><div style=display:inline-block class=i3 onclick=p10setIcon(3)></div><div style=display:inline-block class=i4 onclick=p10setIcon(4)></div><br /><div style=display:inline-block class=i5 onclick=p10setIcon(5)></div><div style=display:inline-block class=i6 onclick=p10setIcon(6)></div><div style=display:inline-block class=i7 onclick=p10setIcon(7)></div><div style=display:inline-block class=i8 onclick=p10setIcon(8)></div></table>"),QV("id_dialogclose",!0))}function p10setIcon(e){setDialogMode(0),meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:e})}function showClearSshDialog(){setDialogMode(2,"장치 편집",3,showClearSshDialogEx,"SSH 자격 증명을 지우시겠습니까?")}function showClearSshDialogEx(e,t){meshserver.send({action:"changedevice",nodeid:currentNode._id,ssh:0})}function showClearRdpDialog(){setDialogMode(2,"장치 편집",3,showClearRdpDialogEx,"RDP 자격 증명을 지우시겠습니까?")}function showClearRdpDialogEx(e,t){meshserver.send({action:"changedevice",nodeid:currentNode._id,rdp:0})}var desktop,desktopNode,showEditNodeValueDialog_modes=["장치 이름","호스트 이름","설명","태그"],showEditNodeValueDialog_modes2=["name","host","desc","tags"],showEditNodeValueDialog_modes3=["","","","그룹1, 그룹2, 그룹3"];function showEditNodeValueDialog(e){if(!xxdialogMode){var t=addHtmlValue(showEditNodeValueDialog_modes[e],'<input id=dp10devicevalue style=width:170px maxlength=64 placeholder="'+showEditNodeValueDialog_modes3[e]+'" onchange=p10editdevicevalueValidate('+e+",event) onkeyup=p10editdevicevalueValidate("+e+",event) />");if(3==e){var n=[],o="";for(s in nodes)if(nodes[s].tags)for(var i in nodes[s].tags)-1==n.indexOf(nodes[s].tags[i])&&n.push(nodes[s].tags[i]);if(0<n.length){for(var s in n.sort(),n)o+='<span style=padding:4px;background-color:#BBB;border-radius:3px;cursor:pointer onclick=showEditNodeValueDialogAddTag("'+encodeURIComponentEx(n[s])+'")>'+EscapeHtml(n[s])+"</span> ";t+="<div style=margin-top:8px;width:280px;line-height:26px;max-height:160px;overflow-y:auto>"+o+"</div>"}}setDialogMode(2,"장치 편집",3,showEditNodeValueDialogEx,t,e);t=currentNode[showEditNodeValueDialog_modes2[e]];null==t&&(t=""),Array.isArray(t)&&(t=t.join(", ")),Q("dp10devicevalue").value=t,p10editdevicevalueValidate(),Q("dp10devicevalue").focus()}}function showEditNodeValueDialogAddTag(e){var t,n=Q("dp10devicevalue").value.split(","),o=[];for(t in n)o.push(n[t].trim());0<=o.indexOf(e)||(Q("dp10devicevalue").value+=(0==Q("dp10devicevalue").value.length?"":", ")+decodeURIComponent(e),setTimeout(function(){Q("dp10devicevalue").selectionStart=Q("dp10devicevalue").selectionEnd=9e4},0),p10editdevicevalueValidate())}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){e=1<e||0<Q("dp10devicevalue").value.length;QE("idx_dlgOkButton",e),null!=t&&1==e&&13==t.keyCode&&dialogclose(1)}var desktopsettings={encoding:2,showfocus:!1,showmouse:!0,showcad:!0,quality:40,scaling:1024,framerate:50,autolock:!1};function setupDesktop(){desktopNode!=currentNode&&null!=desktop&&(desktop.Stop(),desktop=desktopNode=null),desktopNode==currentNode&&null!=desktop||(desktopNode=currentNode,Q("Desk").addEventListener("DOMMouseScroll",function(e){return dmousewheel(e)}),Q("Desk").addEventListener("mousewheel",function(e){return dmousewheel(e)})),desktopNode=currentNode,updateDesktopButtons(),Q("Desk").toBlob||QV("deskSaveBtn",!1)}function updateDesktopButtons(){meshes[currentNode.meshid];var e=0,t=(null!=desktop&&(e=desktop.State),GetNodeRights(currentNode)),e=(QV("disconnectbutton1",0!=e),QE("deskFullScreen",0!=e),QV("connectbutton1",0==e&&(8&t||256&t)&&null!=currentNode.agent&&1&currentNode.agent.caps),QV("connectbutton1h",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||"number"==typeof currentNode.intelamt.sku&&0!=(16&currentNode.intelamt.sku)||null==currentNode.intelamt.ver&&null!=currentNode.agent||0!=e&&2!=desktop.contype)),QV("d7meshkvm",null!=currentNode.agent&&1&currentNode.agent.caps&&(0==e||1==desktop.contype)),0!=(1&currentNode.conn)),n=(QE("connectbutton1",e),0!=(6&currentNode.conn));QE("connectbutton1h",n),QV("DeskToastButton",0!=(16384&t)&&currentNode.agent&&currentNode.agent.id<5&&8&t),QV("deskActionsBtn",8&t),Q("DeskControl").checked=0!=(8&t),0==e&&QV("DeskTools",!1)}var agentConsoleMessages=["","사용자가 액세스 권한을 부여하기를 기다리는 중 ...","거부","원격 터미널 세션을 시작하지 못했습니다 : {0} ({1})","타임 아웃","잘못된 네트워크 데이터를 받았습니다."];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){setSessionActivity(),QV("p11DeskSessionSelector",!1),p11clearConsoleMsg(),null==desktop?(desktopNode=currentNode,2==t?null==desktopNode.intelamt.user||""==desktopNode.intelamt.user?editDeviceAmtSettings(desktopNode._id,connectDesktop):((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.showmouse=!0,desktop.m.onScreenSizeChange=function(e,t,n){fullscreen&&(QS("deskarea3").width=t*fullscreenzoom+"px",QS("deskarea3").height=n*fullscreenzoom+"px"),deskAdjust()},4==desktopNode.conn&&null!=desktopNode.intelamt&&1==desktopNode.intelamt.tls?desktop.Start(desktopNode._id,16995,"*","*",1):desktop.Start(desktopNode._id,16994,"*","*",0),desktop.contype=2):null==t||1==t||3==t&&4<currentNode.agent.id?((desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).debugmode=debugmode,desktop.m.debugmode=debugmode,desktop.attemptWebRTC=attemptWebRTC,desktop.options={},null!=n&&(desktop.options.tsid=n),null!=o&&(desktop.options.consent=o),1==desktopsettings.autolock&&(desktop.options.autolock=!0),desktop.onStateChanged=onDesktopStateChange,0!=(8192&features2)&&(desktop.m.stopInput=!0),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.m.ImageType=webpSupport?4:1,desktop.m.CompressionLevel=desktopsettings.quality,desktop.m.ScalingLevel=desktopsettings.scaling,desktop.m.FrameRateTimer=desktopsettings.framerate,desktop.m.onDisplayinfo=deskDisplayInfo,desktop.m.onScreenSizeChange=function(e,t,n){fullscreen&&(QS("deskarea3").width=t*fullscreenzoom+"px",QS("deskarea3").height=n*fullscreenzoom+"px"),deskAdjust()},desktop.Start(desktopNode._id),desktop.contype=1):3==t&&meshserver.send({action:"msg",type:"userSessions",nodeid:currentNode._id,tag:o})):(desktop.Stop(),desktopNode=desktop=null)}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)}function p12setConsoleMsg(e,t){e?(Q("p12TermConsoleMsg").innerHTML+=e,QV("p12TermConsoleMsg",!0),null!=p12TermConsoleMsgTimer&&clearTimeout(p12TermConsoleMsgTimer),t&&(p12TermConsoleMsgTimer=setTimeout(p12clearConsoleMsg,t))):p12clearConsoleMsg()}function p13setConsoleMsg(e,t){e?(Q("p13FilesConsoleMsg").innerHTML+=e,QV("p13FilesConsoleMsg",!0),null!=p13FilesConsoleMsgTimer&&clearTimeout(p13FilesConsoleMsgTimer),t&&(p13FilesConsoleMsgTimer=setTimeout(p13clearConsoleMsg,t))):p13clearConsoleMsg()}function onDesktopStateChange(e,t){var n=t,e=(3==n&&2==e.contype&&n++,StatusStrs[n]);null!=desktop&&1==desktop.webRtcActive&&(e+=", WebRTC"),QH("deskstatus",e),0===t&&(desktop.Stop(),desktopNode=desktop=null,QV("DeskScreens",!1),1==fullscreen)&&deskToggleFull(),updateDesktopButtons(),deskAdjust(),setTimeout(deskAdjust,50)}function showDesktopSettings(){xxdialogMode||(applyDesktopSettings(),updateDesktopButtons(),setDialogMode(7,"원격 데스크톱 설정",3,showDesktopSettingsChanged))}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value,desktopsettings.quality=d7bitmapquality.value,desktopsettings.scaling=d7bitmapscaling.value,desktopsettings.framerate=d7framelimiter.value,desktopsettings.autolock=d7deskAutoLock.checked,localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings)),applyDesktopSettings(),desktop&&(1==desktop.contype&&(0!=desktop.State&&desktop.m.SendCompressionLevel(webpSupport?4:1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate),desktop.sendCtrlMsg('{"ctrlChannel":"102938","type":"autolock","value":'+desktopsettings.autolock+"}")),2==desktop.contype)&&0!=desktop.State&&(desktop.Stop(),setTimeout(function(){connectDesktop(null,2)},50))}function applyDesktopSettings(){var e,t="",n=512&features?[100,90,70,50,40,30,20,10,5,1]:[50,40,30,20,10,5,1];for(e in n)t+="<option value="+n[e]+">"+n[e]+"%</option>";QH("d7bitmapquality",t),d7desktopmode.value=desktopsettings.encoding,d7bitmapquality.value=40,0<=n.indexOf(parseInt(desktopsettings.quality))&&(d7bitmapquality.value=desktopsettings.quality),d7bitmapscaling.value=desktopsettings.scaling,desktopsettings.framerate&&(d7framelimiter.value=desktopsettings.framerate),null!=desktopsettings.autolock&&(d7deskAutoLock.checked=desktopsettings.autolock)}var keyboardShown=!1,keyboardShownTimer=null,fullScreenMode=!1;function toggleKeyboard(){xxdialogMode||(null!=keyboardShownTimer&&clearTimeout(keyboardShownTimer),keyboardShown=keyboardShown?(Q("softKeyboard").blur(),!1):(Q("softKeyboard").focus(),!0),QV("deskkeybutton2a",fullscreen&&!keyboardShown),QV("deskkeybutton2b",fullscreen&&keyboardShown))}function keyboardFocusChange(){keyboardShownTimer=setTimeout(function(){keyboardShownTimer=null,keyboardShown=Q("softKeyboard")==document.activeElement,QV("deskkeybutton2a",fullscreen&&!keyboardShown),QV("deskkeybutton2b",fullscreen&&keyboardShown)},10)}function exitButton(){xxdialogMode||(QV("deskButtonMenu",!1),QV("termButtonMenu",!1),deskToggleFull())}function deskMenuButton(e){toggleMenu(!0),deskSendKeys(e)}function updateDeskShortcutKeys(){var e,t='<div class="menuButton" onclick="deskMenuButton(-1)">커스터마이즈</div>';for(e in deskKeyboardShortcuts)t+='<div class="menuButton" onclick="deskMenuButton('+deskKeyboardShortcuts[e]+')">'+keyShortcutTotext(deskKeyboardShortcuts[e])+"</div>";QH("deskButtonMenu",t)}var keyStrings={8:"역행 키이",9:"Tab",13:"입력",27:"탈출",44:"화면 인쇄",45:"끼워 넣다",46:"Del",36:"집",35:"종료",32:"Espace",33:"페이지 위로",34:"페이지 아래로",37:"왼쪽",38:"상위 항목으로",39:"권리",40:"하위",0:"없음"};function keyShortcutTotext(e){var t=[];return 65536&e&&t.push("시프트"),131072&e&&t.push("Alt"),524288&e&&t.push("Ctrl"),1048576&e&&t.push("Win"),112<=(e&=65535)&&e<=123?t.push("F"+(e-111)):0!=e&&keyStrings[e]?t.push(keyStrings[e]):0!=e&&t.push(String.fromCharCode(e)),t.join(" + ")}function deskCustomizeKeys(){if(!xxdialogMode){var e=(e='<div id=d2shortcuts style="width:100%;height:180px;padding:4px;overflow-y:auto;border:1px solid gray"></div><div style=width:100%;padding:5px>')+"<label><input id=d1kshift type=checkbox /> 시프트</label><label> <input id=d1kalt type=checkbox /> Alt</label><label> <input id=d1kctrl type=checkbox /> Ctrl</label> <input id=d1kwin type=checkbox /> Win</label>"+" <select id=d2keySelect>";for(t in keyStrings)e+="<option value="+t+">"+keyStrings[t]+"</option>";for(var t=1;t<=12;t++)e+="<option value="+(t+111)+">F"+t+"</option>";for(t=0;t<10;t++)e+="<option value="+(t+48)+">"+t+"</option>";for(t=0;t<26;t++)e+="<option value="+(t+65)+">"+String.fromCharCode(t+65)+"</option>";e+="</select> <input type=button value=더하다 onclick=addDeskCustomizeKey() /></div>",QH("p10dialog2",e),xxdialogMode=2,QV("p10dialog",!0),deskUpdateShortcutList()}}function deskCustomizeKeysEx(){QV("p10dialog",!1),xxdialogMode=0,putstore("deskKeyShortcuts",deskKeyboardShortcuts.join(",")),updateDeskShortcutKeys()}function deskUpdateShortcutList(){var e,t="";for(e in deskKeyboardShortcuts){var n=keyShortcutTotext(deskKeyboardShortcuts[e]),o="";e!=deskKeyboardShortcuts.length-1&&(o+='<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c2.png" onclick=deskCustomizeKeyDown('+deskKeyboardShortcuts[e]+")>"),0!=e&&(o+='<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c3.png" onclick=deskCustomizeKeyUp('+deskKeyboardShortcuts[e]+")>"),t+='<div style="width:100%;background-color:#AAA;border-radius:4px;margin-bottom:4px;padding:4px;text-align:left;box-sizing:border-box" value='+deskKeyboardShortcuts[e]+">"+n+'<img width=10 height=10 style=float:right;cursor:pointer;padding:2px;margin-left:8px src="images/trash.png" onclick=removeDeskCustomizeKey('+deskKeyboardShortcuts[e]+")>"+o+"</div>"}""==t&&(t="<i>정의 된 단축키가 없습니다.</i>"),QH("d2shortcuts",t)}function deskCustomizeKeyDown(e){var e=deskKeyboardShortcuts.indexOf(e),t=deskKeyboardShortcuts[e+1];deskKeyboardShortcuts[e+1]=deskKeyboardShortcuts[e],deskKeyboardShortcuts[e]=t,deskUpdateShortcutList()}function deskCustomizeKeyUp(e){var e=deskKeyboardShortcuts.indexOf(e),t=deskKeyboardShortcuts[e];deskKeyboardShortcuts[e]=deskKeyboardShortcuts[e-1],deskKeyboardShortcuts[e-1]=t,deskUpdateShortcutList()}function removeDeskCustomizeKey(e){var t,n=[];for(t in deskKeyboardShortcuts)deskKeyboardShortcuts[t]!=e&&n.push(deskKeyboardShortcuts[t]);deskKeyboardShortcuts=n,deskUpdateShortcutList()}function addDeskCustomizeKey(){var e=parseInt(Q("d2keySelect").value);Q("d1kshift").checked&&(e|=65536),Q("d1kalt").checked&&(e|=131072),Q("d1kctrl").checked&&(e|=524288),Q("d1kwin").checked&&(e|=1048576),0<e&&-1==deskKeyboardShortcuts.indexOf(e)&&(deskKeyboardShortcuts.push(e),deskUpdateShortcutList())}function deskSendKeys(e){if(!xxdialogMode&&null!=desktop&&3==desktop.State)if(-1==e)deskCustomizeKeys();else if(655406==e)desktop.m.sendcad();else{var t=(16711680&e)>>16,e=65535&e,n=[],o=[],i={8:65288,9:65289,13:65293,27:65307,45:65379,46:65535,36:65360,35:65367,33:65365,34:65366,37:65361,38:65362,39:65363,40:65364,112:65470,113:65471,114:65472,115:65473,116:65474,117:65475,118:65476,119:65477,120:65478,121:65479,122:65480,123:65481};if(2==desktop.contype){1&t&&(n.push([65505,1]),o.push([65505,0])),2&t&&(n.push([65513,1]),o.push([65513,0])),8&t&&(n.push([65507,1]),o.push([65507,0])),16&t&&(n.push([65511,1]),o.push([65511,0])),65<=(e=i[e]?i[e]:e)&&e<=90&&(e+=32),0!=e&&(n.push([e,1]),o.push([e,0])),o.reverse();for(var s=0;s<o.length;s++)n.push(o[s]);desktop.m.sendkey(n)}else{1&t&&(n.push([desktop.m.KeyAction.DOWN,16]),o.push([desktop.m.KeyAction.UP,16])),2&t&&(n.push([desktop.m.KeyAction.EXDOWN,18]),o.push([desktop.m.KeyAction.EXUP,18])),8&t&&(n.push([desktop.m.KeyAction.EXDOWN,17]),o.push([desktop.m.KeyAction.EXUP,17])),16&t&&(n.push([desktop.m.KeyAction.EXDOWN,91]),o.push([desktop.m.KeyAction.EXUP,91])),0!=e&&(n.push([desktop.m.KeyAction.DOWN,e]),o.push([desktop.m.KeyAction.UP,e])),o.reverse();for(s=0;s<o.length;s++)n.push(o[s]);desktop.m.SendKeyMsgKC(n)}}}function toggleMenu(e){xxdialogMode||(QV("deskButtonMenu",fullscreen&&!e&&1==currentDevicePanel),QV("termButtonMenu",fullscreen&&!e&&5==currentDevicePanel),QV("deskkeybutton3a",fullscreen&&e),QV("deskkeybutton3b",fullscreen&&!e))}function deskChangeMouseButton(e){xxdialogMode||null!=desktop&&(desktop.m.SwapMouse=!desktop.m.SwapMouse,QV("deskkeybutton4a",fullscreen&&!desktop.m.SwapMouse),QV("deskkeybutton4b",fullscreen&&desktop.m.SwapMouse))}function deskChangeFullscreenZoom(){if(!xxdialogMode){if(1==currentDevicePanel){if(null==desktop)return;fullscreenzoom=1==fullscreenzoom?.5:1,QV("deskkeybutton5a",fullscreen&&1==fullscreenzoom),QV("deskkeybutton5b",fullscreen&&1!=fullscreenzoom),QS("deskarea3").width=desktop.m.ScreenWidth*fullscreenzoom+"px",QS("deskarea3").height=desktop.m.ScreenHeight*fullscreenzoom+"px",deskAdjust()}5==currentDevicePanel&&null!=terminal&&xterm.setOption("fontSize",15==xterm.getOption("fontSize")?10:15)}}var terminalNode,filesNode,fullscreen=!1,fullscreenzoom=1;function deskToggleFull(){fullscreen=!fullscreen,QV("mastheadx",!fullscreen),QV("masthead",!fullscreen),QV("topbar",!fullscreen),QV("p11deviceNameHeader",!fullscreen),QV("footer",!fullscreen),QV("column_l_bottomgap",!fullscreen),QV("idx_deskFullBtn2",fullscreen),QV("deskFullBtn",!fullscreen),QV("p10deskTopTable",!fullscreen),QV("deskarea1",!fullscreen),QV("deskarea4",!fullscreen),QV("termarea1",!fullscreen),QV("termarea4",!fullscreen);var e=GetNodeRights(currentNode),e=0==(8192&features2)&&14!=currentNode.agent.id&&(4294967295==e||0!=(8&e)&&0==(256&e)&&0==(4096&e));QV("deskkeybutton1",fullscreen),1==currentDevicePanel&&(QS("deskkeybutton2a").top=QS("deskkeybutton2b").top="210px",QS("deskkeybutton5a").top=QS("deskkeybutton5b").top=e?"160px":"60px",QV("deskkeybutton2a",fullscreen&&e),QV("deskkeybutton2b",!1),QV("deskkeybutton3a",fullscreen&&e),QV("deskkeybutton3b",!1),QV("deskkeybutton4a",fullscreen&&e&&!desktop.m.SwapMouse),QV("deskkeybutton4b",fullscreen&&e&&desktop.m.SwapMouse),QV("deskkeybutton5a",fullscreen&&1==fullscreenzoom),QV("deskkeybutton5b",fullscreen&&1!=fullscreenzoom)),5==currentDevicePanel&&(QS("deskkeybutton2a").top=QS("deskkeybutton2b").top="110px",QV("deskkeybutton2a",fullscreen),QV("deskkeybutton2b",!1),QV("deskkeybutton3a",fullscreen),QV("deskkeybutton3b",!1),QV("deskkeybutton4a",!1),QV("deskkeybutton4b",!1),QV("deskkeybutton5a",!1),QV("deskkeybutton5a",!1)),fullscreen?(QS("DeskParent").height=null,QS("page_content").top="0px",QS("page_content").bottom="0px",1==currentDevicePanel&&(QS("p10desktop").top="0px",QS("p10desktop").overflow="scroll",QS("deskarea3").top="0px",QS("deskarea3").width=desktop.m.ScreenWidth*fullscreenzoom+"px",QS("deskarea3").height=desktop.m.ScreenHeight*fullscreenzoom+"px",QS("deskarea3")["padding-right"]="55px"),5==currentDevicePanel&&(QS("p10terminal").top="0px",QS("p10terminal").overflow="scroll",QS("termarea3").top="0px",QS("termarea3").bottom=null,QS("termarea3").right=null,QS("termarea3")["padding-right"]="55px",QS("termarea3").height="100%"),QS("body")["background-color"]="#000",QS("p10")["background-color"]="#000"):(QS("DeskParent").height="100%",QS("page_content").top="50px",QS("page_content").bottom="32px",1==currentDevicePanel&&(QS("p10desktop").top="55px",QS("p10desktop").overflow="hidden",QS("deskarea3").top="32px",QS("deskarea3").left=null,QS("deskarea3").width="100%",QS("deskarea3").height="calc(100% - 64px)",QS("deskarea3")["padding-right"]="",QS("DeskParent")["margin-top"]=null,QS("DeskParent")["margin-left"]=null),5==currentDevicePanel&&(QS("p10terminal").top="55px",QS("p10terminal").overflow="hidden",Q("p10terminal").scrollTop=0,Q("p10terminal").scrollLeft=0,QS("termarea3").top="32px",QS("termarea3").bottom="32px",QS("termarea3")["padding-right"]=null,QS("termarea3").height="calc(100% - 60px)"),QS("body")["background-color"]=nightMode?"#000":"#FFF",QS("p10")["background-color"]=null),1==currentDevicePanel&&deskAdjust()}function deskAdjust(){var e,t,n,o;1==currentDevicePanel&&(fullscreen?(QS("Desk")["margin-top"]=null,QS("Desk")["margin-bottom"]=null,QS("Desk").width="100%",QS("Desk").height="100%",e=Q("p10desktop").clientHeight,n=Q("p10desktop").clientWidth,t=Q("deskarea3").clientHeight,o=Q("deskarea3").clientWidth-55,QS("deskarea3").top=t<e?(e-t)/2+"px":null,QS("deskarea3").left=o<n?(n-o)/2+"px":null):(e=Q("DeskParent").clientHeight,n=Q("DeskParent").clientWidth,(t=Q("Desk").height)/(o=Q("Desk").width)<e/n?(n=t*n/o+"px",QS("Desk").height=n,QS("Desk").width="100%"):(n=o*e/t+"px",QS("Desk").width=n,QS("Desk").height="100%"),QS("DeskParent").overflow="hidden",o=(Q("DeskParent").clientHeight-Q("Desk").clientHeight)/2,QS("Desk")["margin-top"]=o+"px",QS("Desk")["margin-bottom"]=o+"px"))}function sendSpecialKeys(){xxdialogMode||null==desktop||3!=desktop.State||setDialogMode(3,"특수 키",3,deskSendKeys)}function deskSaveImage(){var e,t;setSessionActivity(),xxdialogMode||null==desktop||3!=desktop.State||(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 deskSelectScreens(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){var e,t="",n=desktop.m.displays;for(e in n)t+="<option value="+e+" "+(desktop.m.selectedDisplay==e?" selected":"")+">"+n[e]+"</option>";setDialogMode(2,"화면 선택",3,deskSelectScreensEx,t=addHtmlValue4("화면","<select style=width:100% id=deskdisplays>"+t+"</select>"))}}function deskSelectScreensEx(){null!=desktop&&3==desktop.State&&desktop.m.SetDisplay(parseInt(Q("deskdisplays").value))}function deskDisplayInfo(e,t,n,o){var i,s=0;for(i in t)s++;QV("DeskScreens",1<s)}function dmousedown(e){setSessionActivity(),xxdialogMode||null==desktop||(fullscreen&&(e.addx=Q("p10desktop").scrollLeft*(1/fullscreenzoom),e.addy=Q("p10desktop").scrollTop*(1/fullscreenzoom)),desktop.m.mousedown(e))}function dmouseup(e){setSessionActivity(),xxdialogMode||null==desktop||(fullscreen&&(e.addx=Q("p10desktop").scrollLeft*(1/fullscreenzoom),e.addy=Q("p10desktop").scrollTop*(1/fullscreenzoom)),desktop.m.mouseup(e))}function dmousemove(e){setSessionActivity(),xxdialogMode||null==desktop||(fullscreen&&(e.addx=Q("p10desktop").scrollLeft*(1/fullscreenzoom),e.addy=Q("p10desktop").scrollTop*(1/fullscreenzoom)),desktop.m.mousemove(e))}function dmousewheel(e){return setSessionActivity(),!(xxdialogMode||null==desktop||!desktop.m.mousewheel||(fullscreen&&(e.addx=Q("p10desktop").scrollLeft*(1/fullscreenzoom),e.addy=Q("p10desktop").scrollTop*(1/fullscreenzoom)),desktop.m.mousewheel(e),haltEvent(e),0))}function drotate(e){xxdialogMode||null==desktop||(desktop.m.setRotation(desktop.m.rotation+e),deskAdjust())}function setupTerminal(){terminalNode!=currentNode&&null!=terminal&&(terminal.Stop(),terminal=null),terminalNode=currentNode,updateTerminalButtons()}function updateTerminalButtons(){currentNode.agent;var e=null!=terminal&&0!=terminal.state,t=(QE("termFullScreen",0!=e),3==terminalNode.mtype&&null!=terminalNode.agent&&4<terminalNode.agent.id&&512&features2&&(terminalNode.agent.caps=6),QV("disconnectbutton2span",1==e),QV("connectbutton2span",0==e&&null!=terminalNode.agent&&2&terminalNode.agent.caps&&3!=terminalNode.mtype),QV("connectbutton2sspan",0==e&&null!=terminalNode.agent&&2&terminalNode.agent.caps&&3!=terminalNode.agent.id&&4!=terminalNode.agent.id),0!=(1&terminalNode.conn)||3==terminalNode.mtype);QE("connectbutton2",t),QE("connectbutton2s",t),QV("termActionsBtn",3!=terminalNode.mtype),1==e&&3!=terminal.contype||null==terminalNode.agent||3==terminalNode.agent.id||4==terminalNode.agent.id?QH("terminalCustomUpperRight",""):QH("terminalCustomUpperRight","<a style=cursor:pointer onclick=cmsshportaction(1,event)>"+format("SSH 포트 {0}",terminalNode.sshport||22)+"</a>")}function cmsshportaction(e){xxdialogMode||(setDialogMode(2,"SSH 연결",3,function(){var e=0<Q("d10sshport").value.length?parseInt(Q("d10sshport").value):22;meshserver.send({action:"changedevice",nodeid:currentNode._id,sshport:e})},'SSH 원격 연결 포트 :<br /><br /><input type=text placeholder="22" inputmode="numeric" pattern="[0-9]*" onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" maxlength=5 id=d10sshport type=text>',currentNode),Q("d10sshport").focus(),null!=currentNode.sshport&&(Q("d10sshport").value=currentNode.sshport))}function onTerminalStateChange(e,t){var n=t,e=(3==n&&2==e.contype&&n++,StatusStrs[n]);switch(1==terminal.webRtcActive&&(e+=", WebRTC"),QH("termstatus",e),t){case 0:xterm.dispose(),(xterm=null)!=terminal&&(terminal.Stop(),terminal=null);break;case 3:xterm.focus()}updateTerminalButtons()}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){null!=xterm&&(xterm.writeUtf8?"string"==typeof e?xterm.writeUtf8(e):xterm.writeUtf8(new Uint8Array(e)):"string"==typeof e?xterm.write(e):xterm.write(new Uint8Array(e)))}function sshTunnelAuthDialog(e,t){var n="";e.askkeypass?n+=addHtmlValue("입증","<select id=dp2authmethod style=width:150px onchange=sshAuthUpdate(event)><option value=3 selected>저장된 키</option><option value=1>사용자 이름 및 비밀번호</option><option value=2>사용자 이름 및 키</option></select>"):n+=addHtmlValue("입증","<select id=dp2authmethod style=width:150px onchange=sshAuthUpdate(event)><option value=1 selected>사용자 이름 및 비밀번호</option><option value=2>사용자 이름 및 키</option></select>"),n=(n=(n+="<div id=d2userauth style=display:none>")+addHtmlValue("사용자 이름","<input id=dp2user style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />")+"</div><div id=d2passauth style=display:none>")+addHtmlValue("암호","<input type=password id=dp2pass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),0==(4194304&features2)&&(n+="<label><input id=dp2keep type=checkbox>자격 증명 기억</label>"),n=(n=(n+="</div><div id=d2keyauth style=display:none>")+addHtmlValue("키 파일","<input type=file id=dp2key style=width:150px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) /><div id=d2badkey style=font-size:x-small>키 파일은 OpenSSH 형식이어야 합니다.</div>"))+addHtmlValue("키 비밀번호","<input type=password id=dp2keypass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),0==(4194304&features2)&&(n+="<label><input id=dp2keep1 type=checkbox onchange=sshAuthUpdate(event)>사용자 및 키 기억</label><br/><label><input id=dp2keep2 type=checkbox>비밀번호 기억</label>"),n+="</div>",setDialogMode(2,"입증",11,t,n=e.askkeypass?(n+="<div id=d2keyauth2 style=display:none>")+addHtmlValue("암호","<input type=password id=dp2keypass2 style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />")+"</div>":n,"ssh"),Q("dp2user").focus(),sshAuthUpdate(),setTimeout(sshAuthUpdate,50)}function sshTunnelUpdate(e){if("string"==typeof e)if("{"==e[0]){var t=JSON.parse(e);switch(t.action){case"sshauth":sshTunnelAuthDialog(t,sshConnectEx);break;case"sshautoauth":terminal.socket.send(JSON.stringify({action:"sshautoauth",cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight}));break;case"autherror":p12setConsoleMsg("인증 오류",5e3);break;case"sessionerror":p12setConsoleMsg("세션이 만료되었습니다.",5e3);break;case"sessiontimeout":p12setConsoleMsg("세션 타임 아웃",5e3)}}else"~"==e[0]&&xterm.writeUtf8(e.substring(1))}function sshAuthUpdate(e){var t;QV("d2userauth",3!=Q("dp2authmethod").value),QV("d2passauth",1==Q("dp2authmethod").value),QV("d2keyauth",2==Q("dp2authmethod").value),QV("d2keyauth2",3==Q("dp2authmethod").value),1==Q("dp2authmethod").value?QE("idx_dlgOkButton",0<Q("dp2user").value.length&&0<Q("dp2pass").value.length):3==Q("dp2authmethod").value?QE("idx_dlgOkButton",0<Q("dp2keypass2").value.length):(QE("idx_dlgOkButton",!1),0==(4194304&features2)&&QE("dp2keep2",Q("dp2keep1").checked),1==(0<Q("dp2user").value.length&&null!=Q("dp2key").files&&1==Q("dp2key").files.length&&Q("dp2key").files[0].size<8e3)&&((t=new FileReader).onload=function(e){e=0<=e.target.result.indexOf("-----BEGIN OPENSSH PRIVATE KEY-----")&&0<=e.target.result.indexOf("-----END OPENSSH PRIVATE KEY-----")||0<=e.target.result.indexOf("-----BEGIN RSA PRIVATE KEY-----")&&0<=e.target.result.indexOf("-----END RSA PRIVATE KEY-----");QE("idx_dlgOkButton",e),QS("d2badkey").color=e?"#000":"#F00"},t.readAsText(Q("dp2key").files[0]))),e&&13==e.keyCode&&e.target&&1==Q("dp2authmethod").value&&("dp2user"==e.target.id&&Q("dp2pass").focus(),"dp2pass"==e.target.id)&&dialogclose(1)}function sshConnectEx(e){var t,n,o;0==e?null!=terminal&&connectTerminal():(t=0,1==Q("dp2authmethod").value?(0==(4194304&features2)&&(t=Q("dp2keep").checked?1:0),terminal.socket.send(JSON.stringify({action:"sshauth",username:Q("dp2user").value,password:Q("dp2pass").value,keep:t,cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight}))):3==Q("dp2authmethod").value?terminal.socket.send(JSON.stringify({action:"sshkeyauth",keypass:Q("dp2keypass2").value,cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight})):(0==(4194304&features2)&&1==(t=Q("dp2keep1").checked?1:0)&&(t+=Q("dp2keep2").checked?1:0),e=new FileReader,n=Q("dp2user").value,o=Q("dp2keypass").value,e.onload=function(e){terminal.socket.send(JSON.stringify({action:"sshauth",username:n,keypass:o,key:e.target.result,keep:t,cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight}))},e.readAsText(Q("dp2key").files[0])))}function xTermSendResize(){(xtermResizeTimer=null)!=xterm&&null!=terminal&&null!=terminal.sendCtrlMsg&&("sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send(JSON.stringify({action:"resize",cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight})):terminal.sendCtrlMsg(JSON.stringify({ctrlChannel:"102938",type:"termsize",cols:xterm.cols,rows:xterm.rows})))}function connectTerminal(e,t,n){var o;p12clearConsoleMsg(),terminal?(terminal.Stop(),terminal=null,fullscreen&&deskToggleFull()):(o={protocol:null!=n&&"number"==typeof n.protocol?n.protocol:1},n&&n.requireLogin&&(o.requireLogin=!0),QV("termarea3xdiv",!0),null!=xterm&&xterm.dispose(),xterm=new Terminal,(xtermfit=new FitAddon.FitAddon)&&xterm.loadAddon(xtermfit),xterm.open(Q("termarea3xdiv")),xterm.onData(function(e){"sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+e):terminal.sendText(e)}),xtermfit&&xtermfit.fit(),xterm.onResize(function(e){xtermResizeTimer&&clearTimeout(xtermResizeTimer),xtermResizeTimer=setTimeout(xTermSendResize,200)}),document.getElementsByClassName("xterm-helper-textarea")[0].onfocus=()=>{xterm.blur(),fullscreen||toggleKeyboard()},document.getElementsByClassName("xterm-viewport")[0].style.overflow="hidden",terminal=CreateAgentRedirect(meshserver,CreateRemoteTunnel(3==t?sshTunnelUpdate:tunnelUpdate,o),serverPublicNamePort,authCookie,authRelayCookie,domainUrl),3==t&&(terminal.urlname="sshterminalrelay.ashx"),terminal.debugmode=debugmode,terminal.m.debugmode=debugmode,terminal.options=o,terminal.options={cols:xterm.cols,rows:xterm.rows},o.requireLogin&&(terminal.options.requireLogin=!0),terminal.Start(terminalNode._id),terminal.onStateChanged=onTerminalStateChange,terminal.contype=t,terminal.attemptWebRTC=!1,terminal.onConsoleMessageChange=function(){p12setConsoleMsg(terminal.consoleMessage?formatAgentConsoleMessage(terminal.consoleMessage,terminal.consoleMessageId,terminal.consoleMessageArgs):null,terminal.consoleMessageTimeout)}),Q("connectbutton2").blur()}function updateTermShortcutKeys(){for(var e="",t=64;t<=95;t++)e+='<div class="menuButton" style="width:70px" onclick="termMenuButton('+t+')">Ctrl +'+String.fromCharCode(t)+"</div>";QH("termButtonMenu",e)}function termMenuButton(e){toggleMenu(!0),"sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+String.fromCharCode(e-64)):terminal.sendText(String.fromCharCode(e-64))}function setupFiles(){var e=filesNode==currentNode,t=0!=(1&(filesNode=currentNode).conn)||3==filesNode.mtype;QE("p13Connect",t),QE("p13Connects",t),QV("p13Connect",null==files&&2==filesNode.mtype),QV("p13Connects",null==files&&null!=filesNode.agent&&3!=filesNode.agent.id&&4!=filesNode.agent.id),QV("p13Disconnect",null!=files),0!=e&&0!=t||!files||(files.Stop(),files=null),p13setActions()}function onFilesStateChange(e,t){setSessionActivity(),QV("p13Connect",0==t&&2==filesNode.mtype),QV("p13Connects",0==t&&null!=filesNode.agent&&3!=filesNode.agent.id&&4!=filesNode.agent.id),QV("p13Disconnect",0!=t);var n=StatusStrs[t];switch(3==t&&(2==files.contype&&(n+=", SFTP"),1==files.webRtcActive)&&(n+=", WebRTC"),Q("p13Status").textContent=n,t){case 0:QH("p13files",""),p13filetree=null,p13filetreelocation=[],QH("p13currentpath",""),QE("p13FolderUp",!1),p13setActions(),null!=files&&(files.Stop(),files=null),null!=uploadFile&&(p13uploadFileTransferDone(),uploadFile=null);break;case 3:if(p13filetreelocation=[],p13targetpath="",files){var o=[];try{o=JSON.parse(getstore("_devFilePaths","[]"))}catch(e){}for(var i=0;i<o.length;i++)o[i].n==currentNode._id&&(p13targetpath=o[i].p);p13filetreelocation=p13targetpath.split("/"),files.sendText({action:"ls",reqid:1,path:p13targetpath})}}}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,t){p13clearConsoleMsg(),files?(files.Stop(),files=null):(files=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie,authRelayCookie,domainUrl),2==t&&(files.urlname="sshfilesrelay.ashx"),files.contype=t,files.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(t){if(0<t.length&&123!=t.charCodeAt(0))p13gotDownloadBinaryData(t);else{try{t=JSON.parse(decode_utf8(t))}catch(e){t=JSON.parse(t)}if("download"==t.action)p13gotDownloadCommand(t);else{switch(t.action){case"sshauth":sshTunnelAuthDialog(t,p13sshConnectEx);break;case"autherror":return void p13setConsoleMsg("인증 오류",5e3);case"connectionerror":return void p13setConsoleMsg("연결 오류",5e3);case"sessionerror":return void p13setConsoleMsg("세션이 만료되었습니다.",5e3);case"sessiontimeout":return void p13setConsoleMsg("세션 타임 아웃",5e3)}if(null!=t.action&&t.action.startsWith("upload"))p13gotUploadData(t);else if(null!=t.path)if(null==t.dir)""!=p13targetpath&&p13folderup();else if(t.path=t.path.replace(/\//g,"\\"),null!=p13filetree&&t.path==p13filetree.path){var e=p13getCheckedNames();p13filetree=t,p13updateFiles(e)}else{for(var n=t.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||"\\"==t.path&&""==p13targetpath)&&(p13filetree=t,p13updateFiles())}}}}function p13sshConnectEx(e){var t,n,o;0==e?null!=files&&connectFiles():(t=0,1==Q("dp2authmethod").value?(0==(4194304&features2)&&(t=Q("dp2keep").checked?1:0),files.socket.send(JSON.stringify({action:"sshauth",username:Q("dp2user").value,password:Q("dp2pass").value,keep:t}))):3==Q("dp2authmethod").value?files.socket.send(JSON.stringify({action:"sshkeyauth",keypass:Q("dp2keypass2").value})):(0==(4194304&features2)&&1==(t=Q("dp2keep1").checked?1:0)&&(t+=Q("dp2keep2").checked?1:0),e=new FileReader,n=Q("dp2user").value,o=Q("dp2keypass").value,e.onload=function(e){files.socket.send(JSON.stringify({action:"sshauth",username:n,keypass:o,key:e.target.result,keep:t}))},e.readAsText(Q("dp2key").files[0])))}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 style=cursor:pointer;color:black onclick=p13folderup(0)>최상위폴더</a>",i=p13filetree.path.split("\\");for(g in p13filetreelocation=[],i)""!=i[g]&&p13filetreelocation.push(i[g]);for(g in p13filetreelocation)o+=" / <a style=cursor:pointer;color:black onclick=p13folderup("+(parseInt(g)+1)+")>"+EscapeHtml(p13filetreelocation[g])+"</a>";var s=p13filetreelocation.join("/"),a=p13sort_files(p13filetree.dir);for(g in a){var l,r=a[g],d=r.n,u=40<d.length?EscapeHtml(d.substring(0,70))+"...":EscapeHtml(d),c="",p=(null!=r.s&&(c=getFileSizeStr(r.s)),"");p=r.t<3?"<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+r.nx+"'>&nbsp;<span style=float:right></span><span><div class=fileIcon"+r.t+'></div><a style=cursor:pointer onclick=p13folderset("'+encodeURIComponent(r.nx)+'")>'+u+"</a></span></div>":(l=u,0<r.s&&(l='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p13downloadfile(\''+encodeURIComponent(s+"/"+d)+"','"+encodeURIComponent(d)+"',"+r.s+')">'+u+"</a>"),"<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+r.nx+"'>&nbsp;<span style=float:right;padding-right:4px>"+c+"</span><span><div class=fileIcon"+r.t+"></div>"+l+"</span></div>"),r.t<3?t+=p:n+=p}if(QH("p13files",t+n),QH("p13currentpath",o),QE("p13FolderUp",0!=p13filetreelocation.length),null!=e)for(var m=document.getElementsByName("fd"),g=0;g<m.length;g++)0<=e.indexOf(p13filetree.dir[m[g].value].n)&&(m[g].checked=!0);p13setActions()}function p13folderset(e){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[e].n).split("\\").join("/"),files&&(p13storeCurrentPath(p13targetpath),files.sendText({action:"ls",reqid:1,path:p13targetpath}))}function p13folderup(e){if(null==e)p13filetreelocation.pop();else for(;p13filetreelocation.length>e;)p13filetreelocation.pop();p13targetpath=p13filetreelocation.join("/"),files&&(p13storeCurrentPath(p13targetpath),files.sendText({action:"ls",reqid:1,path:p13targetpath}))}function p13storeCurrentPath(e){var t=[],n=-1;try{t=JSON.parse(getstore("_devFilePaths","[]"))}catch(e){}for(var o=0;o<t.length;o++)t[o].n==currentNode._id&&(n=o);for(0<=n&&t.splice(n,1),t.push({n:currentNode._id,p:e});40<t.length;)t.shift();putstore("_devFilePaths",JSON.stringify(t))}function p13sort_filename(e,t){return e.ln>t.ln?+p13sortorder:e.ln<t.ln?-1*p13sortorder:0}function p13sort_timestamp(e,t){return e.d>t.d?+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=[],o=Q("p13sortdropdown").value;for(t in e)e[t].nx=t,null==e[t].s&&(e[t].s=0),null==e[t].n&&(e[t].n=t),e[t].ln=e[t].n.toLowerCase(),n.push(e[t]);return p13sortorder=1,3<o&&(p13sortorder=-1,o-=3),1==o?n.sort(p13sort_filename):2==o?n.sort(p13sort_bysize):3==o&&n.sort(p13sort_timestamp),n}function p13setActions(){var e,t,n,o,i=currentNode.agent&&14!=currentNode.agent.id;null==p13filetree?(QE("p13DeleteFileButton",!1),QE("p13NewFolderButton",!1),QE("p13UploadButton",!1),QE("p13RenameFileButton",!1),QE("p13SelectAllButton",!1),Q("p13SelectAllButton").value="모두",QE("p13RefreshButton",!1),QE("p13CutButton",!1),QE("p13CopyButton",!1),QE("p13PasteButton",!1)):(e=p13getFileSelCount(),t=p13getFileCount(),n=p13getFileSelCount(!1),o=0<currentNode.agent.id&&currentNode.agent.id<5||14==currentNode.agent.id||34==currentNode.agent.id,QE("p13DeleteFileButton",i&&0<e&&(0<p13filetreelocation.length||0==o)),QE("p13NewFolderButton",i&&(0<p13filetreelocation.length||0==o)),QE("p13UploadButton",i&&(0<p13filetreelocation.length||0==o)),QE("p13RenameFileButton",i&&1==e&&(0<p13filetreelocation.length||0==o)),QE("p13SelectAllButton",0<t),Q("p13SelectAllButton").value=0<e?"없음":"모두",QE("p13RefreshButton",!0),QE("p13CutButton",i&&0<e&&e==n&&3!=currentNode.mtype&&(0<p13filetreelocation.length||0==o)),QE("p13CopyButton",i&&0<e&&e==n&&3!=currentNode.mtype&&(0<p13filetreelocation.length||0==o)),QE("p13PasteButton",i&&3!=currentNode.mtype&&(0<p13filetreelocation.length||0==o)&&null!=p13clipboard&&0<p13clipboard.length)),1==(null!=files&&0!=files.state)&&2!=files.contype||null==filesNode.agent||3==filesNode.agent.id||4==filesNode.agent.id?QH("filesCustomUpperRight",""):QH("filesCustomUpperRight","<a style=cursor:pointer onclick=cmsshportaction(1,event)>"+format("SSH 포트 {0}",filesNode.sshport||22)+"</a>"),QV("filesActionsBtn",3!=filesNode.mtype)}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 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(encodeURIComponent(p13filetreelocation.join("/")+"/"+p13filetree.dir[e[t].value].n),encodeURIComponent(p13filetree.dir[e[t].value].n),p13filetree.dir[e[t].value].s,"viewer"):messagebox("파일 편집기","200k 미만의 파일만 편집 할 수 있습니다.");break}}var downloadFile,uploadFile,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="";setDialogMode(2,"붙여넣기",3,p13pasteFileEx,e=null!=p13clipboard&&0<p13clipboard.length?0==p13clipboardCut?1<p13clipboard.length?format("이 위치에 대한 {0} 항목의 사본을 확인 하시겠습니까?",p13clipboard.length):format("1개의 항목을 이 위치로 복사하시겠습니까?"):1<p13clipboard.length?format("{0} 항목을이 위치로 이동 하시겠습니까?",p13clipboard.length):format("이 위치로 1개 항목을 이동하시겠습니까?"):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 updateUploadDialogOk(e){QE("idx_dlgOkButton",""!=Q(e).value)}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 getFileCount(){return document.getElementsByName("fc").length}function p13downloadfile(e,t,n){xxdialogMode||downloadFile||!files||(downloadFile={path:decodeURIComponent(e),file:decodeURIComponent(t),size:n,tsize:0,data:"",state:0,id:Math.random()},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))?(saveAs(data2blob(downloadFile.data),downloadFile.file),downloadFile=null,setDialogMode(0)):files.sendText({action:"download",sub:"ack",id:downloadFile.id}))}function p13doUploadFiles(e){if(!xxdialogMode){var t=0<currentNode.agent.id&&currentNode.agent.id<5||14==currentNode.agent.id||34==currentNode.agent.id,n=[],o=0;for(i in p13filetree.dir)n.push(t?p13filetree.dir[i].n.toLowerCase():p13filetree.dir[i].n);for(var 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 />"),p13uploadNextFile()}const byteToHex=[];for(var n=0;n<=255;++n){var hexOctet=n.toString(16).padStart(2,"0");byteToHex.push(hexOctet)}function arrayBufferToHex(e){return Array.prototype.map.call(new Uint8Array(e),e=>byteToHex[e]).join("")}function performHash(e,t){window.crypto.subtle.digest("SHA-384",e).then(function(e){t(arrayBufferToHex(e))},function(){t(null)})}function performHashOnFile(e,t){var n=new FileReader;n.onerror=function(e){t(null)},n.onload=function(){window.crypto.subtle.digest("SHA-384",n.result).then(function(e){t(arrayBufferToHex(e))},function(){t(null)})},n.readAsArrayBuffer(e)}function p13uploadNextFile(){if(uploadFile.xfilePtr++,uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var t=uploadFile.xfiles[uploadFile.xfilePtr];if(QH("p13dfileName",t.name),Q("d2progressBar").max=t.size,Q("d2progressBar").value=0,null==t.xdata){uploadFile.xfile=t;var e,n=null;for(e in p13filetree.dir)p13filetree.dir[e].n==t.name&&(n=p13filetree.dir[e]);null!=n&&n.s<=uploadFile.xfile.size?performHashOnFile(uploadFile.xfile,function(e){files.sendText(JSON.stringify({action:"uploadhash",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:t.name,tag:{h:e.toUpperCase(),s:n.s,skip:n.s==uploadFile.xfile.size}}))}):files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:t.name,size:uploadFile.xfile.size}))}else uploadFile.xdata=t.xdata,files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:t.name,size:uploadFile.xdata.byteLength}))}else p13uploadFileTransferDone()}function p13uploadFileCancel(e,t){null!=uploadFile&&(files.sendText(JSON.stringify({action:"uploadcancel",reqid:uploadFile.xfilePtr})),uploadFile=null),p13uploadFileTransferDone()}function p13uploadFileTransferDone(){uploadFile=null,setDialogMode(0),p13folderup(9999)}function p13gotUploadData(e){if(null!=uploadFile&&parseInt(uploadFile.xfilePtr)==parseInt(e.reqid))switch(e.action){case"uploadstart":p13uploadNextPart(!(uploadFile.xdataPriming=8));break;case"uploadack":p13uploadNextPart(!1);break;case"uploaddone":(uploadFile.xfiles.length>uploadFile.xfilePtr+1?p13uploadNextFile:p13uploadFileTransferDone)();break;case"uploaderror":p13uploadFileCancel();break;case"uploadhash":var t=uploadFile.xfiles[uploadFile.xfilePtr];t&&(e.tag.h===e.hash?e.tag.skip?p13uploadNextFile():(uploadFile.xptr=e.tag.s,files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:t.name,size:uploadFile.xfile.size,append:!0}))):files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:t.name,size:uploadFile.xfile.size,append:!1})))}}function p13uploadNextPart(e){if(uploadFile.xdata){var t=uploadFile.xdata,n=uploadFile.xptr;if(n>=t.byteLength)files.sendText(JSON.stringify({action:"uploaddone",reqid:uploadFile.xfilePtr}));else{if((o=uploadFile.xptr+16384)>t.byteLength){if(1==e)return;o=t.byteLength}t=new Uint8Array(t.slice(n,o));123==t[0]||0==t[0]?((n=new Uint8Array(o-n+1)).set(t,1),files.send(n)):files.send(t),uploadFile.xptr=o,Q("d2progressBar").value=o}}else if(uploadFile.xfile&&null==uploadFile.xreader&&!(uploadFile.xptr>=uploadFile.xfile.size)){var o;if((o=uploadFile.xptr+16384)>uploadFile.xfile.size){if(1==e)return;o=uploadFile.xfile.size}uploadFile.xreader=new FileReader,uploadFile.xreader.onerror=function(e){console.log(e)},uploadFile.xreader.onload=function(){var e,t=uploadFile.xreader.result;delete uploadFile.xreader,null!=t&&(123==(e=new Uint8Array(t))[0]||0==e[0]?((t=new Uint8Array(t.byteLength+1)).set(e,1),files.send(t)):files.send(e),uploadFile.xptr=o,Q("d2progressBar").value=o,uploadFile.xptr>=uploadFile.xfile.size?files.sendText(JSON.stringify({action:"uploaddone",reqid:uploadFile.xfilePtr})):0<uploadFile.xdataPriming&&(uploadFile.xdataPriming--,p13uploadNextPart(!0)))},uploadFile.xreader.readAsArrayBuffer(uploadFile.xfile.slice(uploadFile.xptr,o))}}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==(n=DeviceDetailsNetwork=null!=n?n:DeviceDetailsNetwork)&&(n={});var o=[],i={};if((t=null==(t=DeviceDetailsHardware=null!=t?t:DeviceDetailsHardware)?{}:t).windows&&t.windows.osinfo||e.osdesc){var s="";if(e.rname&&(s+=addDetailItem("이름",EscapeHtml(e.rname),i)),e.osdesc&&(s+=addDetailItem("버전",EscapeHtml(e.osdesc),i)),t.windows&&t.windows.osinfo&&(u=t.windows.osinfo).OSArchitecture&&(u.OSArchitecture.startsWith("32")?s+=addDetailItem("구조","32비트",i):u.OSArchitecture.startsWith("64")?s+=addDetailItem("구조","64비트",i):s+=addDetailItem("구조",EscapeHtml(u.OSArchitecture),i)),e.wsc&&(l=[],null!=e.wsc.antiVirus&&("OK"==e.wsc.antiVirus?l.push("AV - <span style=color:green>확인</span>"):l.push("AV - <span style=color:red>나쁜</span>")),null!=e.wsc.autoUpdate&&("OK"==e.wsc.autoUpdate?l.push("개조하다 - <span style=color:green>확인</span>"):l.push("개조하다 - <span style=color:red>나쁜</span>")),null!=e.wsc.firewall&&("OK"==e.wsc.firewall?l.push("방화벽 - <span style=color:green>확인</span>"):l.push("방화벽 - <span style=color:red>나쁜</span>")),s+=addDetailItem("Windows 보안",l.join(", "))),e.av&&0<e.av.length){var a,l=[];for(h in e.av)e.av[h].product&&(a=EscapeHtml(e.av[h].product),!0!==e.av[h].enabled&&(a+=" - <span style=color:red>비활성화</span>"),!0!==e.av[h].updated&&(a+=" - <span style=color:red>만료된</span>"),1==e.av[h].enabled&&1==e.av[h].updated&&(a+=" - <span style=color:green>확인</span>"),l.push(a));s+=addDetailItem("백신소프트웨어",l.join("<br />"))}""!=s&&o.push({name:"운영체제",html:s,img:"software"})}if(e.agent){var r,s="";if(null!=e.agent&&null!=e.agent.id&&null!=e.agent.ver&&(r="",r=e.agent.id<=agentsStr.length?agentsStr[e.agent.id]:agentsStr[0],0!=e.agent.ver&&(r+=" v"+e.agent.ver),s+=addDetailItem("메시 에이전트",r=14==e.agent.id?e.agent.core:r)),0!=(1&e.conn)?s+=addDetailItem("마지막 에이전트 연결","지금 연결됨"):e.lastconnect&&(s+=addDetailItem("마지막 에이전트 연결",printDateTime(new Date(e.lastconnect)))),e.lastaddr&&(2<(r=e.lastaddr.split(":")).length?s+=addDetailItem("마지막 에이전트 주소",e.lastaddr):isPrivateIP(e.lastaddr)?s+=addDetailItem("마지막 에이전트 주소",r[0]):s+=addDetailItem("마지막 에이전트 주소",'<a href="https://iplocation.com/?ip='+r[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+r[0]+"</a>")),null!=t.agentvers&&t.agentvers.compileTime)try{var d=Date.parse(t.agentvers.compileTime);s+=addDetailItem("컴파일 시간",printDateTime(new Date(d)))}catch(e){}""!=s&&o.push({name:"메시 에이전트",html:s,img:"meshagent"})}if(t.mobile&&(s="",t.mobile.brand&&t.mobile.model&&(s+=addDetailItem("모델",EscapeHtml(t.mobile.brand+", "+t.mobile.model),i)),t.mobile.device&&(s+=addDetailItem("장치",EscapeHtml(t.mobile.device),i)),t.mobile.bootloader&&(s+=addDetailItem("부트 로더",EscapeHtml(t.mobile.bootloader),i)),t.mobile.id&&(s+=addDetailItem("식별자",EscapeHtml(t.mobile.id),i)),t.mobile.host&&(s+=addDetailItem("호스트 이름",EscapeHtml(t.mobile.host),i)),""!=s)&&o.push({name:"휴대 기기",html:s,img:"mobile"}),null!=n.netif2){s="";for(h in s+="<table style=width:100%>",n.netif2){var u=n.netif2[h];if(!(0==Array.isArray(u)||u.length<1||null==u[0]||"string"==typeof u[0].mac&&u[0].mac.startsWith("00:00:00:00"))){s=(s+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>")+("<div style=margin-bottom:3px><b>"+EscapeHtml(h+(u[0].fqdn?", "+u[0].fqdn:""))+"</b></div>"),u.desc&&(s+=addDetailItem("설명",EscapeHtml(u.desc).split("(R)").join("&reg;"))),"string"==typeof u[0].mac&&(u[0].gatewaymac?s+=addDetailItem("MAC 계층",format("MAC : {0}, 게이트웨이 : {1}",EscapeHtml(u[0].mac),EscapeHtml(u[0].gatewaymac))):s+=addDetailItem("MAC 계층",format("MAC : {0}",EscapeHtml(u[0].mac))));for(var c=0;c<u.length;c++){var p=u[c],m=[];p.address&&m.push(format("IP : {0}",EscapeHtml(p.address))),p.netmask&&m.push(format("마스크: {0}",EscapeHtml(p.netmask))),p.gateway&&m.push(format("게이트웨이: {0}",EscapeHtml(p.gateway))),0<m.length&&("IPv4"==p.family&&(s+=addDetailItem("IPv4 레이어",m.join(", "))),"IPv6"==p.family)&&(s+=addDetailItem("IPv6 계층",m.join(", ")))}s+="</div>"}}""!=(s+="</table>")&&o.push({name:"네트워킹",html:s,img:"networking"})}if(null!=e.intelamt&&(s="",s+=addDetailItem("버전",e.intelamt.ver?"v"+EscapeHtml(e.intelamt.ver):"<i>알 수 없는</i>",i),r={0:nobreak("활성화되지 않음 (Pre)"),1:nobreak("활성화되지 않음 (In)"),2:nobreak("활성화 됨")},d="",2==e.intelamt.state&&e.intelamt.flags&&(2&e.intelamt.flags?d=", 클라이언트 제어 모드 (CCM)":4&e.intelamt.flags&&(d=", 관리 제어 모드 (ACM)")),""!=(s=(s=(s+=addDetailItem("프로비저닝 상태",(e.intelamt.state?r[e.intelamt.state]:"<i>알 수 없는</i>")+d,i))+addDetailItem("보안",1==e.intelamt.tls?"TLS 보안":"TLS가 설정되지 않았습니다",i))+addDetailItem("관리자 자격 증명",null==e.intelamt.user||""==e.intelamt.user||null!=e.intelamt.warn&&0!=(9&e.intelamt.warn)?"알려지지 않음":"알려진",i)))&&("number"==typeof e.intelamt.sku&&0!=(16&e.intelamt.sku)?o.push({name:"인텔&reg; 표준 관리성(인텔&reg; SM)",html:s,img:"amt"}):o.push({name:"Intel&reg; Active Management Technology (Intel&reg; AMT)",html:s,img:"amt"})),t.identifiers){var s="",g=t.identifiers;if(g.bios_vendor&&(s+=addDetailItem("공급업체",EscapeHtml(g.bios_vendor),i)),g.bios_version&&(s+=addDetailItem("버전",EscapeHtml(g.bios_version),i)),""!=s&&o.push({name:"BIOS",html:s,img:"chip"}),s="",g.board_vendor&&(s+=addDetailItem("공급업체",EscapeHtml(g.board_vendor),i)),g.board_name&&(s+=addDetailItem("이름",EscapeHtml(g.board_name),i)),g.board_serial&&""!=g.board_serial&&(s+=addDetailItem("일련번호",EscapeHtml(g.board_serial),i)),g.board_version&&(s+=addDetailItem("버전",EscapeHtml(g.board_version),i)),g.product_uuid&&(s+=addDetailItem("식별자",EscapeHtml(g.product_uuid),i)),g.cpu_name&&(s+=addDetailItem("CPU",EscapeHtml(g.cpu_name).split("(TM)").join("&trade;").split("(R)").join("&reg;"),i)),g.gpu_name)for(var h in g.gpu_name)s+=addDetailItem("GPU",EscapeHtml(g.gpu_name[h]).split("(TM)").join("&trade;").split("(R)").join("&reg;"),i);""!=s&&o.push({name:"메인보드",html:s,img:"motherboard"})}if(t.windows&&t.windows.memory&&0<t.windows.memory.length){s="";for(h in t.windows.memory.sort(function(e,t){return e.BankLabel>t.BankLabel?1:e.BankLabel<t.BankLabel?-1:0}),s+="<table style=width:100%>",t.windows.memory){u=t.windows.memory[h];s=(s+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>")+("<div style=margin-bottom:3px><b>"+EscapeHtml(u.BankLabel)+"</b></div>"),u.Capacity&&u.Speed?s+=addDetailItem("용량 / 속도",format("{0} Mb, {1} Mhz",u.Capacity/1024/1024,u.Speed),i):u.Capacity&&(s+=addDetailItem("용량",format("{0} Mb",u.Capacity/1024/1024),i)),u.PartNumber&&(s+=addDetailItem("부품번호",EscapeHtml(u.Manufacturer&&"Undefined"!=u.Manufacturer?u.Manufacturer+", ":"")+EscapeHtml(u.PartNumber),i)),s+="</div>"}""!=(s+="</table>")&&o.push({name:"메모리",html:s,img:"ram"})}if(t.identifiers&&g.storage_devices){s="";for(h in g.storage_devices.sort(function(e,t){return e.Caption>t.Caption?1:e.Caption<t.Caption?-1:0}),s+="<table style=width:100%>",g.storage_devices)(u=g.storage_devices[h]).Size&&(s=(s+="<tr><td><div class=style10 style=border-radius:5px;padding:8px>")+"<div style=margin-bottom:3px><b>"+EscapeHtml(u.Caption)+"</b></div>",u.Model&&u.Model!=u.Caption&&(s+=addDetailItem("모델",EscapeHtml(u.Model),i)),u.Size&&("string"==typeof u.Size&&parseInt(u.Size)==u.Size&&(u.Size=parseInt(u.Size)),"number"==typeof u.Size&&(s+=addDetailItem("용량",format("{0} Mb",Math.floor(u.Size/1024/1024)),i)),"string"==typeof u.Size)&&(s+=addDetailItem("용량",EscapeHtml(u.Size),i)),s+="</div>");""!=(s+="</table>")&&o.push({name:"저장소",html:s,img:"storage"})}s="";for(h in o)null==o[h].img?s+="<div class=DevSt style=margin-bottom:3px;margin-left:4px><b>"+o[h].name+"</b></div><div style=margin-bottom:10px;margin-left:4px>"+o[h].html+"</div>":s=(s=(s+="<table style=width:100%><tr>")+"<td style=width:32px;vertical-align:top><img src=images/details/"+o[h].img+'32.png srcset="images/details/'+o[h].img+'64.png 2x" border=0 width=32 /></td>')+"<td><div class=DevSt style=margin-bottom:3px;margin-left:4px><b>"+o[h].name+"</b></div><div style=margin-bottom:10px;margin-left:4px>"+o[h].html+"</div></td></tr></table>";""==s?QH("p10detailshtml","이 장치에 대한 정보가 없습니다."):QH("p10detailshtml",s)}}function insertTextAtCursor(e,t){var n,o;document.selection?(e.focus(),(sel=document.selection.createRange()).text=t):e.selectionStart||"0"==e.selectionStart?(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)):e.value+=myValue}var consoleServerText="";function setupConsole(){var e,t=consoleNode==currentNode;meshes[(consoleNode=currentNode).meshid];0!=(16&GetNodeRights(currentNode))?(null==consoleNode.consoleText&&(consoleNode.consoleText=""),0==t&&(QH("p15agentConsoleText",consoleNode.consoleText),Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight),0==(1&consoleNode.conn)&&consoleNode.conn,t=0!=(1&consoleNode.conn)?"에이전트가 온라인 상태입니다.":"에이전트가 오프라인 상태입니다.",0!=(16&consoleNode.conn)&&(t+=", MQTT가 온라인 상태입니다."),QH("p15statetext",t),QE("p15uploadCore",0!=(1&consoleNode.conn)),QV("p15outputselecttd",0!=(16&consoleNode.conn)||1==currentNode.pmt&&0!=(2&features2)),QV("p15outputselect2",0!=(16&consoleNode.conn)),QV("p15outputselect3",1==currentNode.pmt&&0!=(2&features2)),t=Q("p15outputselect").value,0==(16&consoleNode.conn)&&2==t&&(t=1,Q("p15outputselect").value=1),1==currentNode.pmt&&0!=(2&features2)||3!=t||(t=1,Q("p15outputselect").value=1),e=!1,0!=(1&consoleNode.conn)&&1==t&&(e=!0),0!=(16&consoleNode.conn)&&2==t&&(e=!0),1==currentNode.pmt&&0!=(2&features2)&&3==t&&(e=!0),QE("p15consoleText",e)):(QH("p15statetext","접근 거절됨"),QE("p15consoleText",!1),QE("p15uploadCore",!1),QV("p15outputselecttd",!1)),QV("devListToolbarViewIcons3",0!=(1&consoleNode.conn))}function p15consoleClear(){QH("p15agentConsoleText",""),Q("id_p15consoleClear").blur(),consoleNode.consoleText=""}var currentMesh,consoleHistory=[];function p15consoleSend(e){var t;e&&13!=e.keyCode||(e=Q("p15consoleText").value,t="<div style=color:green>&gt; "+EscapeHtml(e)+"<br/></div>",0!=(16&consoleNode.conn)&&2==Q("p15outputselect").value?(t="<div style=color:orange>MQTT&gt; "+EscapeHtml(e)+"<br/></div>",consoleNode.consoleText+=t,meshserver.send({action:"sendmqttmsg",topic:"console",nodeids:[consoleNode._id],msg:e})):1==consoleNode.pmt&&3==Q("p15outputselect").value&&0!=(2&features2)?(t="<div style=color:violet>푸시&gt; "+EscapeHtml(e)+"<br/></div>",consoleNode.consoleText+=t,meshserver.send({action:"pushconsole",nodeid:consoleNode._id,console:e})):0!=(1&consoleNode.conn)&&(consoleNode.consoleText+=t,meshserver.send({action:"msg",type:"console",nodeid:consoleNode._id,value:e})),Q("p15agentConsoleText").innerHTML+=t,Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight,Q("p15consoleText").value="",0<e.length&&(0<=(t=consoleHistory.indexOf(e))&&consoleHistory.splice(t,1),consoleHistory.unshift(e),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=7>작은 코어 업로드</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"}):7==Q("d3coreMode").value&&meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"tiny"})}function p15uploadCore2(){xxdialogMode||(Q("d3localmodeform").action="uploadmeshcorefile.ashx",Q("d3auth").value=authCookie,Q("d3attrib").value=currentNode._id,setDialogMode(3,"메시 에이전트 코어 업로드",3,p15uploadCoreEx2),d3init())}function p15uploadCoreEx2(){var e;1==Q("d3uploadMode").value?Q("d3submit").click():1==(e=d3getFileSel()).length&&meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"custom",path:d3filetreelocation.join("/")+"/"+e[0]})}function p20updateMesh(){if(null!=currentMesh){QH("p20meshName",EscapeHtml(currentMesh.name));var e,t=format("알 수 없는 # {0}",currentMesh.mtype),n=GetMeshRights(currentMesh),o=(1==currentMesh.mtype&&(t="오직 Intel&reg; AMT만, 에이전트 없음"),2==currentMesh.mtype&&(t="소프트웨어 에이전트로 관리됨"),3==currentMesh.mtype&&(t=null==currentMesh.relayid?"로컬 장치, 에이전트 없음":"에이전트를 통해 릴레이된 에이전트 장치 없음"),4==currentMesh.mtype&&(t=null==currentMesh.relayid?"IP-KVM 장치":"에이전트를 통해 중계되는 IP-KVM 장치",1==currentMesh.kvm.model)&&(t+=", Raritan KX III"),""),i=(o=(o=(o+=addHtmlValue("이름",addLinkConditional(EscapeHtml(currentMesh.name),"p20editmesh(1)",0!=(1&n))))+addHtmlValue("설명",addLinkConditional(currentMesh.desc&&""!=currentMesh.desc?EscapeHtml(currentMesh.desc):"<i>없음</i>","p20editmesh(2)",0!=(1&n))))+addHtmlValue("유형",t),3!=currentMesh.mtype&&4!=currentMesh.mtype||null==currentMesh.relayid||(t="<i>알 수 없는</i>",o+=addHtmlValue("릴레이 장치",addLinkConditional(t=null!=(i=getNodeFromId(currentMesh.relayid))?EscapeHtml(i.name):t,"p20editmeshrelay()",0!=(1&n)))),o=(o=4==currentMesh.mtype?(o+=addHtmlValue("호스트 이름",currentMesh.kvm.host))+addHtmlValue("사용자 이름",currentMesh.kvm.user):o)+('<br><input type=button value="메모" onclick=showNotes(false,"'+encodeURIComponent(currentMesh._id)+'") />')+"<br style=clear:both><br>",currentMesh.links[userinfo._id]),s=(i&&0!=(2&i.rights)&&(o+="<div style=margin-bottom:6px;float:left;margin-right:10px><a onclick=p20showAddMeshUserDialog() style=cursor:pointer><img src=images/icon-addnew.png border=0 height=12 width=12> 사용자 추가</a></div>"),0<=navigator.userAgent.toLowerCase().indexOf("android")&&(o+="<div style=margin-bottom:6px;float:left;margin-right:10px><a onclick=p20installAndroidDialog() style=cursor:pointer><img src=images/icon-addnew.png border=0 height=12 width=12> 이 기기에 설치</a></div>"),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></tr>',1),a=[];for(e in currentMesh.links){var l=e.split("/")[2];currentMesh.links[e].name&&(l=currentMesh.links[e].name),e==userinfo._id&&(l=userinfo.name),null!=usergroups&&null!=usergroups[e]&&(l=usergroups[e].name),a.push({id:e,name:l,rights:currentMesh.links[e].rights})}for(e in a.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0}),a){var r="",d="부분적인 권리",u=a[e].rights,c=2;4294967295==u?d="전체 관리자":0==u&&(d="권한이 없습니다."),e==userinfo._id||4294967295!=n&&0==(2&n)||(r='<a onclick=p20deleteUser(event,"'+encodeURIComponent(a[e].id)+'") style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'),a[e].id.startsWith("ugrp/")&&(c=4),o=(o+='<tr onclick=p20viewuser("'+encodeURIComponent(a[e].id)+'") style=height:32px;cursor:pointer'+(s%2==0?";background-color:#DDD":"")+"><td>")+("<div style=float:right>"+r+"</div><div style=float:right;padding-right:4px>"+d+"</div><div class=m"+c+"></div><div>&nbsp;"+EscapeHtml(decodeURIComponent(a[e].name))+"<div></div></div>")+"</td></tr>",++s}o+="</tbody></table>",4294967295==n&&(o+="<div style=font-size:small;text-align:right;margin-top:6px><span><a onclick=p20showDeleteMeshDialog() style=cursor:pointer>그룹 삭제</a></span></div>"),QH("p20info",o)}}function p20showDeleteMeshDialog(){var e;return xxdialogMode||(e=format("그룹 {0}을(를) 삭제 하시겠습니까? 장치 그룹을 삭제하면 이 그룹 내 장치에 대한 모든 정보도 함께 삭제됩니다.",EscapeHtml(currentMesh.name))+"<br /><br />",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 p20editmeshrelay(){if(!xxdialogMode){var e=[];if(0==(2&features))for(var t in nodes){var n=nodes[t];2==n.mtype&&null!=n.agent&&4294967295==GetNodeRights(n)&&e.push(n)}if(e.sort(nameSort),0==e.length)setDialogMode(2,"장치 그룹 편집",1,null,"사용 가능한 릴레이 장치가 없습니다.");else{var o=[];for(t in e)o.push('<option value="'+e[t]._id+'"'+(currentMesh.relayid==e[t]._id?" selected":"")+">"+EscapeHtml(e[t].name)+"</option>");setDialogMode(2,"장치 그룹 편집",3,p20editmeshrelayEx,addHtmlValue("릴레이 장치","<div style=width:170px><select id=d2devrelay style=width:100%>"+o.join("")+"</select></div>"))}}}function p20editmeshrelayEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,relayid:Q("d2devrelay").value})}function p20editmesh(e){var t;xxdialogMode||(t=addHtmlValue("이름","<input id=dp20meshname style=width:170px maxlength=32 onchange=p20editmeshValidate() onkeyup=p20editmeshValidate() />"),setDialogMode(2,"장치 그룹 편집",3,p20editmeshEx,t+=addHtmlValue("설명","<input id=dp20meshdesc style=width:170px maxlength=1024 onkeyup=p20editmeshValidate() />")),Q("dp20meshname").value=currentMesh.name,currentMesh.desc&&(Q("dp20meshdesc").value=currentMesh.desc),p20editmeshValidate(),(2==e?Q("dp20meshdesc"):Q("dp20meshname")).focus())}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(){QE("idx_dlgOkButton",0<Q("dp20meshname").value.length)}function p20installAndroidDialog(){var e;xxdialogMode||(e="<div>Android 기기에 MeshCentral Agent를 설치합니다. 설치가 완료되면 페어링 링크를 클릭하여 장치를이 서버에 연결합니다.</div>",setDialogMode(2,"Android 설치",1,null,e=(e+='<br /><div><a href="https://play.google.com/store/apps/details?id=com.meshcentral.agent2"><b>Android 용 MeshCentral 에이전트</b></a><div>')+('<br /><div><a href="'+serverinfo.magenturl+","+serverinfo.agentCertHash+","+currentMesh._id.split("/")[2]+'"><b>장치 페어링 링크</b></a><div>')))}function p20showAddMeshUserDialog(){var e;xxdialogMode||(e=addHtmlValue("User ID","<input id=dp20username style=width:170px maxlength=256 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() />"),setDialogMode(2,"사용자를 장치 그룹에 추가",3,p20showAddMeshUserDialogEx,e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e+='<div style="border:2px groove gray;background-color:white;max-height:120px;overflow-y:scroll">')+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>전체 관리자</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editmesh>장치 그룹 편집</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20manageusers>장치 그룹 사용자 관리</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20managecomputers>장치 그룹 컴퓨터 관리</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotecontrol>원격 제어</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remoteview style=margin-left:12px>오직 원격 보기만</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotelimitedinput style=margin-left:12px>오직 제한된 입력만</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noterminal style=margin-left:12px>접근 가능한 터미널이 없습니다.</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20nofiles style=margin-left:12px>접근할 수 있는 파일이 없습니다.</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20noamt style=margin-left:12px>Intel&reg; AMT 없음</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshagentconsole>메시 에이전트 콘솔</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshserverfiles>서버 파일</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20wakedevices>장치 깨우기(Wake)</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editnotes>장치 메모 편집</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20limitevents>오직 자신의 이벤트만 표시</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20chatnotify>채팅 및 알림</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20uninstall>에이전트 제거</label><br>"+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20commands>원격 명령</label><br>")+"<label><input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20resetoff>재설정 / 전원 끄기</label><br>"+"</div>"),p20validateAddMeshUserDialog(),Q("dp20username").focus())}function p20validateAddMeshUserDialog(){var e=GetMeshRights(currentMesh),t=!Q("p20fulladmin").checked;QE("p20fulladmin",4294967295==e),QE("p20editmesh",t&&4294967295==e),QE("p20manageusers",t),QE("p20managecomputers",t),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("p20noterminal",t&&Q("p20remotecontrol").checked),QE("p20nofiles",t&&Q("p20remotecontrol").checked),QE("p20noamt",t&&Q("p20remotecontrol").checked),QE("p20chatnotify",t),QE("p20uninstall",t),QE("p20commands",t),QE("p20resetoff",t)}function p20showAddMeshUserDialogEx(){var e,t=0,n=(1==Q("p20fulladmin").checked?t=4294967295:(1==Q("p20editmesh").checked&&(t+=1),1==Q("p20manageusers").checked&&(t+=2),1==Q("p20managecomputers").checked&&(t+=4),1==Q("p20remotecontrol").checked&&(t+=8),1==Q("p20meshagentconsole").checked&&(t+=16),1==Q("p20meshserverfiles").checked&&(t+=32),1==Q("p20wakedevices").checked&&(t+=64),1==Q("p20editnotes").checked&&(t+=128),1==Q("p20remoteview").checked&&(t+=256),1==Q("p20noterminal").checked&&(t+=512),1==Q("p20nofiles").checked&&(t+=1024),1==Q("p20noamt").checked&&(t+=2048),1==Q("p20remotelimitedinput").checked&&(t+=4096),1==Q("p20limitevents").checked&&(t+=8192),1==Q("p20chatnotify").checked&&(t+=16384),1==Q("p20uninstall").checked&&(t+=32768),1==Q("p20commands").checked&&(t+=131072),1==Q("p20resetoff").checked&&(t+=262144)),Q("dp20username").value.split(",")),o=[];for(e in n)o.push(n[e].trim());meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,usernames:o,meshadmin:t})}function p20viewuser(e){var t,n,o,i,s,a;xxdialogMode||(e=decodeURIComponent(e),t=[],n=GetMeshRights(currentMesh),4294967295==(o=GetMeshRights(currentMesh,e))?t.push("전체 관리자"):(0!=(1&o)&&t.push("장치 그룹 편집"),0!=(2&o)&&t.push("장치 그룹 사용자 관리"),0!=(4&o)&&t.push("장치 그룹 컴퓨터 관리"),0!=(8&o)&&t.push("원격 제어"),0!=(16&o)&&t.push("에이전트 콘솔"),0!=(32&o)&&t.push("서버 파일"),0!=(64&o)&&t.push("장치 깨우기(Wake)"),0!=(128&o)&&t.push("메모 편집"),0!=(256&o)&&t.push("오직 원격 보기만"),0!=(512&o)&&t.push("터미널이 없습니다."),0!=(1024&o)&&t.push("파일이 없습니다."),0!=(2048&o)&&t.push("Intel&reg; AMT 없음"),0!=(8&o)&&0!=(4096&o)&&0==(256&o)&&t.push("제한된 입력"),0!=(8192&o)&&t.push("오직 자체 이벤트만"),0!=(16384&o)&&t.push("채팅 및 알림"),0!=(32768&o)&&t.push("설치 제거"),0!=(131072&o)&&t.push("명령"),0!=(262144&o)&&t.push("재설정 / 끄기")),0==t.length&&t.push("권한이 없습니다."),i=1,s=e.split("/")[2],currentMesh.links[e].name&&(s=currentMesh.links[e].name),a=addHtmlValue("사용자 이름",EscapeHtml(s)),s!=e.split("/")[2]&&(a+=addHtmlValue("사용자 ID",EscapeHtml(e.split("/")[2]))),a+=addHtmlValue("권한",t.join(", ")),userinfo._id!=e&&(4294967295==n||0!=(2&n)&&4294967295!=o)&&(i+=4),setDialogMode(2,"장치 그룹 사용자",i,p20viewuserEx,a,e))}function p20viewuserEx(e,t){2==e&&(e=t.split("/")[2],users&&users[t]&&(e=users[t].name),usergroups&&usergroups[t]&&(e=usergroups[t].name),setDialogMode(2,"원격 메시 사용자",3,p20viewuserEx2,format("사용자 {0}를 삭제하시겠습니까?",e=userinfo._id==t?userinfo.name:e),t))}function p20deleteUser(e,t){haltEvent(e),p20viewuserEx(2,decodeURIComponent(t))}function p20viewuserEx2(e,t){meshserver.send({action:"removemeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:t})}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("notificationCount2",e),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,n=notifications[n],i="",s=new Date(n.time),a=0;null!=n.title&&(i="<b>"+EscapeHtml(n.title)+"</b>: "),null!=n.nodeid&&null!=(o=getNodeFromId(n.nodeid))&&(a=o.icon,i=16&e?"<b>"+EscapeHtml(meshes[o.meshid].name)+" / "+EscapeHtml(o.name)+"</b>: ":"<b>"+EscapeHtml(o.name)+"</b>: "),t+='<div title="'+format("{0}에 발생",printDateTime(s))+'" id="notifyx'+n.id+'" class=notification style="cursor:pointer;border-top:1px solid '+(""==t?"transparent":"orange")+'">',a&&(t+="<div class=j"+a+' onclick="notificationSelected('+n.id+')" style=margin:5px;float:left></div>'),t+='<div onclick="notificationDelete('+n.id+')" class=unselectable title="이 알림을 지우기" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected('+n.id+')" style=margin:5px>'+i+EscapeHtml(n.text)+"</div><div style=margin-left:5px;margin-bottom:5px;color:gray;font-size:10px>"+printDateTime(s)+"</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+l+"</div>")}function notificationSelected(e,t){var n,o=-1;for(n in notifications)notifications[n].id==e&&(o=n);-1!=o&&(notificationSelectedEx(notifications[o],e),t)&&notifications[o]&&(notifications[o].notification&&(notifications[o].notification.close(),delete notifications[o].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):"backupcodes"!=e.tag||xxdialogMode?null!=e.tag&&e.tag.startsWith("meshmessenger/")?(safeNewWindow("/messenger?id="+e.tag+"&title="+encodeURIComponentEx(e.username),e.tag.split("/")[2]),notificationDelete(t)):null!=e.url&&(safeNewWindow(e.url),notificationDelete(t)):(account_manageOtp(0),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);-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&&(n=notifications[0],QS("notifyx"+n.id)["border-top"]="1px solid transparent")}}function addNotification(e){if("number"==typeof e.titleid)try{e.title=[null,"새 계정","서버 제한","보안 경고","계정 설정","장치 그룹","코드 초대"][e.titleid]}catch(e){}if("number"==typeof e.msgid)try{e.text=[null,"권한이 거부되었습니다.","잘못된 사용자 이름","잘못된 비밀번호","잘못된 이메일","잘못된 도메인","잘못된 사이트 권한","사용자가 이미 존재합니다","이 모드에서 사용자를 추가 할 수 없습니다.","유효성 검사 예외","계정 한도에 도달했습니다.","채팅 요청, 수락하려면 여기를 클릭하십시오.","마지막 로그인 이후이 계정에서 {0} 번의 로그인 시도가 실패했습니다.","이메일 주소를 변경하지 못했습니다. 이미 사용중인 다른 계정 : {0}.","이메일이 발송되었습니다.","사용자 {0}을 (를) 찾을 수 없습니다.","{0} 사용자를 찾을 수 없습니다.","오류, 이전에 사용한 비밀번호로 변경할 수 없습니다.","오류, 일반적으로 사용되는 비밀번호로 변경할 수 없습니다.","오류, 비밀번호가 변경되지 않았습니다.","비밀번호가 변경되었습니다.","현재 비밀번호가 올바르지 않습니다.",'오류입니다. "{0}"초대 코드가 이미 사용 중입니다.',"SMS 게이트웨이가 활성화되지 않았습니다.","사용자 관리 권한 없음","잘못된 SMS 메시지","이 사용자의 전화 번호가 없습니다.","SMS가 성공적으로 전송되었습니다.","SMS 오류","SMS 오류 : {0}",'이메일 도메인 "{0}"은(는) 허용되지 않습니다. ({1})만 허용됩니다.'][e.msgid],Array.isArray(e.args)&&(e.text=format(e.text,e.args[0],e.args[1],e.args[2],e.args[3],e.args[4],e.args[5]))}catch(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,n,o=getstore("notifications",0),i=(1&o&&Q("chimes").play(),null);Notification&&"granted"==Notification.permission&&(t=e.text.split("&reg;").join("").split("<b>").join("").split("</b>").join("").split("<br />").join("\r\n"),e.nodeid?(n=getNodeFromId(e.nodeid))&&(i=16&o?new Notification(decodeURIComponent("{{{extitle}}}")+" - "+meshes[n.meshid].name+" - "+n.name,{tag:e.tag,body:t,icon:"/images/notify/icons128-"+n.icon+".png"}):new Notification(decodeURIComponent("{{{extitle}}}")+" - "+n.name,{tag:e.tag,body:t,icon:"/images/notify/icons128-"+n.icon+".png"})):(null==e.icon&&(e.icon=0),o=null==(o=e.title)?"":" - "+e.title,i=new Notification(decodeURIComponent("{{{extitle}}}")+o,{tag:e.tag,body:t,icon:"/images/notify/icons128-"+e.icon+".png"})),i.id=e.id,i.xtag=e.tag,i.url=e.url,i.nodeid=e.nodeid,i.username=e.username,i.onclick=function(e){notificationSelected(e.target.id,!0)},e.notification=i),"number"==typeof e.maxtime&&0<e.maxtime&&((n=function e(){notificationDelete(e.xid)}).xid=e.id,setTimeout(n,1e3*e.maxtime))}function deleteAllNotifications(){notifications=[],setNotificationCount(0),drawNotifications(),QV("notifiyBox",!1)}var xxdialogMode,xxdialogFunc,xxdialogButtons,xxdialogTag,xxcurrentView=-1;function go(e){if(setSessionActivity(),!xxdialogMode&&xxcurrentView!=e){updateFooterMenu(),setDialogMode(0);for(var t=0;t<32;t++)QV("p"+t,t==e);xxcurrentView=e,updateCurrentUrl()}}function updateCurrentUrl(){if(0==(268435456&features)&&0<xxcurrentView){var e,t="";for(e in 10<=xxcurrentView&&xxcurrentView<=19?null!=currentNode&&(t="?viewmode="+xxcurrentView+"&gotonode="+currentNode._id.split("/")[2]+(0<currentDevicePanel?"&panel="+currentDevicePanel:"")):20<=xxcurrentView&&xxcurrentView<=29?null!=currentMesh&&(t="?viewmode="+xxcurrentView+"&gotomesh="+currentMesh._id.split("/")[2]):1<xxcurrentView&&(t="?viewmode="+xxcurrentView),urlargs)t+=(""==t?"?":"&")+e+"="+urlargs[e];try{window.history.replaceState({},document.title,window.location.pathname+t)}catch(e){}}}function setDialogMode(e,t,n,o,i,s){setSessionActivity(),xxdialogMode=e,xxdialogFunc=o,xxdialogButtons=n,xxdialogTag=s,QE("idx_dlgOkButton",!0),QV("idx_dlgOkButton",1&n),QV("idx_dlgCancelButton",2&n),QV("id_dialogclose",2&n||8&n),QV("idx_dlgDeleteButton",4&n),QV("idx_dlgButtonBar",7&n),t&&QH("id_dialogtitle",t);for(var a=1;a<24;a++)QV("dialog"+a,a==e);QV("dialog",e),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 removeUserRights(e,t){var n;return t==userinfo._id&&null!=userinfo.removeRights&&((n=t=0)!=(8&userinfo.removeRights)&&(n+=8),0!=(65536&userinfo.removeRights)&&(t+=65536),0!=(256&userinfo.removeRights)&&(t+=256),0!=(512&userinfo.removeRights)&&(t+=512),0!=(1024&userinfo.removeRights)&&(t+=1024),0!=(16&userinfo.removeRights)&&(n+=16),0!=(32768&userinfo.removeRights)&&(n+=32768),0!=(131072&userinfo.removeRights)&&(n+=131072),0!=(64&userinfo.removeRights)&&(n+=64),0!=(262144&userinfo.removeRights)&&(n+=262144),e=4294967295!=e?(e|t)&4294967295-n:((e=2015471)|t)&4294967295-n),e}function GetMeshRights(e,t){if(null==e)return 0;if(null==t&&(t=userinfo._id),null==(e="string"==typeof e?meshes[e]:e)||null==e.links)return 0;if(serverinfo.manageAllDeviceGroups&&t==userinfo._id)return removeUserRights(4294967295,t);var n=0,o=e.links[t];if(null!=o){if(4294967295==o.rights)return removeUserRights(4294967295,t);n=o.rights}var i=null;if(t==userinfo._id?i=userinfo:null!=users&&(i=users[t]),null!=i)for(var s in i.links)if(s.startsWith("ugrp/")&&null!=(o=e.links[s])){if(4294967295==o.rights)return removeUserRights(4294967295,t);n|=o.rights}return removeUserRights(n,t)}function IsMeshViewable(e,t){if(null!=e&&(null==t&&(t=userinfo._id),null!=(e="string"==typeof e?meshes[e]:e))&&null!=e.links){if(null!=e.links[t])return!0;if(serverinfo.manageAllDeviceGroups&&t==userinfo._id)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&&(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 removeUserRights(n,t)}function IsNodeViewable(e,t){if(null!=e&&(null==t&&(t=userinfo._id),"string"!=typeof e||null!=(e=getNodeFromId(e)))){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}function nameSort(e,t){e=e.name.toLowerCase(),t=t.name.toLowerCase();return sortCollator.compare(e,t)}function getNodeAmtVersion(e){return null==e||null==e.intelamt||"string"!=typeof e.intelamt.ver||(e=e.intelamt.ver.split(".")).length<2?0:parseInt(e[0])+parseInt(e[1])/100}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]){for(var n={},o=0,i=localStorage.length;o<i;++o){var s=localStorage.key(o);"_"!=s[0]&&(n[s]=localStorage.getItem(s))}meshserver.send({action:"userWebState",state:JSON.stringify(n)})}}function getstore(e,t){try{var n;return"undefined"==typeof localStorage?t:null==(n=localStorage.getItem(e))?t:n}catch(e){return t}}function center(){xtermfit&&xtermfit.fit(),onDevicesScroll(),QS("dialog").left=(getDocWidth()-300)/2+"px",deskAdjust(),null!=currentNode&&drawDeviceTimeline()}function messagebox(e,t){QH("id_dialogMessage",t),setDialogMode(1,e,1)}function statusbox(e,t){QH("id_dialogMessage",t),setDialogMode(1,e)}function getDocWidth(){return window.innerWidth||(document.documentElement&&document.documentElement.clientWidth&&0!=document.documentElement.clientWidth?document.documentElement:document.getElementsByTagName("body")[0]).clientWidth}function haltEvent(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1}function haltReturn(e){13==e.keyCode&&haltEvent(e)}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 reload(){window.location.href=window.location.href}function getNodeFromId(e){for(var t in nodes)if(nodes[t]._id==e)return nodes[t];return null}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 addHtmlValue4(e,t){return"<table style=width:100%><td style=width:120px>"+e+"<td style=text-align:right><b>"+t+"</b></table>"}function addLink(e,t){return"<a style=cursor:pointer;text-decoration:none onclick='"+t+"'>&diams; "+e+"</a>"}function addLinkConditional(e,t,n){return n?addLink(e,t):e}function passwordcheck(e){return/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/.test(e)}function getFileSizeStr(e){return 1==(e="number"!=typeof e?0:e)?"1바이트":format("{0} bytes",e)}function joinPaths(){var e,t=[];for(e in arguments){var n=arguments[e];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);t.push(n)}}return t.join("/")}function focusTextBox(e){setTimeout(function(){Q(e).selectionStart=Q(e).selectionEnd=65535,Q(e).focus()},0)}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 printDate(e){return e.toLocaleDateString(args.locale)}function printTime(e){return e.toLocaleTimeString(args.locale)}function printDateTime(e){return e.toLocaleString(args.locale)}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 nobreak(e){return e.split(" ").join("&nbsp;")}function getUserName(e){return users&&null!=users[e]?users[e].name:e.split("/")[2]}function addDetailItem(e,t,n){return"<table style=width:100%><td>"+nobreak(e)+"<td style=text-align:right>"+t+"</table>"}function isPrivateIP(e){return e.startsWith("10.")||e.startsWith("172.16.")||e.startsWith("192.168.")}function encodeURIComponentEx(e){return encodeURIComponent(e).replace(/'/g,"%27")}function safeNewWindow(e,t){e=window.open(e,t,"noopener,noreferrer");e&&(e.opener=null)}</script>