allow sorting for branch

This commit is contained in:
Christian Herzog
2020-04-22 21:18:37 +02:00
parent 04308e71de
commit 0b3df3a155
2 changed files with 31 additions and 0 deletions

View File

@@ -460,6 +460,19 @@ $(document).ready(function(){
$("#releaseTable").html("");
$.getJSON(releaseURL, function(data) {
var i=0;
var branches = [];
data.forEach(function(release) {
var [ver, idf, cfg, branch] = release.name.split('#');
if (!branches.includes(branch)) {
branches.push(branch);
}
});
var fwb;
branches.forEach(function(branch) {
fwb += '<option value="' + branch + '">' + branch + '</option>';
});
$("#fwbranch").append(fwb);
data.forEach(function(release) {
var url = '';
release.assets.forEach(function(asset) {
@@ -524,6 +537,20 @@ $(document).ready(function(){
}
});
$("#fwbranch").change(function(e) {
var branch = this.value;
var re = new RegExp('^'+branch+'$', "gi");
$("tr.release").addClass("hide");
$("tr.release").each(function(tr){
$(this).find('td').each (function() {
console.log($(this).html());
if ($(this).html().match(re)) {
$(this).parent().removeClass('hide');
}
});
});
});
$('#boot-button').on("click", function(){
enableStatusTimer = true;
});

View File

@@ -254,6 +254,10 @@
<input type="button" id="fwcheck" class="btn btn-info" value="Check for updates" />
</div>
<div id="searchfw" class="form-group">
<select class="custom-select" id="fwbranch">
<option selected="">Choose FW branch</option>
</select>
<input class="form-control form-control-sm" id="searchinput" type="text" placeholder="search releases" id="inputSmall">
</div>
<table class="table table-hover">