mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
fix broken autoexec toggle
This commit is contained in:
@@ -175,10 +175,10 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("input#autoexec-cb").on("click", function() {
|
$("input#autoexec-cb").on("click", function() {
|
||||||
showMessage('please wait for the ESP32 to reboot', 'WARNING');
|
|
||||||
var data = { 'timestamp': Date.now() };
|
var data = { 'timestamp': Date.now() };
|
||||||
autoexec = (this.checked)?1:0;
|
autoexec = (this.checked)?1:0;
|
||||||
data['autoexec'] = autoexec;
|
data['autoexec'] = autoexec;
|
||||||
|
showMessage('please wait for the ESP32 to reboot', 'WARNING');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/config.json',
|
url: '/config.json',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@@ -665,6 +665,7 @@ function getConfig() {
|
|||||||
$.getJSON("/config.json", function(data) {
|
$.getJSON("/config.json", function(data) {
|
||||||
for (var key in data) {
|
for (var key in data) {
|
||||||
if (data.hasOwnProperty(key)) {
|
if (data.hasOwnProperty(key)) {
|
||||||
|
console.log(key+": "+data[key]);
|
||||||
if (key == 'autoexec') {
|
if (key == 'autoexec') {
|
||||||
if (data["autoexec"] === "1") {
|
if (data["autoexec"] === "1") {
|
||||||
$("#autoexec-cb")[0].checked=true;
|
$("#autoexec-cb")[0].checked=true;
|
||||||
|
|||||||
@@ -202,8 +202,8 @@
|
|||||||
|
|
||||||
<h1>Start Squeezelite (toggle to activate changes)</h1>
|
<h1>Start Squeezelite (toggle to activate changes)</h1>
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<label class="custom-control-label" for="autoexec-cb"></label>
|
|
||||||
<input type="checkbox" class="custom-control-input" id="autoexec-cb" checked="checked">
|
<input type="checkbox" class="custom-control-input" id="autoexec-cb" checked="checked">
|
||||||
|
<label class="custom-control-label" for="autoexec-cb"></label>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user