mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 05:27:01 +03:00
Merge pull request #8 from sle118/Over_The_Air_Update
Over the air update
This commit is contained in:
@@ -308,6 +308,7 @@ $(document).ready(function(){
|
|||||||
$('#fwcheck').on("click", function(){
|
$('#fwcheck').on("click", function(){
|
||||||
$("#releaseTable").html("");
|
$("#releaseTable").html("");
|
||||||
$.getJSON(releaseURL, function(data) {
|
$.getJSON(releaseURL, function(data) {
|
||||||
|
var i=0;
|
||||||
data.forEach(function(release) {
|
data.forEach(function(release) {
|
||||||
var url = '';
|
var url = '';
|
||||||
release.assets.forEach(function(asset) {
|
release.assets.forEach(function(asset) {
|
||||||
@@ -321,8 +322,9 @@ $(document).ready(function(){
|
|||||||
body = body.replace(/[\s\S]+(### Revision Log[\s\S]+)### ESP-IDF Version Used[\s\S]+/, "$1");
|
body = body.replace(/[\s\S]+(### Revision Log[\s\S]+)### ESP-IDF Version Used[\s\S]+/, "$1");
|
||||||
body = body.replace(/- \(.+?\) /g, "- ");
|
body = body.replace(/- \(.+?\) /g, "- ");
|
||||||
var [date, time] = release.created_at.split('T');
|
var [date, time] = release.created_at.split('T');
|
||||||
|
var trclass = (i++ > 6)?' hide':'';
|
||||||
$("#releaseTable").append(
|
$("#releaseTable").append(
|
||||||
"<tr>"+
|
"<tr class='release"+trclass+"'>"+
|
||||||
"<td data-toggle='tooltip' title='"+body+"'>"+ver+"</td>"+
|
"<td data-toggle='tooltip' title='"+body+"'>"+ver+"</td>"+
|
||||||
"<td>"+idf+"</td>"+
|
"<td>"+idf+"</td>"+
|
||||||
"<td>"+date+"</td>"+
|
"<td>"+date+"</td>"+
|
||||||
@@ -332,12 +334,45 @@ $(document).ready(function(){
|
|||||||
"</tr>"
|
"</tr>"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
if (i > 7) {
|
||||||
|
$("#releaseTable").append(
|
||||||
|
"<tr id='showall'>"+
|
||||||
|
"<td colspan='6'>"+
|
||||||
|
"<input type='button' id='showallbutton' class='btn btn-info' value='Show older releases' />"+
|
||||||
|
"</td>"+
|
||||||
|
"</tr>"
|
||||||
|
);
|
||||||
|
$('#showallbutton').on("click", function(){
|
||||||
|
$("tr.hide").removeClass("hide");
|
||||||
|
$("tr#showall").addClass("hide");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$("#searchfw").css("display", "inline");
|
||||||
})
|
})
|
||||||
.fail(function() {
|
.fail(function() {
|
||||||
alert("failed to fetch release history!");
|
alert("failed to fetch release history!");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('input#searchinput').on("input", function(){
|
||||||
|
var s = $('input#searchinput').val();
|
||||||
|
var re = new RegExp(s, "gi");
|
||||||
|
if (s.length == 0) {
|
||||||
|
$("tr.release").removeClass("hide");
|
||||||
|
} else if (s.length < 3) {
|
||||||
|
$("tr.release").addClass("hide");
|
||||||
|
} else {
|
||||||
|
$("tr.release").addClass("hide");
|
||||||
|
$("tr.release").each(function(tr){
|
||||||
|
$(this).find('td').each (function() {
|
||||||
|
if ($(this).html().match(re)) {
|
||||||
|
$(this).parent().removeClass('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//first time the page loads: attempt to get the connection status and start the wifi scan
|
//first time the page loads: attempt to get the connection status and start the wifi scan
|
||||||
refreshAP();
|
refreshAP();
|
||||||
getConfig();
|
getConfig();
|
||||||
|
|||||||
@@ -270,6 +270,9 @@
|
|||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<input type="button" id="fwcheck" class="btn btn-info" value="Check for updates" />
|
<input type="button" id="fwcheck" class="btn btn-info" value="Check for updates" />
|
||||||
</div>
|
</div>
|
||||||
|
<div id="searchfw" class="form-group">
|
||||||
|
<input class="form-control form-control-sm" id="searchinput" type="text" placeholder="search releases" id="inputSmall">
|
||||||
|
</div>
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -352,3 +352,12 @@ div#message {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0px 5px 2px -5px rgba(255, 255, 255, 0.5) inset, 0px 10px 20px -5px rgba(255, 255, 255, 0.1) inset, 0 0px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 1px rgba(0, 0, 0, 0.12), 0 1px 10px 0 rgba(0, 0, 0, 0.3);
|
box-shadow: 0px 5px 2px -5px rgba(255, 255, 255, 0.5) inset, 0px 10px 20px -5px rgba(255, 255, 255, 0.1) inset, 0 0px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 1px rgba(0, 0, 0, 0.12), 0 1px 10px 0 rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchfw {
|
||||||
|
float: right;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user