";deviceHeaderTotal++;if(typeof deviceHeaderCount[nodes[j].state]=="undefined"){deviceHeaderCount[nodes[j].state]=1}else{deviceHeaderCount[nodes[j].state]++}}if(sort==0){for(var j in meshes){var l=meshes[j],n=l.links["user/{{{domain}}}/"+userinfo.name.toLowerCase()];if(n!=null){var p=n.rights;if(e[l._id]==null){if((d!="")&&(t!="")){t+=""}t+="
";t+=''+EscapeHtml(l.name)+"
";if(l.mtype==1){t+="
No Intel® AMT devices in this mesh"}if(l.mtype==2){t+="
No devices in this mesh"}t+=".
";d=l._id;b++}}}}QH("xdevices",t);deviceHeaderSet();for(var j in deviceHeaders){QH(j,deviceHeaders[j])}for(var j in deviceHeadersTitles){Q(j).title=deviceHeadersTitles[j]}}var powerStatetable=["","Powered","Sleep","Sleep","Sleep","Hibernating","Power off","Present"];var powerStateStrings=["",'Powered','Sleeping','Sleeping','Deep Sleep','Hibernating','Soft-Off','Present'];var powerStateStrings2=["","Device is powered","Device is in sleep state (S1)","Device is in sleep state (S2)","Device is in deep sleep state (S3)","Device is hibernating (S4)","Device is in soft-off state (S5)","Device is present, but power state cannot be determined"];var powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];function NodeStateStr(a){var b=[];if(a.state>0&&a.stateAgent')}if((a.conn&2)!=0){b.push('CIRA')}if((a.conn&4)!=0){b.push('Intel® AMT')}if((a.conn&8)!=0){b.push('Relay')}}if((a.pwr!=null)&&(a.pwr!=0)){b.push(powerStateStrings[a.pwr])}return b.join(", ")}function PowerStateStr(a){if(a0){a+=", "}a+=deviceHeaderCount[x]+" "+PowerStateStr2(x)}deviceHeadersTitles["DevxHeader"+deviceHeaderId]=a;deviceHeaderId++;deviceHeaderCount={};deviceHeaderTotal=0}function meshSort(c,d){if(c.meshnamel>d.meshnamel){return 1}if(c.meshnameld.rnamel){return 1}if(c.rnameld.namel){return 1}if(c.namele.rnamel){return 1}if(c.rnamele.namel){return 1}if(c.namelf){return 1}if(dd.namel){return 1}if(c.nameld.rnamel){return 1}if(c.rnamelNone"}if((h&4)!=0){j=""+j+""}QH("p10deviceName",j);var r="
";QH("p10html3",r);powerstate=PowerStateStr(k.state);if((b&1)!=0){if(powerstate.length>0){powerstate+=", "}powerstate+='Mesh Agent'}if((b&2)!=0){if(powerstate.length>0){powerstate+=", "}powerstate+='Intel® AMT connected'}else{if((b&4)!=0){if(powerstate.length>0){powerstate+=", "}powerstate+='Intel® AMT detected'}}QH("MainComputerState",powerstate);QH("MainComputerImage",'');if((powerTimelineNode!=currentNode._id)&&(powerTimelineReq!=currentNode._id)){QH("p10html2","");powerTimelineReq=currentNode._id;meshserver.send({action:"powertimeline",nodeid:currentNode._id})}}setupDesktop();if(!m){m=10}go(m);setupDeviceMenu()}function deviceToastFunction(){if(xxdialogMode){return}setDialogMode(2,"Device Toast",3,deviceToastFunctionEx,"")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function setupDeviceMenu(c,b){if(c!=null){currentDevicePanel=c}QV("p10general",currentDevicePanel==0);QV("p10desktop",currentDevicePanel==1);QV("p10files",currentDevicePanel==2);var a=[];if(currentDevicePanel!=0){a.push({n:"General",f:"setupDeviceMenu(0)"})}if(currentDevicePanel!=1){a.push({n:"Desktop",f:"setupDeviceMenu(1)"})}if((currentDevicePanel!=2)&&((currentNode!=null)&&(currentNode.mtype==2))){a.push({n:"Files",f:"setupDeviceMenu(2)"})}updateFooterMenu(a)}function deviceActionFunction(){if(xxdialogMode){return}var a=meshes[currentNode.meshid].links["user/{{{domain}}}/"+userinfo.name.toLowerCase()].rights;var b="Select an operation to perform on this device.
";var c="";b+=addHtmlValue("Operation",c);setDialogMode(2,"Device Action",3,deviceActionFunctionEx,b)}function deviceActionFunctionEx(){var a=Q("d2deviceop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:[currentNode._id]})}else{meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:a})}}function updateDeviceTimeline(){if((meshserver.State!=2)||(powerTimelineNode==null)||(powerTimelineUpdate==null)||(currentNode==null)){return}if((powerTimelineNode==powerTimelineReq)&&(currentNode._id==powerTimelineNode)&&(powerTimelineUpdate1){s.push([0,r[1],r[0]]);var c=r[1];for(var l=2;l(l+1)){h=r[l+1]}s.push([c,c+h,o]);c=c+h}}var z="",b=1,g=new Date();var v=Q("masthead").offsetWidth-(90+9+9+14);g.setHours(0,0,0,0);for(var l=0;l<7;l++){var f="",p=g.getTime(),k=p+(1000*60*60*24);for(var m in s){var a=s[m];if(isTimeBlockInside(p,k,a[0],a[1])==true){var w=Math.max(p,a[0]);var q=Math.min(Math.min(k,a[1]),n);var y=Math.round(((q-w)*v)/86400000);if(y>0){var u=powerStateStrings2[a[2]]+" from "+new Date(w).toLocaleTimeString()+" to "+new Date(q).toLocaleTimeString()+".";f+='"}}}z+="
';var a=1,h=[];for(var c in currentMesh.links){h.push({id:c,name:c.split("/")[2],rights:currentMesh.links[c].rights})}h.sort(function(l,m){if(l.name>m.name){return 1}if(l.name'}k+='
"}QH("p20info",k)}function p20showDeleteMeshDialog(){if(xxdialogMode){return}var a='Are you sure you want to delete mesh "'+EscapeHtml(currentMesh.name)+'"? Deleting the mesh will also delete all information about computers within this mesh.