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;
});