diff --git a/custom/js/helper.js b/custom/js/helper.js index 6f32900..5b43272 100644 --- a/custom/js/helper.js +++ b/custom/js/helper.js @@ -40,7 +40,7 @@ function renderClientList(data) { let additionalNotesHtml = ""; if (obj.Client.additional_notes && obj.Client.additional_notes.length > 0) { - additionalNotesHtml = `` + additionalNotesHtml = `` } // render client html content @@ -49,7 +49,7 @@ function renderClientList(data) {
-
+
@@ -94,6 +94,8 @@ function renderClientList(data) { ${prettyDateTime(obj.Client.updated_at)} ${obj.Client.use_server_dns ? 'DNS enabled' : 'DNS disabled'} + + ${obj.Client.additional_notes} IP Allocation` + allocatedIpsHtml + `Allowed IPs` diff --git a/templates/clients.html b/templates/clients.html index fada01e..0ab8733 100644 --- a/templates/clients.html +++ b/templates/clients.html @@ -416,7 +416,7 @@ Wireguard Clients // hide all clients and display only the ones that meet the search criteria (name, email, IP) $('#search-input').keyup(function () { $("#status-selector").val("All"); - var query = $(this).val(); + let query = $(this).val().trim(); $('.col-lg-4').hide(); $(".info-box-text").each(function() { if($(this).children('i.fa-user').length > 0 || $(this).children('i.fa-envelope').length > 0) @@ -426,12 +426,13 @@ Wireguard Clients }) $(".badge-secondary").filter(':contains("' + query + '")').parent().parent().parent().show(); $(".fa-tguserid").each(function () { - if ($(this).parent().text().trim().indexOf(query.trim()) != -1) { + if ($(this).parent().text().trim().indexOf(query) != -1) { $(this).closest('.col-lg-4').show(); } }) + let upperQuery = query.toUpperCase() $(".fa-additional_notes").each(function () { - if ($(this).parent().text().trim().indexOf(query.trim()) != -1) { + if ($(this).parent().text().trim().indexOf(upperQuery) != -1) { $(this).closest('.col-lg-4').show(); } })