You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
esp-link/data/spiffs/flash.js

20 lines
809 B

function flashFirmware(b){b.preventDefault();
var a=document.getElementById("fw-file").files[0];
$("#fw-form").setAttribute("hidden","");
$("#fw-spinner").removeAttribute("hidden");
showNotification("Firmware is being updated ...");
ajaxReq("POST","/flash/upload",function(c){ajaxReq("GET","/flash/reboot",function(d){showNotification("Firmware has been successfully updated!");
setTimeout(function(){window.location.reload()
},4000);
$("#fw-spinner").setAttribute("hidden","");
$("#fw-form").removeAttribute("hidden")
})
},null,a)
}function fetchFlash(){ajaxReq("GET","/flash/next",function(a){$("#fw-slot").innerHTML=a;
$("#fw-spinner").setAttribute("hidden","");
$("#fw-form").removeAttribute("hidden")
});
ajaxJson("GET","/menu",function(b){var a=$("#current-fw");
if(a!=null){a.innerHTML=b.version
}})
};