Skip to content

Commit

Permalink
Hotfix search (#4239)
Browse files Browse the repository at this point in the history
Co-authored-by: sunguroku <[email protected]>
  • Loading branch information
sunguroku and sunguroku authored Feb 6, 2024
1 parent e0faa0f commit 04c7fe3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const AppGrid: React.FC<AppGridProps> = ({

const filteredApps = useMemo(() => {
const filteredBySearch = search(appsWithProto ?? [], searchValue, {
keys: ["name"],
keys: ["source.name"],
isCaseSensitive: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const Resources: React.FC<ResourcesProps> = ({
<IntelligentSlider
label="CPUs: "
unit="Cores"
min={0.01}
min={0.1}
max={maxCPU}
color={"#3f51b5"}
value={value.value.toString()}
Expand Down Expand Up @@ -198,7 +198,7 @@ const Resources: React.FC<ResourcesProps> = ({
<IntelligentSlider
label="RAM: "
unit="MB"
min={1}
min={10}
max={maxRAM}
color={"#3f51b5"}
value={value.value.toString()}
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/shared/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const search = <T>(
if (!searchTerm) {
return items;
}

const fuse = new Fuse<T>(items, options);
return fuse.search(searchTerm).map((result) => result.item);
};

0 comments on commit 04c7fe3

Please sign in to comment.