"+e),void Y(e)}if(!n.status||!n.cmd||!n.data)return X("Wrong version of webUI"),void Y(e);if(n=n.data,n.FWVersion){{let e=document.getElementById("verLink");e.innerHTML="v"+n.FWVersion,e.addEventListener("click",(function(){let e=new URL("http://"+window.location.host+"/config");window.open(e,"_blank")}))}if(document.getElementById("espLink").addEventListener("click",(function(){let e=new URL("http://"+window.location.host);window.open(e)})),t.classList.remove("hide"),(n.FlashFileSystem&&"none"!=n.FlashFileSystem||n.SDConnection&&"none"!=n.SDConnection)&&(r.classList.remove("hide"),n.FlashFileSystem&&"none"==n.FlashFileSystem&&(D="/sdfiles")),"Enabled"==n.WebUpdate&&o.classList.remove("hide"),W=n.HostPath,n.WiFiMode&&n.WebSocketIP&&function(e){let t=["clients3.google.com","connectivitycheck.","apple.com",".akamaitechnologies.com","www.appleiphonecell.com","www.itools.info","www.ibook.info","www.airport.us","www.thinkdifferent.us",".akamaiedge.net",".msftncsi.com","microsoft.com"];if("AP"!=e)return!1;for(let e=0;e please open a browser using "+e+" to get all features working",w.innerHTML=i,w.className="text-error"}var i;n.Hostname&&(document.title=n.Hostname),function e(n,i,a){S&&b.close();b=new WebSocket("ws://"+n+":"+i+("Asynchronous"==a?"/ws":""),["webui-v3"]),b.binaryType="arraybuffer",b.onopen=function(e){S=!0},b.onclose=function(t){S=!1,T||setTimeout(()=>{e(n,i,a)},3e3)},b.onerror=function(e){X("Error: websocket error! "),console.log("Error: websocket error!")},b.onmessage=function(e){let n="";if(e.data instanceof ArrayBuffer){let t=new Uint8Array(e.data);for(let e=0;e=2&&("currentID"==i[0]&&(O=i[1]),"activeID"==i[0]&&O!=i[1]&&(T=!0,b.close(),$("
It seems you are connect from another location, you are now disconnected."),document.title=document.title+"(disconnected)",t.classList.add("hide"),o.classList.add("hide"),r.classList.add("hide"),document.getElementById("verLink").classList.add("disabled"),F.classList.add("hide"),U="",document.getElementById("loginInput").value="",document.getElementById("passwordInput").value="",document.cookie=""),"ERROR"==i[0]&&(j.abort(),J(i[2],i[1])))}}}(n.WebSocketIP,n.WebSocketPort,n.WebCommunication),Q("list","all")}else X("Error: json data are incorrect! "+JSON.stringify(n,null," "))}function J(e,t){let n="Upload failed";if(0!=t&&void 0!==t&&(n=e+"("+t+")"),alert(n+"!"),1==C){let e=c.innerHTML;e.length>0?c.innerHTML="Status: "+n+"  "+e.substring(e.indexOf("|")):c.innerHTML=n}else 2==C&&(prgupdatetext.innerHTML=n)}function X(e){v.innerHTML=e,v.className="text-error"}function $(e){v.innerHTML=e,v.className="text-primary"}function K(){let e=new URL("http://"+window.location.host+"/command");e.searchParams.append("cmd","[ESP800]json=YES version=3.0.0.a6 time="+function(){let e=new Date;return e.getFullYear()+"-"+N(e.getMonth()+1,2)+"-"+N(e.getDate(),2)+"T"+N(e.getHours(),2)+":"+N(e.getMinutes(),2)+":"+N(e.getSeconds(),2)}()),ne(e,q)}function Q(e,t){let n=new URL("http://"+window.location.host+D);n.searchParams.append("action",e),n.searchParams.append("filename",t),n.searchParams.append("path",A),ne(n,te)}function Z(e=!1){return""}function ee(e=!1){return""}function te(e){let t,n=[],r=!1;try{t=JSON.parse(e),c.innerHTML="Status: "+t.status+" | Total space: "+t.total+" | Used space: "+t.used+" | Occupation: "+t.occupation+"%",t.files.sort((function(e,t){return function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),et?1:0}(e.name,t.name)}));let o="";if(document.getElementById("path").innerHTML=A,"/"!=A){let e,t=A.lastIndexOf("/");e=0==t?"/":A.substring(0,t),console.log("newpath:"+e),o+="