mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 13:07:03 +03:00
backport webUI changes as well (-disable)
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2023-10-23
|
||||||
|
- fix Spotify track insertion
|
||||||
|
- [WEB] Allow running without LMS with option "Audio/Disable Squeezelite"
|
||||||
|
|
||||||
2023-10.07
|
2023-10.07
|
||||||
- catchup with official cspot
|
- catchup with official cspot
|
||||||
|
|
||||||
|
|||||||
@@ -331,8 +331,7 @@
|
|||||||
|
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
<input class="form-check-input" type="checkbox" id="disable-squeezelite"
|
<input class="form-check-input" type="checkbox" id="disable-squeezelite" value="" >
|
||||||
value="" checked="">
|
|
||||||
Disable Squeezelite
|
Disable Squeezelite
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -923,10 +923,10 @@ window.saveAutoexec1 = function (apply) {
|
|||||||
};
|
};
|
||||||
data.config = {
|
data.config = {
|
||||||
autoexec1: { value: commandLine, type: 33 },
|
autoexec1: { value: commandLine, type: 33 },
|
||||||
autoexec: {
|
// autoexec: {
|
||||||
value: $('#disable-squeezelite').prop('checked') ? '0' : '1',
|
// value: $('#disable-squeezelite').prop('checked') ? '0' : '1',
|
||||||
type: 33,
|
// type: 33,
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -1216,6 +1216,28 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#disable-squeezelite').on('click', function () {
|
||||||
|
// this.checked = this.checked ? 1 : 0;
|
||||||
|
// $('#disable-squeezelite').prop('checked')
|
||||||
|
if (this.checked) {
|
||||||
|
// Store the current value before overwriting it
|
||||||
|
const currentValue = $('#cmd_opt_s').val();
|
||||||
|
$('#cmd_opt_s').data('originalValue', currentValue);
|
||||||
|
|
||||||
|
// Overwrite the value with '-disable'
|
||||||
|
$('#cmd_opt_s').val('-disable');
|
||||||
|
} else {
|
||||||
|
// Retrieve the original value
|
||||||
|
const originalValue = $('#cmd_opt_s').data('originalValue');
|
||||||
|
|
||||||
|
// Restore the original value if it exists, otherwise set it to an empty string
|
||||||
|
$('#cmd_opt_s').val(originalValue ? originalValue : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('input#show-nvs').on('click', function () {
|
$('input#show-nvs').on('click', function () {
|
||||||
this.checked = this.checked ? 1 : 0;
|
this.checked = this.checked ? 1 : 0;
|
||||||
Cookies.set("show-nvs", this.checked ? 'Y' : 'N');
|
Cookies.set("show-nvs", this.checked ? 'Y' : 'N');
|
||||||
@@ -2199,13 +2221,7 @@ function getConfig() {
|
|||||||
.sort()
|
.sort()
|
||||||
.forEach(function (key) {
|
.forEach(function (key) {
|
||||||
let val = data[key].value;
|
let val = data[key].value;
|
||||||
if (key === 'autoexec') {
|
if (key === 'autoexec1') {
|
||||||
if (data.autoexec.value === '0') {
|
|
||||||
$('#disable-squeezelite')[0].checked = true;
|
|
||||||
} else {
|
|
||||||
$('#disable-squeezelite')[0].checked = false;
|
|
||||||
}
|
|
||||||
} else if (key === 'autoexec1') {
|
|
||||||
/* call new function to parse the squeezelite options */
|
/* call new function to parse the squeezelite options */
|
||||||
processSqueezeliteCommandLine(val);
|
processSqueezeliteCommandLine(val);
|
||||||
} else if (key === 'host_name') {
|
} else if (key === 'host_name') {
|
||||||
@@ -2294,6 +2310,7 @@ function processSqueezeliteCommandLine(val) {
|
|||||||
commandBTSinkName= parsed.otherOptions.btname;
|
commandBTSinkName= parsed.otherOptions.btname;
|
||||||
}
|
}
|
||||||
handleTemplateTypeRadio('bt');
|
handleTemplateTypeRadio('bt');
|
||||||
|
|
||||||
}
|
}
|
||||||
Object.keys(parsed.options).forEach(function (key) {
|
Object.keys(parsed.options).forEach(function (key) {
|
||||||
const option = parsed.options[key];
|
const option = parsed.options[key];
|
||||||
@@ -2312,6 +2329,17 @@ function processSqueezeliteCommandLine(val) {
|
|||||||
$('#resample_i').prop('checked', true);
|
$('#resample_i').prop('checked', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (parsed.options.hasOwnProperty('s')) {
|
||||||
|
// parse -u v[:i] and check the appropriate radio button with id #resample_v
|
||||||
|
if(parsed.options.s === '-disable'){
|
||||||
|
$('#disable-squeezelite')[0].checked = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#disable-squeezelite')[0].checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user