<!doctypehtml><html lang=ru 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><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">{{{customCSSTags}}}<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/xterm-addon-image{{{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>{{{customJSTags}}}<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}.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}.style10{background-color:#c9c9c9;color:#000}.night .style10{background-color:#888}.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}.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}#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}#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}</style><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>{{{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>{{{title2}}}</font></strong></div></div></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=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><div style=margin-left:10px;margin-top:14px;font-size:20px><strong><span id=p10deviceName></span></strong></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=OK style=float:right;width:80px onclick=deskCustomizeKeysEx()></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 inputmode=text 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></div><div><input type=button value=Настройки onkeypress=return!1 onkeydown=return!1 onclick=showDesktopSettings() style=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 cmenu=termConnectButton value=Подключиться style=height:28px onclick=connectTerminal(event,1) 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% id=termarea3xdiv></div></div></div><div id=termarea4 style=position:relative;height:32px><div class=areaFoot><div class=toright2></div><div style=height:28px></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><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) 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=Up> <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></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 Hardware 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=OK 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 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 files,terminal,deskPinchZoom,random="{{{randomlength}}}",args=parseUriArgs(),urlargs=args,sessionTime=parseInt("{{{sessiontime}}}"),sessionRefreshTimer=null,domain="{{{domain}}}",domainUrl="{{{domainurl}}}",authCookie="{{{authCookie}}}",authRelayCookie="{{{authRelayCookie}}}",viewOnly=parseInt("{{{viewOnly}}}"),authCookieRenewTimer=null,serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}",debugmode=!1,attemptWebRTC=!1,StatusStrs=["Отключен","Подключение...","Установка...","Подключено","Intel&reg; AMT подключен"],sessionActivity=Date.now(),deskKeyboardShortcuts=[],xterm=null,xtermfit=null,xtermimage=null,xtermResizeTimer=null,features=parseInt("{{{features}}}"),features2=parseInt("{{{features2}}}"),features3=parseInt("{{{features3}}}"),nodeName=decodeURIComponent("{{{nodeName}}}"),p11DeskConsoleMsgTimer=null,p12TermConsoleMsgTimer=null,p13FilesConsoleMsgTimer=null,webpSupport=!1;function startup(){if(QH("p10deviceName",nodeName),!(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)}if(!args.locale){var t=getstore("loctag",0);null!=t&&"*"!=t&&(args.locale=t)}window.onresize=center,center(),go(10),nodeName.length>0&&(document.title+=" - "+nodeName),document.onkeypress=ondeskkeypress,document.onkeydown=ondeskkeydown,document.onkeyup=ondeskkeyup,document.onclick=function(e){999==xxdialogMode&&"topMenuIcon"!=e.target.id&&(QV("topMenu",!1),xxdialogMode=0)};var o=localStorage.getItem("desktopsettings");null!=o&&(desktopsettings=JSON.parse(o)),applyDesktopSettings(),attemptWebRTC=!1,null!=args.webrtc&&(attemptWebRTC=1==args.webrtc),deskKeyboardShortcuts=[];var n=getstore("deskKeyShortcuts","0x0A002E,0x100000,0x100028,0x100026,0x10004C,0x10004D,0x11004D,0x100052,0x020073,0x080057,0x020009,0x100025,0x100027").split(",");for(var l in n)deskKeyboardShortcuts.push(parseInt(n[l]));updateDeskShortcutKeys(),updateTermShortcutKeys(),updateDesktopButtons(),updateTerminalButtons(),2&features?currentDevicePanel=1:1&features?currentDevicePanel=5:4&features&&(currentDevicePanel=2),setupDeviceMenu(currentDevicePanel)}function setSessionActivity(){sessionActivity=Date.now()}function checkIdleSessionTimeout(){Date.now()-sessionActivity>serverinfo.timeout&&(null!=desktop&&(desktop.Stop(),desktopNode=desktop=null),null!=terminal&&(terminal.Stop(),terminal=null),null!=files&&(files.Stop(),files=null),serverinfo.logoutonidlesessiontimeout&&(window.location.href="logout"))}function updateFooterMenu(e){for(;null!=e&&e.length<3;)e.push({n:""});var t="",o="";if(null!=e)for(var n in e)t+='<td style="cursor:pointer'+(""==o?"":";border-left:solid 1px white")+(e[n].s?";background-color:#487099":"")+'" onclick="'+e[n].f+'">'+e[n].n,o=e[n].n;QH("footerMenu","<tr>"+t)}check_webp_feature("lossy",function(e,t){webpSupport=t});var gotKeyPressEvent=!1;function ondeskkeypress(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel)return gotKeyPressEvent=!0,Q("softKeyboard").value="",1!=viewOnly&&desktop.m.handleKeys(e);if(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&1!==t){if(1==e.altKey)return!0;gotKeyPressEvent=!0,Q("softKeyboard").value="";var o=0;return 0!=e.charCode?o=e.charCode:0!=e.keyCode&&(o=e.keyCode),0!=o&&("sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+String.fromCharCode(o)):terminal.sendText(String.fromCharCode(o))),!1}}function ondeskkeydown(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel)return gotKeyPressEvent=!1,Q("softKeyboard").value="",1!=viewOnly&&desktop.m.handleKeyDown(e);if(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&1!==t){if(1==e.altKey)return!0;Q("softKeyboard").value="",gotKeyPressEvent=!1;var o=0;0!=e.charCode?o=e.charCode:0!=e.keyCode&&(o=e.keyCode),8==o?terminal.sendText(String.fromCharCode(o)):e.ctrlKey&&o>=64&&o<=95&&("sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+String.fromCharCode(o-64)):terminal.sendText(String.fromCharCode(o-64)))}}function ondeskkeyup(e,t){if(setSessionActivity(),desktop&&!xxdialogMode&&10==xxcurrentView&&1==currentDevicePanel){var o=Q("softKeyboard").value;if(Q("softKeyboard").value="",1==viewOnly)return;if(!(0==gotKeyPressEvent&&o.length>0&&desktop.m.SendKeyUnicode))return desktop.m.handleKeyUp(e);var n=o[o.length-1].charCodeAt(0);desktop.m.SendKeyUnicode(desktop.m.KeyAction.DOWN,n),desktop.m.SendKeyUnicode(desktop.m.KeyAction.UP,n)}if(terminal&&!xxdialogMode&&10==xxcurrentView&&5==currentDevicePanel&&0==gotKeyPressEvent&&1!==t){if(1==e.altKey)return!0;o=Q("softKeyboard").value;return Q("softKeyboard").value="","sshterminalrelay.ashx"==terminal.urlname?terminal.socket.send("~"+o):o&&terminal.sendText(o),!1}}var desktop,desktopNode,currentDevicePanel=0;function setupDeviceMenu(e,t){null!=e&&(currentDevicePanel=e),QV("p10desktop",1==currentDevicePanel),QV("p10files",2==currentDevicePanel),QV("p10terminal",5==currentDevicePanel);var o=[];2&features&&o.push({n:"Рабочий стол",f:"setupDeviceMenu(1)",s:1==currentDevicePanel}),1&features&&o.push({n:"Терминал",f:"setupDeviceMenu(5)",s:5==currentDevicePanel}),4&features&&o.push({n:"Файлы",f:"setupDeviceMenu(2)",s:2==currentDevicePanel}),updateFooterMenu(o),1==currentDevicePanel&&deskAdjust()}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(),desktopNode=null,desktop=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(){var e=0;null!=desktop&&(e=desktop.State),QV("disconnectbutton1",0!=e),QE("deskFullScreen",0!=e),QV("connectbutton1",0==e),QV("connectbutton1h",!1),QV("d7amtkvm",!1),QV("d7meshkvm",!0),QE("connectbutton1",!0),QE("connectbutton1h",!1)}var agentConsoleMessages=["","Ожидание предоставления доступа пользователем ...","Отказано","Не удалось запустить сеанс удаленного терминала, {0} ({1})","Тайм-аут","Получены неверные сетевые данные"];function formatAgentConsoleMessage(e,t,o){for(null==o&&(o=[]);o.length<3;)o.push("");return(t&&t<agentConsoleMessages.length?EscapeHtml(format(agentConsoleMessages[t],o[0],o[1],o[2])):EscapeHtml(e)).split("\n").join("<br />")+"<br /><br />"}function connectDesktop(e,t,o,n){if(setSessionActivity(),QV("p11DeskSessionSelector",!1),p11clearConsoleMsg(),null==desktop)if(2==t){if(null==desktopNode.intelamt.user||""==desktopNode.intelamt.user)return void editDeviceAmtSettings(desktopNode._id,connectDesktop);(desktop=CreateAmtRedirect(CreateAmtRemoteDesktop("Desk"),authCookie)).debugmode=debugmode,desktop.onStateChanged=onDesktopStateChange,desktop.m.stopInput=1==viewOnly,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,o){fullscreen&&(QS("deskarea3").width=t*fullscreenzoom+"px",QS("deskarea3").height=o*fullscreenzoom+"px"),deskAdjust()},desktop.Start(desktopNode._id,16994,"*","*",0),desktop.contype=2}else null!=t&&1!=t&&3!=t||((desktop=CreateAgentRedirect(null,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie,null,domainUrl)).m.stopInput=1==viewOnly,desktop.m.mouseCursorActive(!0),desktop.debugmode=debugmode,desktop.m.debugmode=debugmode,desktop.attemptWebRTC=attemptWebRTC,desktop.options={},null!=o&&(desktop.options.tsid=o),null!=n&&(desktop.options.consent=n),1==desktopsettings.autolock&&(desktop.options.autolock=!0),desktop.onStateChanged=onDesktopStateChange,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,o){fullscreen&&(QS("deskarea3").width=t*fullscreenzoom+"px",QS("deskarea3").height=o*fullscreenzoom+"px"),deskAdjust()},desktop.Start(null),desktop.contype=1);else 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 o=t;3==o&&2==e.contype&&o++;var n=StatusStrs[o];if(null!=desktop&&1==desktop.webRtcActive&&(n+=", WebRTC"),QH("deskstatus",n),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=512&features?[100,90,70,50,40,30,20,10,5,1]:[50,40,30,20,10,5,1];for(var o in t)e+="<option value="+t[o]+">"+t[o]+"%</option>";QH("d7bitmapquality",e),d7desktopmode.value=desktopsettings.encoding,d7bitmapquality.value=40,t.indexOf(parseInt(desktopsettings.quality))>=0&&(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?(Q("softKeyboard").blur(),keyboardShown=!1):(Q("softKeyboard").focus(),keyboardShown=!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='<div class="menuButton" onclick="deskMenuButton(-1)">Настроить</div>';for(var t in deskKeyboardShortcuts)e+='<div class="menuButton" onclick="deskMenuButton('+deskKeyboardShortcuts[t]+')">'+keyShortcutTotext(deskKeyboardShortcuts[t])+"</div>";QH("deskButtonMenu",e)}var keyStrings={8:"Backspace",9:"Tab",13:"Ввод",27:"Escape",44:"Print Screen",45:"Insert",46:"Del",36:"Home",35:"Конец",33:"Page Up",34:"Page Down",37:"Left",38:"Up",39:"Right",40:"Down",0:"Пусто"};function keyShortcutTotext(e){var t=[];return 65536&e&&t.push("Shift"),131072&e&&t.push("Alt"),524288&e&&t.push("Ctrl"),1048576&e&&t.push("Win"),(e&=65535)>=112&&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='<div id=d2shortcuts style="width:100%;height:180px;padding:4px;overflow-y:auto;border:1px solid gray"></div><div style=width:100%;padding:5px>';for(var t in e+="<label><input id=d1kshift type=checkbox /> Shift</label><label> <input id=d1kalt type=checkbox /> Alt</label><label> <input id=d1kctrl type=checkbox /> Ctrl</label> <input id=d1kwin type=checkbox /> Win</label>",e+=" <select id=d2keySelect>",keyStrings)e+="<option value="+t+">"+keyStrings[t]+"</option>";for(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="";for(var t in deskKeyboardShortcuts){var o=keyShortcutTotext(deskKeyboardShortcuts[t]),n="";t!=deskKeyboardShortcuts.length-1&&(n+='<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c2.png" onclick=deskCustomizeKeyDown('+deskKeyboardShortcuts[t]+")>"),0!=t&&(n+='<img width=8 height=8 style=float:right;cursor:pointer;padding:3px src="images/c3.png" onclick=deskCustomizeKeyUp('+deskKeyboardShortcuts[t]+")>"),e+='<div style="width:100%;background-color:#AAA;border-radius:4px;margin-bottom:4px;padding:4px;text-align:left;box-sizing:border-box" value='+deskKeyboardShortcuts[t]+">"+o+'<img width=10 height=10 style=float:right;cursor:pointer;padding:2px;margin-left:8px src="images/trash.png" onclick=removeDeskCustomizeKey('+deskKeyboardShortcuts[t]+")>"+n+"</div>"}""==e&&(e="<i>Сочетания клавиш не заданны</i>"),QH("d2shortcuts",e)}function deskCustomizeKeyDown(e){var t=deskKeyboardShortcuts.indexOf(e),o=deskKeyboardShortcuts[t+1];deskKeyboardShortcuts[t+1]=deskKeyboardShortcuts[t],deskKeyboardShortcuts[t]=o,deskUpdateShortcutList()}function deskCustomizeKeyUp(e){var t=deskKeyboardShortcuts.indexOf(e),o=deskKeyboardShortcuts[t];deskKeyboardShortcuts[t]=deskKeyboardShortcuts[t-1],deskKeyboardShortcuts[t-1]=o,deskUpdateShortcutList()}function removeDeskCustomizeKey(e){var t=[];for(var o in deskKeyboardShortcuts)deskKeyboardShortcuts[o]!=e&&t.push(deskKeyboardShortcuts[o]);deskKeyboardShortcuts=t,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),e>0&&-1==deskKeyboardShortcuts.indexOf(e)&&(deskKeyboardShortcuts.push(e),deskUpdateShortcutList())}function deskSendKeys(e){if(!xxdialogMode&&null!=desktop&&3==desktop.State)if(-1!=e)if(655406!=e){var t=(16711680&e)>>16,o=65535&e,n=[],l=[],s={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]),l.push([65505,0])),2&t&&(n.push([65513,1]),l.push([65513,0])),8&t&&(n.push([65507,1]),l.push([65507,0])),16&t&&(n.push([65511,1]),l.push([65511,0])),s[o]&&(o=s[o]),o>=65&&o<=90&&(o+=32),0!=o&&(n.push([o,1]),l.push([o,0])),l.reverse();for(var i=0;i<l.length;i++)n.push(l[i]);desktop.m.sendkey(n)}else{1&t&&(n.push([desktop.m.KeyAction.DOWN,16]),l.push([desktop.m.KeyAction.UP,16])),2&t&&(n.push([desktop.m.KeyAction.EXDOWN,18]),l.push([desktop.m.KeyAction.EXUP,18])),8&t&&(n.push([desktop.m.KeyAction.EXDOWN,17]),l.push([desktop.m.KeyAction.EXUP,17])),16&t&&(n.push([desktop.m.KeyAction.EXDOWN,91]),l.push([desktop.m.KeyAction.EXUP,91])),0!=o&&(n.push([desktop.m.KeyAction.DOWN,o]),l.push([desktop.m.KeyAction.UP,o])),l.reverse();for(i=0;i<l.length;i++)n.push(l[i]);desktop.m.SendKeyMsgKC(n)}}else desktop.m.sendcad();else deskCustomizeKeys()}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()}if(5==currentDevicePanel){if(null==terminal)return;xterm.setOption("fontSize",15==xterm.getOption("fontSize")?10:15)}}}var terminalNode,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=0==viewOnly;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"]="#FFF",QS("p10")["background-color"]=null),1==currentDevicePanel&&deskAdjust()}function deskAdjust(){if(1==currentDevicePanel)if(fullscreen){QS("Desk")["margin-top"]=null,QS("Desk")["margin-bottom"]=null,QS("Desk").width="100%",QS("Desk").height="100%";var e=Q("p10desktop").clientHeight,t=Q("p10desktop").clientWidth,o=Q("deskarea3").clientHeight,n=Q("deskarea3").clientWidth-55;QS("deskarea3").top=e>o?(e-o)/2+"px":null,QS("deskarea3").left=t>n?(t-n)/2+"px":null}else{if((e=Q("DeskParent").clientHeight)/(t=Q("DeskParent").clientWidth)>(o=Q("Desk").height)/(n=Q("Desk").width)){var l=o*t/n+"px";QS("Desk").height=l,QS("Desk").width="100%"}else{var s=n*e/o+"px";QS("Desk").width=s,QS("Desk").height="100%"}QS("DeskParent").overflow="hidden";var i=(Q("DeskParent").clientHeight-Q("Desk").clientHeight)/2;QS("Desk")["margin-top"]=i+"px",QS("Desk")["margin-bottom"]=i+"px"}}function sendSpecialKeys(){xxdialogMode||null==desktop||3!=desktop.State||setDialogMode(3,"Специальные клавиши",3,deskSendKeys)}function deskSaveImage(){if(setSessionActivity(),!xxdialogMode&&null!=desktop&&3==desktop.State){var e=new Date,t="Desktop-"+currentNode.name+"-"+e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)+"-"+("0"+e.getHours()).slice(-2)+"-"+("0"+e.getMinutes()).slice(-2);Q("Desk").toBlob(function(e){saveAs(e,t+".png")})}}function deskSelectScreens(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){var e="",t=desktop.m.displays;for(var o in t)e+="<option value="+o+" "+(desktop.m.selectedDisplay==o?" selected":"")+">"+t[o]+"</option>";setDialogMode(2,"Выбор экрана",3,deskSelectScreensEx,e=addHtmlValue4("Экран","<select style=width:100% id=deskdisplays>"+e+"</select>"))}}function deskSelectScreensEx(){null!=desktop&&3==desktop.State&&desktop.m.SetDisplay(parseInt(Q("deskdisplays").value))}function deskDisplayInfo(e,t,o,n){var l=0;for(var s in t)l++;QV("DeskScreens",l>1)}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(){var e=null!=terminal&&0!=terminal.state;QE("termFullScreen",0!=e),QV("disconnectbutton2span",1==e),QV("connectbutton2span",0==e),QE("connectbutton2",!0)}function onTerminalStateChange(e,t){var o=t;3==o&&2==e.contype&&o++;var n=StatusStrs[o];switch(1==terminal.webRtcActive&&(n+=", WebRTC"),QH("termstatus",n),t){case 0:xterm.dispose(),xterm=xtermfit=xtermimage=null,null!=terminal&&(terminal.Stop(),terminal=null);break;case 3:xterm.focus()}updateTerminalButtons()}function CreateRemoteTunnel(e,t){var o={protocol:1};return null!=t&&"number"==typeof t.protocol&&(o.protocol=t.protocol),o.onTunnelUpdate=e,o.xxStateChange=function(e){},o.ProcessBinaryData=function(e){o.onTunnelUpdate(e)},o.ProcessData=function(e){o.onTunnelUpdate(e)},o.terminalEmulation=1,o.fxEmulation=0,o.lineFeed="\r\n",o}function tunnelUpdate(e){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 sshTunnelUpdate(e){if("string"==typeof e)if("{"==e[0])switch(JSON.parse(e).action){case"sshauth":var t="";t+=addHtmlValue("Аутентификация","<select id=dp2authmethod style=width:150px onchange=sshAuthUpdate(event)><option value=1 selected>Имя пользователя и пароль</option><option value=2>Имя пользователя и ключ</option></select>"),t+=addHtmlValue("Имя пользователя","<input id=dp2user style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="<div id=d2passauth>",t+=addHtmlValue("Пароль","<input type=password id=dp2pass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="</div><div id=d2keyauth style=display:none>",t+=addHtmlValue("Ключевой файл","<input type=file id=dp2key style=width:150px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />"),t+=addHtmlValue("Пароль ключа","<input type=password id=dp2keypass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="</div>",t+="<label><input id=dp2keep type=checkbox>Запомнить учетные данные</label>",setDialogMode(2,"Аутентификация",11,sshConnectEx,t+="<div id=d2keyauth2 style=font-size:x-small><br />Ключевой файл должен быть в формате OpenSSH.</div>","ssh"),setTimeout(sshAuthUpdate,50);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){if(QV("d2passauth",1==Q("dp2authmethod").value),QV("d2keyauth",2==Q("dp2authmethod").value),QV("d2keyauth2",2==Q("dp2authmethod").value),1==Q("dp2authmethod").value)QE("idx_dlgOkButton",Q("dp2user").value.length>0&&Q("dp2pass").value.length>0);else if(QE("idx_dlgOkButton",!1),1==(Q("dp2user").value.length>0&&null!=Q("dp2key").files&&1==Q("dp2key").files.length&&Q("dp2key").files[0].size<8e3)){var t=new FileReader;t.onload=function(e){var t=e.target.result.indexOf("-----BEGIN OPENSSH PRIVATE KEY-----")>=0&&e.target.result.indexOf("-----END OPENSSH PRIVATE KEY-----")>=0;QE("idx_dlgOkButton",t)},t.readAsText(Q("dp2key").files[0])}}function sshConnectEx(e){if(0==e)null!=terminal&&connectTerminal();else if(1==Q("dp2authmethod").value)terminal.socket.send(JSON.stringify({action:"sshauth",username:Q("dp2user").value,password:Q("dp2pass").value,keep:Q("dp2keep").checked,cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight}));else{var t=new FileReader,o=Q("dp2user").value,n=Q("dp2keypass").value,l=Q("dp2keep").checked;t.onload=function(e){terminal.socket.send(JSON.stringify({action:"sshauth",username:o,keypass:n,key:e.target.result,keep:l,cols:xterm.cols,rows:xterm.rows,width:Q("termarea3xdiv").offsetWidth,height:Q("termarea3xdiv").offsetHeight}))},t.readAsText(Q("dp2key").files[0])}}function xTermSendResize(){xtermResizeTimer=null,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,o){if(p12clearConsoleMsg(),terminal)terminal.Stop(),terminal=null,fullscreen&&deskToggleFull();else{var n={protocol:null!=o&&"number"==typeof o.protocol?o.protocol:1};o&&o.requireLogin&&(n.requireLogin=!0),null!=serverinfo.linuxshell&&currentNode.agent.id>4&&("root"==serverinfo.linuxshell&&(n.protocol=1,delete n.requireLogin),"user"==serverinfo.linuxshell&&(n.protocol=8,delete n.requireLogin),"login"==serverinfo.linuxshell&&(n.protocol=1,n.requireLogin=!0)),QV("termarea3xdiv",!0),null!=xterm&&xterm.dispose(),xterm=new Terminal({allowProposedApi:!0}),xtermfit=new FitAddon.FitAddon,xtermimage=new ImageAddon.ImageAddon,xtermfit&&xterm.loadAddon(xtermfit),xterm.loadAddon(xtermimage),xterm.setOption("scrollback",0),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(null,CreateRemoteTunnel(tunnelUpdate,o),serverPublicNamePort,authCookie,null,domainUrl)).debugmode=debugmode,terminal.m.debugmode=debugmode,terminal.options=n,terminal.options={cols:xterm.cols,rows:xterm.rows},n.requireLogin&&(terminal.options.requireLogin=!0),terminal.Start(null),terminal.onStateChanged=onTerminalStateChange,terminal.contype=1,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(){QE("p13Connect",!0),p13setActions()}function onFilesStateChange(e,t){setSessionActivity(),p13Connect.value=0==t?"Подключиться":"Разъединить";var o=StatusStrs[t];switch(1==files.webRtcActive&&(o+=", WebRTC"),Q("p13Status").textContent=o,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:p13filetreelocation=[],p13targetpath="",files&&(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){null==autoConnectFilesTimer?autoConnectFilesTimer=setInterval(connectFiles,100):(clearInterval(autoConnectFilesTimer),autoConnectFilesTimer=null)}function connectFiles(e){p13clearConsoleMsg(),files?(files.Stop(),files=null):((files=CreateAgentRedirect(null,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie,null,domainUrl)).attemptWebRTC=attemptWebRTC,files.onStateChanged=onFilesStateChange,files.onConsoleMessageChange=function(){files.consoleMessage?(Q("p13FilesConsoleMsg").innerHTML+=formatAgentConsoleMessage(files.consoleMessage,files.consoleMessageId,files.consoleMessageArgs),QV("p13FilesConsoleMsg",!0),null!=p13FilesConsoleMsgTimer&&clearTimeout(p13FilesConsoleMsgTimer),files.consoleMessageTimeout&&(p13FilesConsoleMsgTimer=setTimeout(p13clearConsoleMsg,1e3*files.consoleMessageTimeout))):p13clearConsoleMsg()},files.Start(null)),p13clipboard=p13clipboardFolder=null,p13clipboardCut=0,p13updateClipview()}var p13sortorder,p13filetree=null,p13targetpath=null,p13filetreelocation=[];function p13gotFiles(e){if(e.length>0&&123!=e.charCodeAt(0))p13gotDownloadBinaryData(e);else{try{e=JSON.parse(decode_utf8(e))}catch(t){e=JSON.parse(e)}if("download"!=e.action){switch(e.action){case"sshauth":var t="";t+=addHtmlValue("Аутентификация","<select id=dp2authmethod style=width:150px onchange=sshAuthUpdate(event)><option value=1 selected>Имя пользователя и пароль</option><option value=2>Имя пользователя и ключ</option></select>"),t+=addHtmlValue("Имя пользователя","<input id=dp2user style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="<div id=d2passauth>",t+=addHtmlValue("Пароль","<input type=password id=dp2pass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="</div><div id=d2keyauth style=display:none>",t+=addHtmlValue("Ключевой файл","<input type=file id=dp2key style=width:150px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />"),t+=addHtmlValue("Пароль ключа","<input type=password id=dp2keypass style=width:150px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />"),t+="</div>",t+="<label><input id=dp2keep type=checkbox>Запомнить учетные данные</label>",setDialogMode(2,"Аутентификация",11,p13sshConnectEx,t+="<div id=d2keyauth2 style=font-size:x-small><br />Ключевой файл должен быть в формате OpenSSH.</div>","ssh"),setTimeout(sshAuthUpdate,50);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!=e.action&&e.action.startsWith("upload"))p13gotUploadData(e);else if(null!=e.path)if(null==e.dir)""!=p13targetpath&&p13folderup();else if(e.path=e.path.replace(/\//g,"\\"),null!=p13filetree&&e.path==p13filetree.path){var o=p13getCheckedNames();p13filetree=e,p13updateFiles(o)}else{for(var n=e.path.replace(/\//g,"\\"),l=p13targetpath.replace(/\//g,"\\");n.length>0&&"\\"==n[0];)n=n.substring(1);for(;l.length>0&&"\\"==l[0];)l=l.substring(1);(n==l||"\\"==e.path&&""==p13targetpath)&&(p13filetree=e,p13updateFiles())}}else p13gotDownloadCommand(e)}}function p13sshConnectEx(e){if(0==e)null!=files&&connectFiles();else if(1==Q("dp2authmethod").value)files.socket.send(JSON.stringify({action:"sshauth",username:Q("dp2user").value,password:Q("dp2pass").value,keep:Q("dp2keep").checked}));else{var t=new FileReader,o=Q("dp2user").value,n=Q("dp2keypass").value,l=Q("dp2keep").checked;t.onload=function(e){files.socket.send(JSON.stringify({action:"sshauth",username:o,keypass:n,key:e.target.result,keep:l}))},t.readAsText(Q("dp2key").files[0])}}function p13getCheckedNames(){for(var e=[],t=document.getElementsByName("fd"),o=0;o<t.length;o++)t[o].checked&&e.push(p13filetree.dir[t[o].value].n);return e}function p13updateFiles(e){var t="",o="",n="<a style=cursor:pointer;color:black onclick=p13folderup(0)>Root/Корень</a>",l=p13filetree.path.split("\\");for(var s in p13filetreelocation=[],l)""!=l[s]&&p13filetreelocation.push(l[s]);for(var s in p13filetreelocation)n+=" / <a style=cursor:pointer;color:black onclick=p13folderup("+(parseInt(s)+1)+")>"+EscapeHtml(p13filetreelocation[s])+"</a>";var i=p13filetreelocation.join("/"),a=p13sort_files(p13filetree.dir);for(var s in a){var r,d=a[s],u=d.n;r=EscapeHtml(u);var p="";null!=d.s&&(p=getFileSizeStr(d.s));var c="";if(d.t<3){c="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'>&nbsp;<span style=float:right></span><span title=\""+r+'"><div class=fileIcon'+d.t+'></div><a style=cursor:pointer onclick=p13folderset("'+encodeURIComponent(d.nx)+'")>'+r+"</a></span></div>"}else{var f=r;d.s>0&&(f='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p13downloadfile(\''+encodeURIComponent(i+"/"+u)+"','"+encodeURIComponent(u)+"',"+d.s+')">'+r+"</a>"),c="<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'>&nbsp;<span style=float:right;padding-right:4px>"+p+'</span><span title="'+r+'"><div class=fileIcon'+d.t+"></div>"+f+"</span></div>"}d.t<3?t+=c:o+=c}if(QH("p13files",t+o),QH("p13currentpath",n),QE("p13FolderUp",0!=p13filetreelocation.length),null!=e){var m=document.getElementsByName("fd");for(s=0;s<m.length;s++)e.indexOf(p13filetree.dir[m[s].value].n)>=0&&(m[s].checked=!0)}p13setActions()}function p13folderset(e){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[e].n).split("\\").join("/"),files&&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&&files.sendText({action:"ls",reqid:1,path:p13targetpath})}function p13sort_filename(e,t){return e.ln>t.ln?1*p13sortorder:e.ln<t.ln?-1*p13sortorder:0}function p13sort_timestamp(e,t){return e.d>t.d?1*p13sortorder:e.d<t.d?-1*p13sortorder:0}function p13sort_bysize(e,t){return e.s==t.s?p13sort_filename(e,t):(e.s-t.s)*p13sortorder}function p13sort_files(e){var t=[],o=Q("p13sortdropdown").value;for(var n in e)e[n].nx=n,null==e[n].s&&(e[n].s=0),null==e[n].n&&(e[n].n=n),e[n].ln=e[n].n.toLowerCase(),t.push(e[n]);return p13sortorder=1,o>3&&(p13sortorder=-1,o-=3),1==o?t.sort(p13sort_filename):2==o?t.sort(p13sort_bysize):3==o&&t.sort(p13sort_timestamp),t}function p13setActions(){if(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);else{var e=p13getFileSelCount(),t=p13getFileCount(),o=p13getFileSelCount(!1);QE("p13DeleteFileButton",e>0&&(p13filetreelocation.length>0||!1)),QE("p13NewFolderButton",p13filetreelocation.length>0||!1),QE("p13UploadButton",p13filetreelocation.length>0||!1),QE("p13RenameFileButton",1==e&&(p13filetreelocation.length>0||!1)),QE("p13SelectAllButton",t>0),Q("p13SelectAllButton").value=e>0?"Пусто":"Все",QE("p13RefreshButton",!0),QE("p13CutButton",e>0&&e==o&&(p13filetreelocation.length>0||!1)),QE("p13CopyButton",e>0&&e==o&&(p13filetreelocation.length>0||!1)),QE("p13PasteButton",p13filetreelocation.length>0&&(null!=p13clipboard&&p13clipboard.length>0))}}function p13getFileSelCount(e){for(var t=0,o=document.getElementsByName("fd"),n=0;n<o.length;n++)!o[n].checked||0==e&&"3"!=o[n].attributes.file.value||t++;return t}function p13getFileSelDirCount(){for(var e=0,t=document.getElementsByName("fd"),o=0;o<t.length;o++)t[o].checked&&"999"==t[o].attributes.file.value&&e++;return e}function p13getFileCount(){return document.getElementsByName("fd").length}function p13selectallfile(){for(var e=0==p13getFileSelCount(),t=document.getElementsByName("fd"),o=0;o<t.length;o++)t[o].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=p13getFileSelDirCount()>0?"<br /><br /><label><input type=checkbox id=p13recdeleteinput>Рекурсивное удаление</label><br>":"<input type=checkbox id=p13recdeleteinput style='display:none'>";setDialogMode(2,"Удалить",3,p13deletefileEx,e>1?format("Удалить {0} выбранных элементов?",e)+t:"Удалить выбранные элементы?"+t)}function p13deletefileEx(){for(var e=[],t=document.getElementsByName("fd"),o=0;o<t.length;o++)t[o].checked&&e.push(p13filetree.dir[t[o].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"),o=0;o<t.length;o++)t[o].checked&&(e=p13filetree.dir[t[o].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("Редактор файлов","Редактировать можно только файлы размером менее 200КБ.");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 o=0;o<t.length;o++)t[o].checked&&"3"==t[o].attributes.file.value&&p13clipboard.push(p13filetree.dir[t[o].value].n);p13updateClipview()}function p13pasteFile(){var e="";null!=p13clipboard&&p13clipboard.length>0&&(e=0==p13clipboardCut?p13clipboard.length>1?format("Подтвердить копию {0} записей в этом месте?",p13clipboard.length):format("Подтвердить копирование 1 записи в это расположение?"):p13clipboard.length>1?format("Подтвердить перемещение {0} записей в это место?",p13clipboard.length):format("Подтвердить перемещение 1 записи в это расположение?")),setDialogMode(2,"Вставить",3,p13pasteFileEx,e)}function p13pasteFileEx(){files.sendText({action:0==p13clipboardCut?"copy":"move",reqid:1,scpath:p13clipboardFolder,dspath:p13targetpath,names:p13clipboard}),p13folderup(999),1==p13clipboardCut&&(p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0,p13updateClipview())}function p13updateClipview(){var e="";null!=p13clipboard&&p13clipboard.length>0&&(e=0==p13clipboardCut?p13clipboard.length>1?format('Задержано {0} записей для копирования, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Очистить</a>.',p13clipboard.length):format('Задержана 1 запись для копирования, <a href=# onclick="return p13clearClip()" style=cursor:pointer>Очистить</a>.'):p13clipboard.length>1?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 p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0,p13updateClipview(),!1}function updateUploadDialogOk(e){QE("idx_dlgOkButton",""!=Q(e).value)}function getFileSelCount(e){for(var t=0,o=document.getElementsByName("fc"),n=0;n<o.length;n++)!o[n].checked||0==e&&"3"!=o[n].attributes.file.value||t++;return t}function getFileCount(){return document.getElementsByName("fc").length}function p13downloadfile(e,t,o){xxdialogMode||downloadFile||!files||(downloadFile={path:decodeURIComponent(e),file:decodeURIComponent(t),size:o,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="+o+" />"))}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&&(e.length>4&&(downloadFile.tsize+=e.length-4,downloadFile.data+=e.substring(4),Q("d2progressBar").value=downloadFile.tsize),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=[],o=0;for(var n in p13filetree.dir)t.push(p13filetree.dir[n].n.toLowerCase());for(n=0;n<e.length;n++)t.indexOf(e[n].name.toLowerCase())>=0&&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 o=new FileReader;o.onerror=function(e){t(null)},o.onload=function(){window.crypto.subtle.digest("SHA-384",o.result).then(function(e){t(arrayBufferToHex(e))},function(){t(null)})},o.readAsArrayBuffer(e)}function p13uploadNextFile(){if(uploadFile.xfilePtr++,uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var e=uploadFile.xfiles[uploadFile.xfilePtr];if(QH("p13dfileName",e.name),Q("d2progressBar").max=e.size,Q("d2progressBar").value=0,null==e.xdata){uploadFile.xfile=e;var t=null;for(var o in p13filetree.dir)p13filetree.dir[o].n==e.name&&(t=p13filetree.dir[o]);null!=t&&t.s<=uploadFile.xfile.size?performHashOnFile(uploadFile.xfile,function(o){files.sendText(JSON.stringify({action:"uploadhash",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:e.name,tag:{h:o.toUpperCase(),s:t.s,skip:t.s==uploadFile.xfile.size}}))}):files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:e.name,size:uploadFile.xfile.size}))}else uploadFile.xdata=e.xdata,files.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:e.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":uploadFile.xdataPriming=8,p13uploadNextPart(!1);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(null==uploadFile.xreader&&!(uploadFile.xptr>=uploadFile.xfile.size)){var t=uploadFile.xptr+65536;if(t>uploadFile.xfile.size){if(1==e)return;t=uploadFile.xfile.size}uploadFile.xreader=new FileReader,uploadFile.xreader.onerror=function(e){console.log(e)},uploadFile.xreader.onload=function(){var e=uploadFile.xreader.result;if(delete uploadFile.xreader,null!=e){var o=new Uint8Array(e);if(123==o[0]||0==o[0]){var n=new Uint8Array(e.byteLength+1);n.set(o,1),files.send(n)}else files.send(o);uploadFile.xptr=t,Q("d2progressBar").value=t,uploadFile.xptr>=uploadFile.xfile.size?files.sendText(JSON.stringify({action:"uploaddone",reqid:uploadFile.xfilePtr})):uploadFile.xdataPriming>0&&(uploadFile.xdataPriming--,p13uploadNextPart(!0))}},uploadFile.xreader.readAsArrayBuffer(uploadFile.xfile.slice(uploadFile.xptr,t))}}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}}function setDialogMode(e,t,o,n,l,s){setSessionActivity(),xxdialogMode=e,xxdialogFunc=n,xxdialogButtons=o,xxdialogTag=s,QE("idx_dlgOkButton",!0),QV("idx_dlgOkButton",1&o),QV("idx_dlgCancelButton",2&o),QV("id_dialogclose",2&o||8&o),QV("idx_dlgDeleteButton",4&o),QV("idx_dlgButtonBar",7&o),t&&QH("id_dialogtitle",t);for(var i=1;i<24;i++)QV("dialog"+i,i==e);QV("dialog",e),l&&(2==e?QH("id_dialogOptions",l):QH("id_dialogMessage",l))}function dialogclose(e){setSessionActivity();var t=xxdialogFunc,o=xxdialogButtons,n=xxdialogTag;setDialogMode(),(8&o||e)&&t&&t(e,n)}function getNodeAmtVersion(e){if(null==e||null==e.intelamt||"string"!=typeof e.intelamt.ver)return 0;var t=e.intelamt.ver.split(".");return t.length<2?0:parseInt(t[0])+parseInt(t[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 o={},n=0,l=localStorage.length;n<l;++n){var s=localStorage.key(n);"_"!=s[0]&&(o[s]=localStorage.getItem(s))}}function getstore(e,t){try{if("undefined"==typeof localStorage)return t;var o=localStorage.getItem(e);return null==o||null==o?t:o}catch(e){return t}}function center(){xtermfit&&xtermfit.fit(),QS("dialog").left=(getDocWidth()-300)/2+"px",deskAdjust()}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?window.innerWidth:document.documentElement&&document.documentElement.clientWidth&&0!=document.documentElement.clientWidth?document.documentElement.clientWidth: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,o){return o?addLink(e,t):e}function passwordcheck(e){return/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/.test(e)}function getFileSizeStr(e){return"number"!=typeof e&&(e=0),1==e?"1 байт":format("{0} bytes",e)}function focusTextBox(e){setTimeout(function(){Q(e).selectionStart=Q(e).selectionEnd=65535,Q(e).focus()},0)}var isFilenameValid=function(){var e=/^[^\\/:\*\?"<>\|]+$/,t=/^\./,o=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function(n){return e.test(n)&&!t.test(n)&&!o.test(n)&&"."!=n[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 t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,o){return void 0!==t[o]?t[o]: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,o){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){var o=window.open(e,t,"noopener,noreferrer");o&&(o.opener=null)}</script>