mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-07-29 15:42:06 +08:00

Add Time Support (server + manual setup), only used for ESP32 FS currently as ESP8266 SPIFFS does not support Time, need to wait for LittleFS may be ? Add DHT support Add Pin reset support Add Base for Display Add libraries for new supported features Add /config handle as shortcut for [ESP420]plain to be used in embedded page Code refactoring for defines, use less Define as switches but more define as values for switches Clean warnings Lot of small bug fixes Add docs for [ESPXXX] commands
1 line
22 KiB
HTML
1 line
22 KiB
HTML
<html><head><style>html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:10px}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}table{border:0;border-spacing:0;max-width:100%}.table-bordered{width:100%;border:1px solid #ddd;margin-bottom:20px}td{white-space:nowrap;padding:2mm}th{text-align:left}.table>tbody>tr>td,.table>tbody>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.nav{width:100%;color:#ccc;padding-left:10;padding-right:10;list-style:none;background-color:#333;border-radius:6px;margin-bottom:20px}a{position:relative;display:block;padding:10px 15px;text-decoration:none;color:#ccc}.active{color:#fff;background-color:#000}.active a,a:focus,a:hover{color:#fff}.panel{margin-bottom:20px;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;color:#333;background-color:#f5f5f5;border-color:#ddd;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:1px solid #ddd}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.text-info{color:#31708f}.form-control{display:block;width:auto;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-group{margin-bottom:15px}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.active,.btn-primary.focus,.btn-primary.hover,.btn-primary:active,.btn-primary:focus,.btn-primary:hover{color:#fff;background-color:#286090;border-color:#122b40}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey}.has-error .control-label{color:#a94442}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .control-label{color:#3c763d}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.active,.btn-danger.focus,.btn-danger.hover,.btn-danger:active,.btn-danger:focus,.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#761c19}.btnimg{cursor:hand;border-radius:6px;border:1px solid #fff}.btnimg:hover{background-color:#f0f0f0;border-color:#6c6c6c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey}.btnroundimg{cursor:hand;border-radius:30px}.btnroundimg:hover{background-color:#f0f0f0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px grey}.blacklink,.blacklink:active{color:#000}.blacklink:hover,.filelink:focus{color:#000}input[type=file]::-webkit-file-upload-button{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#fff;background-color:#5bc0de;border-color:#46b8da}input[type=file]::-webkit-file-upload-button:focus{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#fff;background-color:#31b0d5;border-color:#1b6d85}input[type=file]::-webkit-file-upload-button:hover{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#fff;background-color:#31b0d5;border-color:#269abc}.filelink{color:#000}.filelink:focus,.filelink:hover{color:#0094ff}.panel-footer{padding:10px 15px;color:#31708f;background-color:#f5f5f5;border-color:#ddd;border-top:1px solid #ddd}.loader{border:4px solid #f3f3f3;border-top:4px solid #3498db;border-radius:50%;width:12px;height:12px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.panel-footer{padding:10px 15px;color:#31708f;background-color:#f5f5f5;border-color:#ddd;border-top:1px solid #ddd}.modal{display:none;position:fixed;z-index:10000;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4)}.modal-content{border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-left-radius:10px;border-bottom-right-radius:10px;border:2px solid #337ab7;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);position:relative;margin:auto;padding:0;background-color:#fefefe}.modal-header{padding:2px 16px;color:#0f0f0f;background-color:#f2f2f2;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom:1px solid #cfcfcf}.modal-body{padding:10px 16px}.modal-footer{padding:16px 16px;height:4.5em;color:#0f0f0f;background-color:#f2f2f2;border-top:1px solid #cfcfcf;border-bottom-left-radius:10px;border-bottom-right-radius:10px}.hide_it{display:none}@media (min-width:768px){.modal-content{width:580px}}@media screen and (max-width:767px){.modal-content{width:100%}}</style><title>ESP3D tool page</title></head><body><div class="panel"><table width="100%"><tr><td><a class="btnimg" href="https://www.github.com/luc-github/ESP3D/tree/3.0" target="_blank"><svg width="1em" height="1em" viewBox="0 0 1300 1200"><g transform="translate(50,1200) scale(1, -1)"><path d="M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z"></path></g></svg> <span class="blacklink">Firmware</span></a></td><td><a class="btnimg" href="https://www.github.com/luc-github/ESP3D-WEBUI/tree/3.0" target="_blank"><svg width="1em" height="1em" viewBox="0 0 1300 1200"><g transform="translate(50,1200) scale(1, -1)"><path d="M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z"></path></g></svg> <span class="blacklink">Interface</span></a></td><td style="width:100%;text-align:right"><span class="hide_it" id="FWVERSION">???</span></td></tr></table></div><div class="panel"><center><h2 class="hide_it" id="MSG">It seems you do not have any index.html neither index.html.gz</h2></center></div><div class="panel hide_it" id="FILESYSTEM"><div class="panel-heading">Flash Filesystem</div><div class="panel-body"><input type="file" id="file-select" name="myfiles[]" multiple="multiple"> <input class="btn btn-primary" type="button" id="upload-button" onclick="Sendfile();" value="Upload"> <progress style="visibility:hidden" name="prg" id="prg" max="100"></progress><br><br><div class="panel"><div class="panel-body"><table><tr><td width="0%"><input class="btn btn-primary" type="button" onclick="SendCommand('list','all');" value="Refresh"></td><td width="0%"><div onclick="Createdir()" class="btnimg"><svg width="40" height="40" viewBox="0 0 40 40"><rect x="5" y="10" width="30" height="20" rx="2" ry="2" fill="#31b0d5"/><rect x="20" y="5" width="15" height="15" rx="2" ry="2" fill="#31b0d5"/><text x="15" y="25" font-size="18" font-weight="800" fill="white">+</text></svg></div></td><td><div id="loader" class="loader"></div></td><td width="100%"><div id="path" class="info"> </div></td></tr></table><table class="table table-striped" style="border:1px"><thead><tr><th width="0%">Type</th><th>Name</th><th>Size</th><th width="0%"></th><th width="100%"></th></tr></thead><tbody id="file_list"></tbody></table></div><div class="panel-footer" id="status"></div></div></div></div><div class="panel hide_it" id="FWUPDATE"><div class="panel-heading">Firmware Update</div><div class="panel-body"><table><tr><td><input type="file" id="fw-select" name="myfiles[]"></td><td><input class="btn btn-primary" type="button" id="uploadfw-button" onclick="Uploadfile();" value="Update"></td><td><progress style="visibility:hidden" name="prgfw" id="prgfw" max="100"></progress></td><td><span id="msg" style="visibility:hidden">Restarting, please wait....</span><span id="counter"></span></td></tr></table></div></div><div id="loginpage" class="modal"><div class="modal-content"><div class="modal-header"><h3>Identification</h3></div><div class="modal-body"><span><span class="modal-text" translate>User:</span> <input class="form-control" type="text" id="login_user_text" style="width:auto"></span><hr><span><span class="modal-text" translate>Password:</span> <input class="form-control" type="password" id="login_password_text" style="width:auto"></span><br></div><div class="modal-footer"><input type="button" class="btn btn-primary" onclick="SubmitRequest()" value="Submit"></div></div></div><script>var currentpath="/",authentication=!1,webupdate=!1,filesystem=!1;function navbar(){var e="<table><tr>",t=currentpath.split("/"),n="/",i=1;for(e+="<td class='btnimg' onclick=\"currentpath='/'; SendCommand('list','all');\">/</td>";i<t.length-1;)e+="<td class='btnimg' onclick=\"currentpath='"+(n+=t[i]+"/")+"'; SendCommand('list','all');\">"+t[i]+"</td><td>/</td>",i++;return e+="</tr></table>"}function trash_icon(){return"<rect x='52' y='12' rx='6' ry='6' width='25' height='7' style='fill:red;' />","<rect x='52' y='16' width='25' height='2' style='fill:white;' />","<rect x='30' y='18' rx='6' ry='6' width='67' height='100' style='fill:red;' />","<rect x='20' y='18' rx='10' ry='10' width='87' height='14' style='fill:red;' />","<rect x='20' y='29' width='87' height='3' style='fill:white;' />","<rect x='40' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' />","<rect x='60' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' />","<rect x='80' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' /></svg>","<svg width='24' height='24' viewBox='0 0 128 128'><rect x='52' y='12' rx='6' ry='6' width='25' height='7' style='fill:red;' /><rect x='52' y='16' width='25' height='2' style='fill:white;' /><rect x='30' y='18' rx='6' ry='6' width='67' height='100' style='fill:red;' /><rect x='20' y='18' rx='10' ry='10' width='87' height='14' style='fill:red;' /><rect x='20' y='29' width='87' height='3' style='fill:white;' /><rect x='40' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' /><rect x='60' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' /><rect x='80' y='43' rx='7' ry='7' width='7' height='63' style='fill:white;' /></svg>"}function back_icon(){return"<svg width='24' height='24' viewBox='0 0 24 24'><path d='M7,3 L2,8 L7,13 L7,10 L17,10 L18,11 L18,15 L17,16 L10,16 L9,17 L9,19 L10,20 L20,20 L22,18 L22,8 L20,6 L7,6 z' stroke='black' fill='white' /></svg>"}function select_dir(e){currentpath+=e+"/",SendCommand("list","all")}function compareStrings(e,t){return(e=e.toLowerCase())<(t=t.toLowerCase())?-1:t<e?1:0}function dispatchfilestatus(e){var t="";if(t=" Status: "+e.status,t+=" | Total space: "+e.total,t+=" | Used space: "+e.used,t+=" | Occupation: ",t+="<meter min='0' max='100' high='90' value='"+e.occupation+"'></meter> "+e.occupation+"%",document.getElementById("status").innerHTML=t,t="","/"!=currentpath){var n=currentpath.lastIndexOf("/",currentpath.length-2);t+="<tr style='cursor:hand;' onclick=\"currentpath='"+currentpath.slice(0,n+1)+"'; SendCommand('list','all');\"><td >"+back_icon()+"</td><td colspan='4'> Up..</td></tr>"}e.files.sort(function(e,t){return compareStrings(e.name,t.name)});for(var i=0;i<e.files.length;i++)"-1"!=String(e.files[i].size)&&(t+="<TR>",t+="<td><svg height='24' width='24' viewBox='0 0 24 24' >\t<path d='M1,2 L1,21 L2,22 L16,22 L17,21 L17,6 L12,6 L12,1 L2,1 z' stroke='black' fill='white' /><line x1='12' y1='1' x2='17' y2='6' stroke='black' stroke-width='1'/>",t+="<line x1='5' y1='10' x2='13' y2='10' stroke='black' stroke-width='1'/>\t<line x1='5' y1='14' x2='13' y2='14' stroke='black' stroke-width='1'/>\t<line x1='5' y1='18' x2='13' y2='18' stroke='black' stroke-width='1'/></svg></td>",t+='<TD class=\'btnimg\' style="padding:0px;"><a href="'+e.path+e.files[i].name+'" target=_blank><div class="blacklink">',t+=e.files[i].name,t+="</div></a></TD><TD>",t+=e.files[i].size,t+="</TD><TD width='0%'><div class=\"btnimg\" onclick=\"Delete('"+e.files[i].name+"')\">",t+=trash_icon(),t+="</div></TD><td></td></TR>");for(var l=0;l<e.files.length;l++)"-1"==String(e.files[l].size)&&(t+="<TR>",t+="<td><svg height='24' width='24' viewBox='0 0 24 24' ><path d='M19,11 L19,8 L18,7 L8,7 L8,5 L7,4 L2,4 L1,5 L1,22 L19,22 L20,21 L23,11 L5,11 L2,21 L1,22' stroke='black' fill='white' /></svg></td>",t+="<TD class='btnimg blacklink' style='padding:10px 15px;' onclick=\"select_dir('"+e.files[l].name+"');\">",t+=e.files[l].name,t+="</TD><TD>",t+="</TD><TD width='0%'><div class=\"btnimg\" onclick=\"Deletedir('"+e.files[l].name+"')\">",t+=trash_icon(),t+="</div></TD><td></td></TR>");document.getElementById("file_list").innerHTML=t,document.getElementById("path").innerHTML=navbar()}function Delete(e){confirm("Confirm deletion of file: "+e)&&SendCommand("delete",e)}function Deletedir(e){confirm("Confirm deletion of directory: "+e)&&SendCommand("deletedir",e)}function Createdir(){var e=prompt("Please enter directory name","");null!=e&&SendCommand("createdir",e.trim())}function SendCommand(e,t){var n=new XMLHttpRequest,i="/files?action="+e;i+="&filename="+encodeURI(t),i+="&path="+encodeURI(currentpath),document.getElementById("loader").style.visibility="visible",n.onreadystatechange=function(){if(4==n.readyState)if(200==n.status){var e=JSON.parse(n.responseText);document.getElementById("loader").style.visibility="hidden",dispatchfilestatus(e),FWOk()}else 401==n.status?SubmitRequest():FWError()},n.open("GET",i,!0),n.send()}function Sendfile(){var e=document.getElementById("file-select").files;if(0!=e.length){document.getElementById("upload-button").value="Uploading...",document.getElementById("prg").style.visibility="visible";var t=new FormData;t.append("path",currentpath);for(var n=0;n<e.length;n++){var i=e[n],l=currentpath+i.name+"S";t.append(l,i.size),t.append("myfiles[]",i,currentpath+i.name)}var d=new XMLHttpRequest;d.open("POST","/files",!0),d.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=e.loaded/e.total*100;document.getElementById("prg").value=t,document.getElementById("upload-button").value="Uploading ..."+t.toFixed(0)+"%"}},!1),d.onload=function(){200===d.status?(document.getElementById("upload-button").value="Upload",document.getElementById("prg").style.visibility="hidden",document.getElementById("file-select").value="",dispatchfilestatus(JSON.parse(d.responseText))):alert("An error occurred!")},d.send(t)}}function FWError(){document.getElementById("MSG").style.display="block",document.getElementById("MSG").innerHTML="Error : Failed to communicate with FW!",document.getElementById("FILESYSTEM").style.display="none",document.getElementById("FWUPDATE").style.display="none"}function FWOk(){document.getElementById("MSG").style.display="none",document.getElementById("MSG").innerHTML="Error : Failed to communicate with FW!","None"!=jsonresponse.Filesystem&&(document.getElementById("FILESYSTEM").style.display="block"),"Disabled"!=jsonresponse.WebUpdate&&(document.getElementById("FWUPDATE").style.display="block")}function InitUI(){var n=new XMLHttpRequest,e="/command?cmd="+encodeURI("[ESP800]");document.getElementById("loader").style.visibility="hidden",n.onreadystatechange=function(){if(4==n.readyState){var e=!1;if(200==n.status){var t=JSON.parse(n.responseText);void 0===t.FWVersion||void 0===t.Hostname||void 0===t.WebUpdate||void 0===t.Filesystem||void 0===t.Authentication?e=!0:(document.getElementById("FWVERSION").innerHTML="V"+t.FWVersion,document.getElementById("FWVERSION").style.display="block",document.title=t.Hostname,"Disabled"==t.Authentication?SendCommand("list","all"):(authentication=!0,SubmitRequest()))}else e=!0;e&&FWError()}},n.open("GET",e,!0),n.send()}function Uploadfile(){if(confirm("Confirm Firmware Update ?")){var e=document.getElementById("fw-select").files;if(0!=e.length){document.getElementById("uploadfw-button").style.visibility="hidden",document.getElementById("fw-select").style.visibility="hidden",document.getElementById("msg").style.visibility="visible",document.getElementById("msg").innerHTML="",document.getElementById("FILESYSTEM").style.display="none",document.getElementById("prgfw").style.visibility="visible";for(var t=new FormData,n=0;n<e.length;n++){var i=e[n],l="/"+i.name+"S";t.append(l,i.size),t.append("myfile[]",i,"/"+i.name)}var d=new XMLHttpRequest;d.open("POST","/updatefw",!0),d.upload.addEventListener("progress",function(e){if(e.lengthComputable){var t=e.loaded/e.total*100;document.getElementById("prgfw").value=t,document.getElementById("msg").innerHTML="Uploading ..."+t.toFixed(0)+"%"}},!1),d.onload=function(){if(200===d.status){document.getElementById("uploadfw-button").value="Upload",document.getElementById("msg").innerHTML="Restarting, please wait....",document.getElementById("counter").style.visibility="visible",document.getElementById("uploadfw-button").style.visibility="hidden",document.getElementById("uploadfw-button").style.width="0px",document.getElementById("fw-select").value="",document.getElementById("fw-select").style.visibility="hidden",document.getElementById("fw-select").style.width="0px";var e=JSON.parse(d.responseText);if("1"!=e.status&&"4"!=e.status&&"1"!=e.status||alert("Update failed"),"2"==e.status)alert("Update canceled!");else if("3"==e.status){var t,n=0;document.getElementById("prgfw").max=40,t=setInterval(function(){n+=1,document.getElementById("prgfw").value=n,document.getElementById("counter").innerHTML=41-n,40<n&&(clearInterval(t),location.reload())},1e3)}else alert("Update failed!")}else alert("An error occurred!")},d.send(t)}}}function RequestLogin(){document.getElementById("loader").style.visibility="hidden",document.getElementById("loginpage").style.display="block"}function SubmitRequest(){document.getElementById("loginpage").style.display="none";var e=document.getElementById("login_user_text").value.trim(),t=document.getElementById("login_password_text").value.trim(),n="/login?USER="+encodeURIComponent(e)+"&PASSWORD="+encodeURIComponent(t)+"&SUBMIT=yes",i=new XMLHttpRequest;i.onreadystatechange=function(){4==i.readyState&&(200!=i.status?401==i.status?RequestLogin():FWError():FWOk())},i.open("GET",n,!0),i.send()}window.onload=function(){InitUI()};</script></body></html> |