fix squeezelite startup toggle

This commit is contained in:
Sebastien
2019-10-16 11:20:33 -04:00
parent 51a3fbcef0
commit 0a4a6b16c3

View File

@@ -194,20 +194,28 @@ $(document).ready(function(){
console.log(thrownError); console.log(thrownError);
if (thrownError != '') showMessage(thrownError, 'ERROR'); if (thrownError != '') showMessage(thrownError, 'ERROR');
} }
}); complete: function(response) {
console.log('sent config JSON with headers:', autoexec); var returnedResponse = JSON.parse(response.responseText);
console.log('now triggering reboot'); console.log(response.responseText);
$.ajax({ console.log('sent config JSON with headers:', autoexec);
url: '/reboot.json', console.log('now triggering reboot');
dataType: 'text', $.ajax({
method: 'POST', url: '/reboot.json',
cache: false, dataType: 'text',
contentType: 'application/json; charset=utf-8', method: 'POST',
data: JSON.stringify({ 'timestamp': Date.now()}), cache: false,
error: function (xhr, ajaxOptions, thrownError) { contentType: 'application/json; charset=utf-8',
console.log(xhr.status); data: JSON.stringify({ 'timestamp': Date.now()}),
console.log(thrownError); error: function (xhr, ajaxOptions, thrownError) {
if (thrownError != '') showMessage(thrownError, 'ERROR'); console.log(xhr.status);
console.log(thrownError);
if (thrownError != '') showMessage(thrownError, 'ERROR');
}
complete: function(response) {
console.log('reboot call completed');
}
});
} }
}); });
}); });