From 0b3df3a155818bba84a9c43778b8de4d1d49153e Mon Sep 17 00:00:00 2001 From: Christian Herzog Date: Wed, 22 Apr 2020 21:18:37 +0200 Subject: [PATCH] allow sorting for branch --- components/wifi-manager/code.js | 27 +++++++++++++++++++++++++++ components/wifi-manager/index.html | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index 3d736245..3d7496d1 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -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 += ''; + }); + $("#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; }); diff --git a/components/wifi-manager/index.html b/components/wifi-manager/index.html index 8d37c448..3ca2634a 100644 --- a/components/wifi-manager/index.html +++ b/components/wifi-manager/index.html @@ -254,6 +254,10 @@
+ +