mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
make FW URL editable
This commit is contained in:
@@ -213,6 +213,15 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#recovery").on("click", function() {
|
$("#recovery").on("click", function() {
|
||||||
|
var url = $("#fwurl").val();
|
||||||
|
$.ajax({
|
||||||
|
url: '/config.json',
|
||||||
|
dataType: 'json',
|
||||||
|
method: 'POST',
|
||||||
|
cache: false,
|
||||||
|
headers: { "X-Custom-fwurl": url },
|
||||||
|
data: { 'timestamp': Date.now() }
|
||||||
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/recovery.json',
|
url: '/recovery.json',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@@ -305,14 +314,8 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
function setURL(button) {
|
function setURL(button) {
|
||||||
var url = button.dataset.url;
|
var url = button.dataset.url;
|
||||||
$.ajax({
|
$("#fwurl").val(url);
|
||||||
url: '/config.json',
|
|
||||||
dataType: 'json',
|
|
||||||
method: 'POST',
|
|
||||||
cache: false,
|
|
||||||
headers: { "X-Custom-fwurl": url },
|
|
||||||
data: { 'timestamp': Date.now() }
|
|
||||||
});
|
|
||||||
$('[data-url^="http"]').addClass("btn-success").removeClass("btn-danger");
|
$('[data-url^="http"]').addClass("btn-success").removeClass("btn-danger");
|
||||||
$('[data-url="'+url+'"]').addClass("btn-danger").removeClass("btn-success");
|
$('[data-url="'+url+'"]').addClass("btn-danger").removeClass("btn-success");
|
||||||
}
|
}
|
||||||
@@ -491,7 +494,7 @@ function getConfig() {
|
|||||||
if (data.hasOwnProperty('recovery')) {
|
if (data.hasOwnProperty('recovery')) {
|
||||||
if (data["recovery"] === 1) {
|
if (data["recovery"] === 1) {
|
||||||
recovery = true;
|
recovery = true;
|
||||||
$("#recoverydiv").hide();
|
//$("#recoverydiv").hide();
|
||||||
$("#otadiv").show();
|
$("#otadiv").show();
|
||||||
} else {
|
} else {
|
||||||
recovery = false;
|
recovery = false;
|
||||||
|
|||||||
@@ -217,6 +217,8 @@
|
|||||||
<tbody id="releaseTable">
|
<tbody id="releaseTable">
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<h2>Firmware URL:</h2>
|
||||||
|
<textarea id="fwurl" maxlength="120"></textarea>
|
||||||
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<input type="button" id="recovery" class="btn btn-warning" value="Recovery" />
|
<input type="button" id="recovery" class="btn btn-warning" value="Recovery" />
|
||||||
|
|||||||
@@ -213,8 +213,6 @@ input[type='text'], input[type='password'], textarea {
|
|||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.custom-switch, .custom-radio {
|
.custom-switch, .custom-radio {
|
||||||
padding-left: 2.25rem;
|
padding-left: 2.25rem;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
@@ -263,14 +261,7 @@ input[type='text'], input[type='password'], textarea {
|
|||||||
transform: translateX(1.5rem); //translateX(0.75rem);
|
transform: translateX(1.5rem); //translateX(0.75rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea#autoexec1, textarea#fwurl {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
textarea#autoexec1 {
|
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,23 +290,3 @@ input, textarea {
|
|||||||
font-family: monospace, monospace;
|
font-family: monospace, monospace;
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
.toggle-buttons input[type="radio"] {
|
|
||||||
visibility: hidden;
|
|
||||||
width: 3px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-buttons label {
|
|
||||||
border: 1px solid #000;
|
|
||||||
border-radius: 0.5em;
|
|
||||||
padding: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-buttons input:checked + label {
|
|
||||||
background: #5a9900;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user