From 2d7aef57ef6b76a31e5a964502761e27d9cccda7 Mon Sep 17 00:00:00 2001 From: Christian Herzog Date: Thu, 3 Oct 2019 20:20:02 +0200 Subject: [PATCH] add FW search --- components/wifi-manager/code.js | 21 ++++++++++++++++++++- components/wifi-manager/index.html | 3 +++ components/wifi-manager/style.css | 5 +++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index 64d564a6..fc25b661 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -343,17 +343,36 @@ $(document).ready(function(){ "" ); $('#showallbutton').on("click", function(){ - console.log('show all'); $("tr.hide").removeClass("hide"); $("tr#showall").addClass("hide"); }); } + $("#searchfw").css("display", "inline"); }) .fail(function() { 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 refreshAP(); getConfig(); diff --git a/components/wifi-manager/index.html b/components/wifi-manager/index.html index 41c01590..b23b0b0f 100644 --- a/components/wifi-manager/index.html +++ b/components/wifi-manager/index.html @@ -270,6 +270,9 @@
+
+ +
diff --git a/components/wifi-manager/style.css b/components/wifi-manager/style.css index 2e088f34..df4b701f 100644 --- a/components/wifi-manager/style.css +++ b/components/wifi-manager/style.css @@ -356,3 +356,8 @@ div#message { tr.hide { display: none; } + +#searchfw { + float: right; + display: none; +}