From 6d87861e39c90e83afdd1fb9c70cb09757804811 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Tue, 3 Mar 2026 11:16:09 +1000 Subject: [PATCH] tools: localhost: fix application filtering Filtering on multiple conditions requires a callback function, not two calls to `.setFilter`. Signed-off-by: Jordan Yates --- src/infuse_iot/tools/localhost/index.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/infuse_iot/tools/localhost/index.html b/src/infuse_iot/tools/localhost/index.html index e68f449..2055f9a 100644 --- a/src/infuse_iot/tools/localhost/index.html +++ b/src/infuse_iot/tools/localhost/index.html @@ -151,8 +151,6 @@

Infuse-IoT TDF Viewer

ws.onmessage = function (event) { const { columns, rows, tdfs, apps, networks } = JSON.parse(event.data); - console.log(networks); - if (!arraysEqual(currentTDFs, tdfs)) { // Merge new data with the existing table data const currentRows = shownTdfTable.getData(); @@ -238,11 +236,11 @@

Infuse-IoT TDF Viewer

enabledApps = currentApps.filter(a => appShow[a]); enabledNetworks = currentNetworks.filter(a => networkShow[a]); - console.log(enabledApps, enabledNetworks); - + function customFilter(data, filterParams) { + return filterParams['apps'].includes(data.application) && filterParams["networks"].includes(data.network_id); + } dataTable.clearFilter(); - dataTable.setFilter("application", "in", enabledApps); - dataTable.setFilter("network_id", "in", enabledNetworks); + dataTable.setFilter(customFilter, {apps: enabledApps, networks: enabledNetworks}); filtering_update = false; }