From 8df68f1f4eec0be0795350d38505fc4abf3fa7d5 Mon Sep 17 00:00:00 2001 From: adoolaard Date: Thu, 30 Jan 2025 22:48:48 +0100 Subject: [PATCH] Zoeken en filteren werkt ook! --- src/web/components/httprp.html | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/web/components/httprp.html b/src/web/components/httprp.html index cdb9873..0e2ce06 100644 --- a/src/web/components/httprp.html +++ b/src/web/components/httprp.html @@ -12,6 +12,19 @@ min-width: 200px; } +
+ + +
+
@@ -144,12 +157,42 @@ `); }); + populateTagFilterDropdown(data); } resolveAccessRuleNameOnHostRPlist(); }); } + // Function to populate the tag filter dropdown + function populateTagFilterDropdown(data) { + let tags = new Set(); + data.forEach(subd => { + subd.Tags.forEach(tag => tags.add(tag)); + }); + let dropdownMenu = $("#tagFilterDropdown .menu"); + dropdownMenu.html('
All
'); + tags.forEach(tag => { + dropdownMenu.append(`
${tag}
`); + }); + $('#tagFilterDropdown').dropdown(); + } + + // Function to filter the proxy list + function filterProxyList() { + let searchInput = $("#searchInput").val().toLowerCase(); + let selectedTag = $("#tagFilterDropdown").dropdown('get value'); + $("#httpProxyList tr").each(function() { + let host = $(this).find("td[data-label='']").text().toLowerCase(); + let tags = $(this).find("td[data-label='tags']").text().toLowerCase(); + if ((host.includes(searchInput) || searchInput === "") && (tags.includes(selectedTag) || selectedTag === "")) { + $(this).show(); + } else { + $(this).hide(); + } + }); + } + //Perform realtime alias update without refreshing the whole page function updateAliasListForEndpoint(endpointName, newAliasDomainList){ let targetEle = $(`.aliasDomains[eptuuid='${endpointName}']`); @@ -622,4 +665,9 @@ })); showSideWrapper("snippet/tagEditor.html?t=" + Date.now() + "#" + payload); } + + // Initialize the proxy list on page load + $(document).ready(function() { + listProxyEndpoints(); + }); \ No newline at end of file