streamline flash logic

This commit is contained in:
Christian Herzog
2019-09-26 20:08:22 +02:00
parent 7bfc46af0f
commit 6888b53c6c
3 changed files with 27 additions and 52 deletions

View File

@@ -212,7 +212,7 @@ $(document).ready(function(){
console.log('sent config JSON with headers:', autoexec1);
});
$("#recovery").on("click", function() {
$("#flash").on("click", function() {
var url = $("#fwurl").val();
$.ajax({
url: '/config.json',
@@ -222,23 +222,6 @@ $(document).ready(function(){
headers: { "X-Custom-fwurl": url },
data: { 'timestamp': Date.now() }
});
$.ajax({
url: '/recovery.json',
dataType: 'json',
method: 'POST',
cache: false,
data: { 'timestamp': Date.now()}
});
});
$("#reboot").on("click", function() {
$.ajax({
url: '/reboot.json',
dataType: 'json',
method: 'POST',
cache: false,
data: { 'timestamp': Date.now()}
});
});
$("#generate-command").on("click", function() {
@@ -494,11 +477,9 @@ function getConfig() {
if (data.hasOwnProperty('recovery')) {
if (data["recovery"] === 1) {
recovery = true;
//$("#recoverydiv").hide();
$("#otadiv").show();
} else {
recovery = false;
$("#recoverydiv").show();
$("#otadiv").hide();
}
}