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() {
|
||||
var url = $("#fwurl").val();
|
||||
$.ajax({
|
||||
url: '/config.json',
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
headers: { "X-Custom-fwurl": url },
|
||||
data: { 'timestamp': Date.now() }
|
||||
});
|
||||
$.ajax({
|
||||
url: '/recovery.json',
|
||||
dataType: 'json',
|
||||
@@ -305,14 +314,8 @@ $(document).ready(function(){
|
||||
|
||||
function setURL(button) {
|
||||
var url = button.dataset.url;
|
||||
$.ajax({
|
||||
url: '/config.json',
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
headers: { "X-Custom-fwurl": url },
|
||||
data: { 'timestamp': Date.now() }
|
||||
});
|
||||
$("#fwurl").val(url);
|
||||
|
||||
$('[data-url^="http"]').addClass("btn-success").removeClass("btn-danger");
|
||||
$('[data-url="'+url+'"]').addClass("btn-danger").removeClass("btn-success");
|
||||
}
|
||||
@@ -491,7 +494,7 @@ function getConfig() {
|
||||
if (data.hasOwnProperty('recovery')) {
|
||||
if (data["recovery"] === 1) {
|
||||
recovery = true;
|
||||
$("#recoverydiv").hide();
|
||||
//$("#recoverydiv").hide();
|
||||
$("#otadiv").show();
|
||||
} else {
|
||||
recovery = false;
|
||||
|
||||
@@ -217,6 +217,8 @@
|
||||
<tbody id="releaseTable">
|
||||
</tbody>
|
||||
</table>
|
||||
<h2>Firmware URL:</h2>
|
||||
<textarea id="fwurl" maxlength="120"></textarea>
|
||||
<h1>Reboot to recovery system to perform firmware upgrade</h1>
|
||||
<div class="buttons">
|
||||
<input type="button" id="recovery" class="btn btn-warning" value="Recovery" />
|
||||
|
||||
@@ -213,8 +213,6 @@ input[type='text'], input[type='password'], textarea {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.custom-switch, .custom-radio {
|
||||
padding-left: 2.25rem;
|
||||
margin-left: 12px;
|
||||
@@ -263,14 +261,7 @@ input[type='text'], input[type='password'], textarea {
|
||||
transform: translateX(1.5rem); //translateX(0.75rem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
textarea#autoexec1 {
|
||||
textarea#autoexec1, textarea#fwurl {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
@@ -299,23 +290,3 @@ input, textarea {
|
||||
font-family: monospace, monospace;
|
||||
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