"+i.substring(20)),QH("d2optinfo",'Install Google Authenticator or a compatible application, use this link or enter the secret below. Then, enter the current 6 digit token to activate 2-Step login.
'+i+'
Token:
'),QV("idx_dlgOkButton",!0),QE("idx_dlgOkButton",!1),Q("d2otpauthinput").focus()}break;case"otpauth-setup":if(xxdialogMode)return;setDialogMode(2,"Autenticador de aplicativo",1,null,t.success?" ativação de login em duas etapas . Agora você precisará de um token válido para fazer login novamente.":" falha na ativação do login em duas etapas . Limpe o segredo do aplicativo e tente novamente. Você tem apenas alguns minutos para inserir o código correto.");break;case"otpauth-clear":if(xxdialogMode)return;setDialogMode(2,"Autenticador de aplicativo",1,null,t.success?"Ativação de login em duas etapas removida. Você pode reativar esse recurso a qualquer momento.":" falha na remoção da ativação do login em duas etapas . Tente novamente.");break;case"otpauth-getpasswords":if(xxdialogMode)return;var a="Os tokens únicos podem ser usados como autenticação secundária. Gere um conjunto, imprima-os e mantenha-os em um local seguro.";if(a+="
",t.passwords){var s=0;for(var l in t.passwords){++s%2&&(a+="
",a+="",null!=t.passwords&&(a+=""),setDialogMode(2,"Gerenciar códigos de backup",8,null,a+="
","otpauth-manage");break;case"event":if(t.event.noact)break;switch(t.event.action){case"userWebState":if(null!=localStorage){var d=JSON.parse(t.event.state);for(var l in d)localStorage.setItem(l,d[l]);null!=d.loctag&&d.loctag!=oldLoctag&&(null!=d.loctag?args.locale=d.loctag:delete args.locale,updateDevices(),updateMeshes())}break;case"accountchange":if(userinfo.name==t.event.account.name){var p=t.event.account.siteadmin?t.event.account.siteadmin:0,c=userinfo.siteadmin?userinfo.siteadmin:0;(t.event.account.quota!=userinfo.quota||0==(8&userinfo.siteadmin)&&0!=(8&t.event.account.siteadmin))&&meshserver.send({action:"files"}),userinfo=t.event.account,c!=p&&updateSiteAdmin(),updateSelf()}break;case"createmesh":null!=t.event.links[userinfo._id]&&(meshes[t.event.meshid]={_id:t.event.meshid,name:t.event.name,mtype:t.event.mtype,desc:t.event.desc,links:t.event.links},updateMeshes(),updateDevices(),meshserver.send({action:"files"}));break;case"meshchange":if(null==meshes[t.event.meshid])meshes[t.event.meshid]={_id:t.event.meshid,name:t.event.name,mtype:t.event.mtype,desc:t.event.desc,links:t.event.links},meshserver.send({action:"nodes"});else{if(meshes[t.event.meshid].name!=t.event.name)for(var l in meshes[t.event.meshid].name=t.event.name,nodes)nodes[l].meshid==t.event.meshid&&(nodes[l].meshnamel=t.event.name.toLowerCase());if(meshes[t.event.meshid].desc=t.event.desc,meshes[t.event.meshid].links=t.event.links,null==meshes[t.event.meshid].links[userinfo._id]){20==xxcurrentView&¤tMesh==meshes[t.event.meshid]&&go(2),delete meshes[t.event.meshid];var u=[];for(var l in nodes)nodes[l].meshid!=t.event.meshid&&u.push(nodes[l]);nodes=u,10<=xxcurrentView&&xxcurrentView<20&¤tNode&¤tNode.meshid==t.event.meshid&&(setDialogMode(0),go(2))}}updateMeshes(),updateDevices(),meshserver.send({action:"files"}),20==xxcurrentView&¤tMesh._id==t.event.meshid&&p20updateMesh();break;case"deletemesh":meshes[t.event.meshid]&&(delete meshes[t.event.meshid],updateMeshes(),meshserver.send({action:"files"}));u=[];for(var l in nodes)nodes[l].meshid!=t.event.meshid&&u.push(nodes[l]);nodes=u,updateDevices(),20<=xxcurrentView&&xxcurrentView<30&¤tMesh._id==t.event.meshid&&(setDialogMode(0),go(2)),10<=xxcurrentView&&xxcurrentView<20&¤tNode&¤tNode.meshid==t.event.meshid&&(setDialogMode(0),go(2));break;case"addnode":var m=t.event.node;if(!meshes[m.meshid])break;if(null!=getNodeFromId(m._id))break;m.namel=m.name.toLowerCase(),m.rname?m.rnamel=m.rname.toLowerCase():m.rnamel=m.namel,m.meshnamel=meshes[m.meshid].name.toLowerCase(),m.state=0,m.icon||(m.icon=1),m.ident=++nodeShortIdent,nodes.push(m),updateDevices();break;case"removenode":var h=-1;for(var l in nodes)if(nodes[l]._id==t.event.nodeid){h=l;break}if(-1!=h){m=nodes[h];currentNode==m&&(10<=xxcurrentView&&xxcurrentView<20&&(setDialogMode(0),go(2)),currentNode=null),nodes.splice(h,1),updateDevices()}break;case"changenode":h=-1;for(var l in nodes)if(nodes[l]._id==t.event.nodeid){h=l;break}if(-1!=h)(m=nodes[h]).name=t.event.node.name,m.rname=t.event.node.rname,m.host=t.event.node.host,m.desc=t.event.node.desc,m.publicip=t.event.node.publicip,m.iploc=t.event.node.iploc,m.wifiloc=t.event.node.wifiloc,m.gpsloc=t.event.node.gpsloc,m.tags=t.event.node.tags,m.userloc=t.event.node.userloc,null!=t.event.node.agent&&(null==m.agent&&(m.agent={}),null!=t.event.node.agent.ver&&(m.agent.ver=t.event.node.agent.ver),null!=t.event.node.agent.id&&(m.agent.id=t.event.node.agent.id),null!=t.event.node.agent.caps&&(m.agent.caps=t.event.node.agent.caps),null!=t.event.node.agent.core?m.agent.core=t.event.node.agent.core:m.agent.core&&delete m.agent.core,m.agent.tag=t.event.node.agent.tag),null!=t.event.node.intelamt&&(null==m.intelamt&&(m.intelamt={}),null!=t.event.node.intelamt.state&&(m.intelamt.state=t.event.node.intelamt.state),null!=t.event.node.intelamt.host&&(m.intelamt.user=t.event.node.intelamt.host),null!=t.event.node.intelamt.user&&(m.intelamt.user=t.event.node.intelamt.user),null!=t.event.node.intelamt.tls&&(m.intelamt.tls=t.event.node.intelamt.tls),null!=t.event.node.intelamt.ver&&(m.intelamt.ver=t.event.node.intelamt.ver),null!=t.event.node.intelamt.tag&&(m.intelamt.tag=t.event.node.intelamt.tag),null!=t.event.node.intelamt.uuid&&(m.intelamt.uuid=t.event.node.intelamt.uuid),null!=t.event.node.intelamt.realm&&(m.intelamt.realm=t.event.node.intelamt.realm)),m.namel=m.name.toLowerCase(),m.rname?m.rnamel=m.rname.toLowerCase():m.rnamel=m.namel,t.event.node.icon&&(m.icon=t.event.node.icon),refreshDevice(m._id),updateDevices();break;case"nodemeshchange":h=-1;for(var l in nodes)if(nodes[l]._id==t.event.nodeid){h=l;break}if(-1!=h){m=nodes[h];null==meshes[t.event.newMeshId]?(currentNode==m&&(10<=xxcurrentView&&xxcurrentView<20&&(setDialogMode(0),go(2)),currentNode=null),nodes.splice(h,1)):(m.meshid=t.event.newMeshId,m.meshnamel=meshes[t.event.newMeshId].name.toLowerCase()),updateDevices(),refreshDevice(t.event.nodeid)}else{m=t.event.node;if(!meshes[m.meshid])break;m.namel=m.name.toLowerCase(),m.rname?m.rnamel=m.rname.toLowerCase():m.rnamel=m.namel,m.meshnamel=meshes[m.meshid].name.toLowerCase(),m.state=0,m.icon||(m.icon=1),m.ident=++nodeShortIdent,nodes.push(m),updateDevices()}break;case"nodeconnect":h=-1;for(var l in nodes)if(nodes[l]._id==t.event.nodeid){h=l;break}if(-1!=h)(m=nodes[h]).conn=t.event.conn,m.pwr=t.event.pwr,updateDevices();break;case"login":null!=users&&users["user/"+domain+"/"+t.event.username.toLowerCase()]&&(users["user/"+domain+"/"+t.event.username.toLowerCase()].login=t.event.time)}}}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'+e[n].n,o=e[n].n;QH("footerMenu","
"+t)}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,"Autenticador de aplicativo",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"
Carregando...
","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,"Autenticador de aplicativo",3,function(){meshserver.send({action:"otpauth-clear"})},"Confirmar remoção do login do aplicativo autenticador em duas etapas?")}function account_manageOtp(e){2==xxdialogMode&&"otpauth-manage"==xxdialogTag&&dialogclose(0),xxdialogMode||1!=userinfo.otpsecret||0==(4096&features)||meshserver.send({action:"otpauth-getpasswords",subaction:e})}function account_showVerifyEmail(){xxdialogMode||1==userinfo.emailVerified||1!=serverinfo.emailcheck||setDialogMode(2,"verificação de e-mail",3,account_showVerifyEmailEx,"Clique em ok para enviar um email de verificação para:
"+EscapeHtml(userinfo.email)+"
Aguarde alguns minutos para receber a verificação.")}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){xxdialogMode||(setDialogMode(2,"Alteração de endereço de email",3,account_changeEmail,addHtmlValue("Email","")),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(){if(!xxdialogMode){var e=""),account_validateDeleteAccount(),Q("apassword1").focus()}}function account_showChangePassword(){if(xxdialogMode)return!1;var e="
";if(e+="
"+nobreak("Senha Antiga:")+"
",e+="
"+nobreak("Nova senha:")+"
",e+="
"+nobreak("Nova senha:")+"
",65536&features&&(e+="
Dica de senha
"),e+="
",passRequirements){var t=[],o=0;for(var n in passRequirements)"reset"!=n&&"hint"!=n&&(t.push(n+":"+passRequirements[n]),o++);0"+format("Requisitos: {0}.",t.join(", "))+"")}return setDialogMode(2,"Mudar senha",3,account_showChangePasswordEx,e+=" "),Q("apassword0").focus(),account_validateNewPassword(),!1}function account_showChangePasswordEx(){if(Q("apassword1").value==Q("apassword2").value){var e={action:"changepassword",oldpass:Q("apassword0").value,newpass:Q("apassword1").value};65536&features&&(e.hint=Q("apasswordhint").value),meshserver.send(e)}}function account_createMesh(){if(!xxdialogMode)if(4294967295==userinfo.siteadmin||0==(64&userinfo.siteadmin))if(!0===userinfo.emailVerified||1!=serverinfo.emailcheck||4294967295==userinfo.siteadmin)if(!(262144&features)||1==userinfo.otpsecret||0");e+=addHtmlValue("Tipo",""),setDialogMode(2,"Criar grupo de dispositivo",3,account_createMeshEx,e+=addHtmlValue("Descrição","")),account_validateMeshCreate(),Q("dp3meshname").focus()}else setDialogMode(2,"Segurança da Conta",1,null,'Não foi possível acessar um dispositivo até que a autenticação de dois fatores esteja ativada. Isso é necessário para segurança extra. Vá para "Minha conta" e veja a seção "Segurança da conta".');else setDialogMode(2,"Segurança da Conta",1,null,'Não foi possível acessar um dispositivo até que um endereço de email seja verificado. Isso é necessário para a recuperação de senha. Vá para "Minha conta" para alterar e verificar um endereço de email.');else setDialogMode(2,"Novo grupo de dispositivos",1,null,"Esta conta não tem direitos para criar um novo grupo de dispositivos.")}function account_validateMeshCreate(){QE("idx_dlgOkButton",0Strong":60<=o?"●":"●"}else{0==checkPasswordRequirements(Q("apassword1").value,passRequirements)&&(t=!1,e="Política")}QH("dxPassWarn",e),QE("idx_dlgOkButton",t)}function checkPasswordStrength(e){var t=0,o={},n=0,i={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e)return 0;for(var a=0;at.max)return!1;for(var o=0,n=0,i=0,a=0,s=0;s",e+='',e+='
',e+="
"+EscapeHtml(meshes[i].name)+"
"+n+"
",e+="
"}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="",o="",n="Raiz",i="Root",a=filetree,s=1,l=[],r=filetreelinkpath,d=[],p=document.getElementsByName("fc"),c=0;c"+(null!=(a=a.f[filetreelocation[c]]).n?a.n:filetreelocation[c])+"",s++}filetreelocation=l;var m=i.toLowerCase().startsWith("root / "+userinfo._id+" / public"),h=p5sort_files(a.f);for(var c in h){var g,v=h[c],f=v.n;g=40<(g=f).length?EscapeHtml(f.substring(0,40))+"...":EscapeHtml(f),f=EscapeHtml(f);var k="";null!=v.s&&(k=getFileSizeStr(v.s));var x="";if(v.t<3||4==v.t){x="
",deviceHeaderTotal++,void 0===deviceHeaderCount[nodes[a].state]?deviceHeaderCount[nodes[a].state]=1:deviceHeaderCount[nodes[a].state]++}}if(0==sort)for(var a in meshes){var u=meshes[a],m=u.links[userinfo._id];if(null!=m){m.rights;null==i[u._id]&&(""!=o&&""!=e&&(e+=""),e+="
",e+=''+EscapeHtml(u.name)+"
",1==u.mtype&&(e+="
Nenhum Intel® AMT devices in this group"),2==u.mtype&&(e+="
Nenhum dispositivo neste grupo"),e+=".
",o=u._id,n++)}}for(var a in 0==n?QH("xdevices",'
Nenhum dispositivo
Use a versão desktop deste site para adicionar dispositivos.
'):QH("xdevices",e),deviceHeaderSet(),deviceHeaders)QH(a,deviceHeaders[a]);for(var a in deviceHeadersTitles)Q(a).title=deviceHeadersTitles[a]}var powerStatetable=["","Ligado","Hibernar","Hibernar","Hibernar","Hibernando","Desligar","Presente"],powerStateStrings=["","Ligado","Hibernando","Hibernando","Deep Sleep","Hibernando","Soft-Off","Presente"],powerStateStrings2=["","O dispositivo está ligado","O dispositivo está no estado de suspensão (S1)","O dispositivo está no estado de suspensão (S2)","O dispositivo está no estado de sono profundo (S3)","O dispositivo está hibernando (S4)","O dispositivo está no estado soft-off (S5)","O dispositivo está presente, mas o estado de energia não pode ser determinado"],powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];function NodeStateStr(e){var t=[];return 0Agente"),0!=(2&e.conn)?t.push("CIRA"):0!=(4&e.conn)&&t.push("Intel® AMT"),0!=(8&e.conn)&&t.push("Retransmissão"),0!=(16&e.conn)&&t.push("MQTT")),null!=e.pwr&&0!=e.pwr&&t.push(powerStateStrings[e.pwr]),t.join(", ")}function PowerStateStr(e){return et.meshnamel?1:e.meshnamelt.rnamel?1:e.rnamelt.namel?1:e.namelt.rnamel?1:e.rnamelt.namel?1:e.namelt.namel?1:e.namelt.rnamel?1:e.rnamelNenhum"),0!=(4&a)&&(s=""+s+""),QH("p10deviceName",s);var l="
";l+=addDeviceAttribute("Grupo",''+EscapeHtml(meshes[n.meshid].name)+""),null!=n.rname&&(l+=addDeviceAttribute("Nome",""+EscapeHtml(n.rname)+"")),1!=i.mtype&&n.name==n.host||(0!=(4&a)?n.host?l+=addDeviceAttribute("Hostname",""+EscapeHtml(n.host)+""):l+=addDeviceAttribute("Hostname","Nenhum"):l+=addDeviceAttribute("Hostname",EscapeHtml(n.host)));var r=n.desc?EscapeHtml(n.desc):"Nenhum";l+=addDeviceAttribute("Descrição",0!=(4&a)?""+r+"":r);var d=["Desconhecido","Windows 32 Bits console","Windows 64 Bits console","Serviço Windows 32 Bits","Serviço Windows 64 Bits","Linux 32 bits","Linux 64 bits","MIPS","XENx86","Android ARM","Linux ARM","MacOS 32 bits","Android x86","PogoPlug ARM","Android APK","Linux Poky x86-32 bits","MacOS 64 bits","ChromeOS","Linux Poky x86-64 bits","Linux NoKVM x86-32 bits","Linux NoKVM x86-64 bits","Windows MinCore console","Windows MinCore service","NodeJS","ARM-Linaro","ARMv6l / ARMv7l","ARMv8 64bit","ARMv6l / ARMv7l / NoKVM","Desconhecido","Desconhecido","FreeBSD x86-64"];if(null!=n.agent&&null!=n.agent.id&&null!=n.agent.ver){var p="";p=n.agent.id<=d.length?d[n.agent.id]:d[0],0!=n.agent.ver&&(p+=" v"+n.agent.ver),l+=addDeviceAttribute("Agente",p)}if(null!=n.intelamt){p="";var c={0:nobreak("Não ativado (pré)"),1:nobreak("Não ativado (entrada)"),2:nobreak("ativado")};null!=n.intelamt.ver&&null==n.intelamt.state?p+=""+nobreak("Estado desconhecido")+", v"+n.intelamt.ver:null==n.intelamt.ver&&2==n.intelamt.state?p+="ativado":null==n.intelamt.ver||null==n.intelamt.state?p+="Estado da versão desconhecida":(p+=c[n.intelamt.state],n.intelamt.flags&&(2&n.intelamt.flags?p=" CCM":4&n.intelamt.flags&&(p=" ACM")),p+=", v"+n.intelamt.ver),1==n.intelamt.tls&&(p+=", TLS"),2==n.intelamt.state&&(null!=n.intelamt.user&&""!=n.intelamt.user||(p+=0!=(4&a)?', '+nobreak("Sem credenciais")+"":", Sem credenciais"),p+=" ",0!=(4&a)&&(p+=''));var u="Intel® ME";"number"==typeof n.intelamt.sku&&(0!=(8&n.intelamt.sku)?u="Intel® AMT":0!=(16&n.intelamt.sku)&&(u="Intel® SM")),l+=addDeviceAttribute(u,p)}if(null!=n.agent&&null!=n.agent.tag&&"mailto:"!=n.agent.tag){var m=EscapeHtml(n.agent.tag);m.startsWith("mailto:")&&(m=''+m.substring(7)+""),l+=addDeviceAttribute("Etiqueta do agente",m)}var h=n.conn;if(h&&1Agente"),0!=(2&n.conn)?g.push("Intel® AMT CIRA"):0!=(4&n.conn)&&g.push("Intel® AMT"),0!=(8&n.conn)&&g.push("Retransmissão do agente"),0!=(16&n.conn)&&g.push("MQTT"),l+=addDeviceAttribute("Conectividade",g.join(", "))}var v="Nenhum";if(null!=n.tags)for(var f in v="",n.tags)v+=''+n.tags[f]+"";l+=addDeviceAttribute("Tags",0!=(4&a)?""+v+"":v),l+="
",QH("p10html3",l);var k=PowerStateStr(n.state);0!=(1&h)&&(0Mesh Agent"),0!=(2&h)?(0Intel® AMT conectado"):0!=(4&h)&&(0Intel® AMT detectado"),0!=(16&h)&&(0"),k+="Canal MQTT conectado"),QH("MainComputerState",k),QH("MainComputerImage",''),powerTimelineNode!=currentNode._id&&powerTimelineReq!=currentNode._id&&(QH("p10html2",""),powerTimelineReq=currentNode._id,meshserver.send({action:"powertimeline",nodeid:currentNode._id}))}setupDesktop(),go(t=t||10),setupDeviceMenu()}else goBack()}else goBack()}else setDialogMode(2,"Segurança da Conta",1,null,'Não foi possível acessar um dispositivo até que a autenticação de dois fatores esteja ativada. Isso é necessário para segurança extra. Vá para "Minha conta" e veja a seção "Segurança da conta".');else setDialogMode(2,"Segurança da Conta",1,null,'Não foi possível acessar um dispositivo até que um endereço de email seja verificado. Isso é necessário para a recuperação de senha. Vá para "Minha conta" para alterar e verificar um endereço de email.')}function deviceToastFunction(){xxdialogMode||setDialogMode(2,"Brinde do dispositivo",3,deviceToastFunctionEx,"")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function setupDeviceMenu(e,t){var o=0;currentNode&&(o=meshes[currentNode.meshid].links[userinfo._id].rights),null!=e&&(currentDevicePanel=e),QV("p10general",0==currentDevicePanel),QV("p10desktop",1==currentDevicePanel),QV("p10files",2==currentDevicePanel);var n=[];0!=currentDevicePanel&&n.push({n:"General",f:"setupDeviceMenu(0)"}),1!=currentDevicePanel&&null!=currentNode&&(8&o||256&o)&&(1==meshes[currentNode.meshid].mtype&&("number"!=typeof currentNode.intelamt.sku||0!=(8¤tNode.intelamt.sku))||currentNode.agent&&1¤tNode.agent.caps)&&n.push({n:"Desktop",f:"setupDeviceMenu(1)"}),2!=currentDevicePanel&&null!=currentNode&&8&o&&(4294967295==o||0==(1024&o))&&2==currentNode.mtype&&4¤tNode.agent.caps&&n.push({n:"Files",f:"setupDeviceMenu(2)"}),updateFooterMenu(n)}function deviceActionFunction(){if(!xxdialogMode){var e=meshes[currentNode.meshid].links[userinfo._id].rights,t="Selecione uma operação para executar neste dispositivo.
",o=""))}}function deviceActionFunctionEx(){var e=Q("d2deviceop").value;100==e?meshserver.send({action:"wakedevices",nodeids:[currentNode._id]}):meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:e})}function updateDeviceTimeline(){2==meshserver.State&&null!=powerTimelineNode&&null!=powerTimelineUpdate&&null!=currentNode&&powerTimelineNode==powerTimelineReq&¤tNode._id==powerTimelineNode&&powerTimelineUpdatea+1&&(l=e[a+1]),n.push([i,i+l,s]),i+=l}}var r="",d=1,p=new Date,c=Q("masthead").offsetWidth-122;p.setHours(0,0,0,0);for(a=0;a<7;a++){var u="",m=p.getTime(),h=m+864e5;for(var g in n){var v=n[g];if(1==isTimeBlockInside(m,h,v[0],v[1])){var f=Math.max(m,v[0]),k=Math.min(Math.min(h,v[1]),t),x=Math.round((k-f)*c/864e5);0
Confirme",e),p10validateDeleteNodeDialog())}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(e,t){meshserver.send({action:"removedevices",nodeids:[t]})}function p10showiconselector(){if(!xxdialogMode&&0!=(4&meshes[currentNode.meshid].links[userinfo._id].rights)){"",""," ","","","",setDialogMode(2,"Seleção de ícone",0,null,"
"),QV("id_dialogclose",!0)}}function p10setIcon(e){setDialogMode(0),meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:e})}var desktop,desktopNode,showEditNodeValueDialog_modes=["Nome do Dispositivo","Hostname","Descrição","Tags"],showEditNodeValueDialog_modes2=["name","host","desc","tags"],showEditNodeValueDialog_modes3=["","","","Grupo1, Grupo2, Grupo3"];function showEditNodeValueDialog(e){if(!xxdialogMode){setDialogMode(2,"Editar dispositivo",3,showEditNodeValueDialogEx,addHtmlValue(showEditNodeValueDialog_modes[e],'"),e);var t=currentNode[showEditNodeValueDialog_modes2[e]];null==t&&(t=""),Array.isArray(t)&&(t=t.join(", ")),Q("dp10devicevalue").value=t,p10editdevicevalueValidate(),Q("dp10devicevalue").focus()}}function showEditNodeValueDialogEx(e,t){var o={action:"changedevice",nodeid:currentNode._id};o[showEditNodeValueDialog_modes2[t]]=Q("dp10devicevalue").value,meshserver.send(o)}function p10editdevicevalueValidate(e,t){var o=1'),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=meshes[currentNode.meshid],t=0;null!=desktop&&(t=desktop.State);var o=e.links[userinfo._id].rights;QV("disconnectbutton1",0!=t),QV("connectbutton1",0==t&&2==e.mtype&&(8&o||256&o)),QV("connectbutton1h",0==t&&8&o&&(1==e.mtype||null!=currentNode.intelamt&&2==currentNode.intelamt.state&&null!=currentNode.intelamt.ver&&"number"==typeof currentNode.intelamt.sku&&0!=(8¤tNode.intelamt.sku))),QV("d7amtkvm",!(null==currentNode.intelamt||null==currentNode.intelamt.ver&&1!=e.mtype||0!=t&&2!=desktop.contype)),QV("d7meshkvm",2==e.mtype&&(0==t||1==desktop.contype));var n=0!=(1¤tNode.conn);QE("connectbutton1",n);var i=0!=(6¤tNode.conn);QE("connectbutton1h",i),QV("DeskToastButton",0!=(16384&o)&¤tNode.agent&¤tNode.agent.id<5&&8&o),QV("deskActionsBtn",8&o),Q("DeskControl").checked=0!=(8&o),0==n&&QV("DeskTools",!1)}function connectDesktop(e,t){if(setSessionActivity(),null==desktop)if(desktopNode=currentNode,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.bpp=1==desktopsettings.encoding||3==desktopsettings.encoding?1:2,desktop.m.useZRLE=desktopsettings.encoding<3,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=deskAdjust,desktop.Start(desktopNode._id,16994,"*","*",0),desktop.contype=2}else(desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie,authRelayCookie,domainUrl)).debugmode=debugmode,desktop.m.debugmode=debugmode,desktop.attemptWebRTC=attemptWebRTC,desktop.onStateChanged=onDesktopStateChange,desktop.m.CompressionLevel=desktopsettings.quality,desktop.m.ScalingLevel=desktopsettings.scaling,desktop.m.FrameRateTimer=desktopsettings.framerate,desktop.m.onDisplayinfo=deskDisplayInfo,desktop.m.onScreenSizeChange=deskAdjust,desktop.Start(desktopNode._id),desktop.contype=1;else desktop.Stop(),desktopNode=desktop=null}function onDesktopStateChange(e,t){var o=t;3==o&&2==e.contype&&o++;var n=StatusStrs[o];switch(null!=desktop&&1==desktop.webRtcActive&&(n+=", WebRTC"),QH("deskstatus",n),t){case 0:desktop.Stop(),desktopNode=desktop=null,QV("termdisplays",!1),1==fullscreen&&deskToggleFull()}updateDesktopButtons(),deskAdjust(),setTimeout(deskAdjust,50)}function showDesktopSettings(){xxdialogMode||(applyDesktopSettings(),updateDesktopButtons(),setDialogMode(7,"Configurações da área de trabalho remota",3,showDesktopSettingsChanged))}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value,desktopsettings.showfocus=d7showfocus.checked,desktopsettings.showmouse=d7showcursor.checked,desktopsettings.quality=d7bitmapquality.value,desktopsettings.scaling=d7bitmapscaling.value,desktopsettings.framerate=d7framelimiter.value,localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings)),applyDesktopSettings(),desktop&&(1==desktop.contype&&0!=desktop.State&&desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate),2==desktop.contype&&0!=desktop.State&&(desktop.Stop(),setTimeout(function(){connectDesktop(null,2)},50)))}function applyDesktopSettings(){var e="",t=512&features?[90,70,50,40,30,20,10,5,1]:[50,40,30,20,10,5,1];for(var o in t)e+="";QH("d7bitmapquality",e),d7desktopmode.value=desktopsettings.encoding,d7showfocus.checked=desktopsettings.showfocus,d7showcursor.checked=desktopsettings.showmouse,d7bitmapquality.value=40,0<=t.indexOf(parseInt(desktopsettings.quality))&&(d7bitmapquality.value=desktopsettings.quality),d7bitmapscaling.value=desktopsettings.scaling,desktopsettings.framerate&&(d7framelimiter.value=desktopsettings.framerate)}var fullscreen=!1;function deskAdjust(){var e=(Q("DeskParent").clientHeight-Q("Desk").clientHeight)/2;if(e<0){var t=Q("DeskParent").clientHeight,o=9999;desktop&&(o=desktop.m.width/desktop.m.height*t),QS("Desk")["max-height"]=t+"px",QS("Desk")["max-width"]=o+"px",e=0}else QS("Desk")["max-height"]=null,QS("Desk")["max-width"]=null;QS("Desk")["margin-top"]=e+"px",QS("Desk")["margin-bottom"]=e+"px"}function deskSendKeys(){if(!xxdialogMode&&null!=desktop&&3==desktop.State){var e=Q("deskkeys").value;0==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65364,1],[65364,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,40],[desktop.m.KeyAction.UP,40],[desktop.m.KeyAction.EXUP,91]]):1==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65362,1],[65362,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,38],[desktop.m.KeyAction.UP,38],[desktop.m.KeyAction.EXUP,91]]):2==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[108,1],[108,0],[65511,0]]):desktop.sendCtrlMsg('{"action":"lock"}'):3==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[109,1],[109,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91]]):4==e?2==desktop.contype?desktop.m.sendkey([[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.DOWN,16],[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91],[desktop.m.KeyAction.UP,16]]):5==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.EXUP,91]]):6==e?2==desktop.contype?desktop.m.sendkey([[65511,1],[114,1],[114,0],[65511,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,82],[desktop.m.KeyAction.UP,82],[desktop.m.KeyAction.EXUP,91]]):7==e?2==desktop.contype?desktop.m.sendkey([[65513,1],[65473,1],[65473,0],[65513,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,18],[desktop.m.KeyAction.DOWN,115],[desktop.m.KeyAction.UP,115],[desktop.m.KeyAction.EXUP,18]]):8==e?2==desktop.contype?desktop.m.sendkey([[65507,1],[119,1],[119,0],[65507,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,17],[desktop.m.KeyAction.DOWN,87],[desktop.m.KeyAction.UP,87],[desktop.m.KeyAction.EXUP,17]]):9==e?2==desktop.contype?desktop.m.sendkey([[65513,1],[65289,1],[65289,0],[65513,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,18],[desktop.m.KeyAction.DOWN,9],[desktop.m.KeyAction.UP,9],[desktop.m.KeyAction.EXUP,18]]):10==e?desktop.m.sendcad():11==e&&(2==desktop.contype?desktop.m.sendkey([[65289,1],[65289,0]]):desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.DOWN,9],[desktop.m.KeyAction.UP,9]]))}}function sendSpecialKeys(){xxdialogMode||null==desktop||3!=desktop.State||setDialogMode(3,"Chaves especiais",3,deskSendKeys)}function toggleSoftKeys(e){QV("DeskSoftInput",1==e),1==e&&Q("DeskSoftInput").focus()}function toggleDeskTools(){setSessionActivity(),xxdialogMode||("none"==QS("DeskTools").display?(QV("DeskTools",!0),Q("DeskTools").nodeid=currentNode._id,refreshDeskTools()):QV("DeskTools",!1))}function refreshDeskTools(){setSessionActivity(),QV("DeskToolsRefreshButton",!1),setTimeout(refreshDeskToolsEx,500),meshserver.send({action:"msg",type:"ps",nodeid:currentNode._id})}function refreshDeskToolsEx(){QV("DeskToolsRefreshButton",!0)}var filesNode,deskTools={sort:1,msg:null};function sortProcess(e){deskTools.sort=e,showDeskToolsProcesses(deskTools.msg)}function sortProcessPid(e,t){return e.p>t.p?1:e.pt.d?1:e.d
"+t[a].p+"
'+(t[a].u?t[a].u:"")+"
"+t[a].c+"
");QH("DeskToolsProcesses",i)}}}else QH("DeskToolsProcesses","")}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+".jpg")})}}function deskDisplayInfo(e,t,o,n){var i=Q("termdisplays").value;if(0"+t[s]+"";QH("termdisplays",a)}QV("termdisplays",0Raiz",i=p13filetree.path.split("\\");for(var a in p13filetreelocation=[],i)""!=i[a]&&p13filetreelocation.push(i[a]);for(var a in p13filetreelocation)n+=" / "+p13filetreelocation[a]+"";var s=p13filetreelocation.join("/"),l=p13sort_files(p13filetree.dir);for(var a in l){var r,d=l[a],p=d.n;r=70<(r=p).length?EscapeHtml(p.substring(0,70))+"...":EscapeHtml(p),p=EscapeHtml(p);var c="";null!=d.s&&(c=getFileSizeStr(d.s));var u="";if(d.t<3){u="
';var i=1,a=[];for(var s in currentMesh.links)a.push({id:s,name:s.split("/")[2],rights:currentMesh.links[s].rights});for(var s in a.sort(function(e,t){return e.name>t.name?1:e.name'),o+='
"),QH("p20info",o)}}function p20showDeleteMeshDialog(){if(xxdialogMode)return!1;var e=format("Tem certeza de que deseja excluir o grupo {0}? A exclusão do grupo de dispositivos também excluirá todas as informações sobre os dispositivos desse grupo.",EscapeHtml(currentMesh.name))+"
";return setDialogMode(2,"Excluir grupo",3,p20showDeleteMeshDialogEx,e+=""),p20validateDeleteMeshDialog(),!1}function p20validateDeleteMeshDialog(){QE("idx_dlgOkButton",Q("p20check").checked)}function p20showDeleteMeshDialogEx(e,t){meshserver.send({action:"deletemesh",meshid:currentMesh._id,meshname:currentMesh.name})}function p20editmesh(e){if(!xxdialogMode){var t=addHtmlValue("Nome","");setDialogMode(2,"Editar grupo de dispositivos",3,p20editmeshEx,t+=addHtmlValue("Descrição","")),Q("dp20meshname").value=currentMesh.name,currentMesh.desc&&(Q("dp20meshdesc").value=currentMesh.desc),p20editmeshValidate(),2==e?Q("dp20meshdesc").focus():Q("dp20meshname").focus()}}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(){QE("idx_dlgOkButton",0");e+='
"),p20validateAddMeshUserDialog(),Q("dp20username").focus()}}function p20validateAddMeshUserDialog(){var e=currentMesh.links[userinfo._id].rights,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)}function p20showAddMeshUserDialogEx(){var e=0;1==Q("p20fulladmin").checked?e=4294967295:(1==Q("p20editmesh").checked&&(e+=1),1==Q("p20manageusers").checked&&(e+=2),1==Q("p20managecomputers").checked&&(e+=4),1==Q("p20remotecontrol").checked&&(e+=8),1==Q("p20meshagentconsole").checked&&(e+=16),1==Q("p20meshserverfiles").checked&&(e+=32),1==Q("p20wakedevices").checked&&(e+=64),1==Q("p20editnotes").checked&&(e+=128),1==Q("p20remoteview").checked&&(e+=256),1==Q("p20noterminal").checked&&(e+=512),1==Q("p20nofiles").checked&&(e+=1024),1==Q("p20noamt").checked&&(e+=2048),1==Q("p20remotelimitedinput").checked&&(e+=4096),1==Q("p20limitevents").checked&&(e+=8192),1==Q("p20chatnotify").checked&&(e+=16384),1==Q("p20uninstall").checked&&(e+=32768));var t=Q("dp20username").value.split(","),o=[];for(var n in t)o.push(t[n].trim());meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,usernames:o,meshadmin:e})}function p20viewuser(e){if(!xxdialogMode){e=decodeURIComponent(e);var t=[],o=currentMesh.links[userinfo._id].rights,n=currentMesh.links[e].rights;4294967295==n?t.push("Administrador completo"):(0!=(1&n)&&t.push("Editar grupo de dispositivos"),0!=(2&n)&&t.push("Gerenciar usuários do grupo de dispositivos"),0!=(4&n)&&t.push("Gerenciar computadores do grupo de dispositivos"),0!=(8&n)&&t.push("Controle remoto"),0!=(16&n)&&t.push("Console do agente"),0!=(32&n)&&t.push("Arquivos do servidor"),0!=(64&n)&&t.push("Reativar dispositivo"),0!=(128&n)&&t.push("Editar notas"),0!=(256&n)&&t.push("Somente visualização remota"),0!=(512&n)&&t.push("Sem terminal"),0!=(1024&n)&&t.push("Sem arquivos"),0!=(2048&n)&&t.push("Nenhum Intel® AMT"),0!=(8&n)&&0!=(4096&n)&&0==(256&n)&&t.push("Entrada limitada"),0!=(8192&n)&&t.push("Somente Eventos Próprios"),0!=(16384&n)&&t.push("Chat & Notificação"),0!=(32768&n)&&t.push("Uninstall")),0==t.length&&t.push("Sem direitos");var i=1,a=addHtmlValue("Do utilizador",EscapeHtml(decodeURIComponent(e.split("/")[2])));a+=addHtmlValue("Permissões",t.join(",")),userinfo._id!=e&&(4294967295==o||0!=(2&o)&&4294967295!=n)&&(i+=4),setDialogMode(2,"Usuário do grupo de dispositivos",i,p20viewuserEx,a,e)}}function p20viewuserEx(e,t){2==e&&setDialogMode(2,"Usuário de malha remota",3,p20viewuserEx2,format("Confirmar remoção do usuário {0}?",t.split("/")[2]),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 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,i,a){setSessionActivity(),xxdialogMode=e,xxdialogFunc=n,xxdialogButtons=o,xxdialogTag=a,QE("idx_dlgOkButton",!0),QV("idx_dlgOkButton",1&o),QV("idx_dlgCancelButton",2&o),QV("id_dialogclose",2&o||8&o),QV("idx_dlgButtonBar",7&o),t&&QH("id_dialogtitle",t);for(var s=1;s<24;s++)QV("dialog"+s,s==e);QV("dialog",e),i&&(2==e?QH("id_dialogOptions",i):QH("id_dialogMessage",i))}function dialogclose(e){setSessionActivity();var t=xxdialogFunc,o=xxdialogButtons,n=xxdialogTag;setDialogMode(),(8&o||e)&&t&&t(e,n)}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,i=localStorage.length;n()\[\]\\.,;:\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"