make FW URL editable

This commit is contained in:
Christian Herzog
2019-09-26 19:37:51 +02:00
parent d5d4d62092
commit 7bfc46af0f
3 changed files with 15 additions and 39 deletions

View File

@@ -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;

View File

@@ -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" />

View File

@@ -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;
}
*/