From 516523747494787c52eebba2558ab2cf77b84507 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 b4c46a6110..d5e3b81cea 100644 --- a/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +++ b/libs/ui-lib/lib/cim/components/InfraEnv/InfraTableToolbar.tsx @@ -107,9 +107,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 7fd8809a6e..311254a011 100644 --- a/libs/ui-lib/lib/common/components/hosts/utils.ts +++ b/libs/ui-lib/lib/common/components/hosts/utils.ts @@ -210,8 +210,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); };