Skip to content

Commit

Permalink
Fix agent table search (#2670)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyselov authored Oct 7, 2024
1 parent 7798c90 commit 8592219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ const InfraTableToolbar: React.FC<InfraTableToolbarProps> = ({
<SearchInput
placeholder={t('ai:Find by hostname')}
value={hostnameFilter}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
onChange={setHostnameFilter}
onChange={(_e, value) => setHostnameFilter(value)}
onClear={() => setHostnameFilter(undefined)}
/>
</ToolbarItem>
Expand Down
2 changes: 2 additions & 0 deletions libs/ui-lib/lib/common/components/hosts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 8592219

Please sign in to comment.