From 2b371c0d8940f66fcfe541140f4f6de8b6f56e57 Mon Sep 17 00:00:00 2001 From: jgyselov Date: Wed, 25 Sep 2024 16:38:02 +0200 Subject: [PATCH] Fix agent table search --- libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx | 4 +--- libs/ui-lib/lib/common/components/hosts/utils.ts | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx b/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx index d888c00c6c..9541f89f07 100644 --- a/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +++ b/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx @@ -105,9 +105,7 @@ const InfraTableToolbar: React.FC = ({ setHostnameFilter(value)} onClear={() => setHostnameFilter(undefined)} /> diff --git a/libs/ui-lib/lib/common/components/hosts/utils.ts b/libs/ui-lib/lib/common/components/hosts/utils.ts index 63c1a1d471..8f895a292a 100644 --- a/libs/ui-lib/lib/common/components/hosts/utils.ts +++ b/libs/ui-lib/lib/common/components/hosts/utils.ts @@ -211,8 +211,10 @@ export const filterByHostname = (hosts: Host[], hostnameFilter: string | undefin const fuse = new Fuse(hostsWithHostname, { ignoreLocation: true, + threshold: 0.3, keys: ['hostname'], }); + return fuse.search(hostnameFilter).map(({ item }) => item.host); };