fix: tool indicator in hub

This commit is contained in:
Louis 2025-08-19 10:40:11 +07:00
parent 0dc0a9a4a3
commit d7cf258a40
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 20 additions and 2 deletions

View File

@ -17,7 +17,12 @@ import { useModelProvider } from '@/hooks/useModelProvider'
import { Card, CardItem } from '@/containers/Card'
import { RenderMarkdown } from '@/containers/RenderMarkdown'
import { extractModelName, extractDescription } from '@/lib/models'
import { IconDownload, IconFileCode, IconSearch } from '@tabler/icons-react'
import {
IconDownload,
IconFileCode,
IconSearch,
IconTool,
} from '@tabler/icons-react'
import { Switch } from '@/components/ui/switch'
import Joyride, { CallBackProps, STATUS } from 'react-joyride'
import { CustomTooltipJoyRide } from '@/containers/CustomeTooltipJoyRide'
@ -133,7 +138,10 @@ function Hub() {
if (debouncedSearchValue.length) {
const fuse = new Fuse(filtered, searchOptions)
// Remove domain from search value (e.g., "huggingface.co/author/model" -> "author/model")
const cleanedSearchValue = debouncedSearchValue.replace(/^https?:\/\/[^/]+\//, '')
const cleanedSearchValue = debouncedSearchValue.replace(
/^https?:\/\/[^/]+\//,
''
)
filtered = fuse.search(cleanedSearchValue).map((result) => result.item)
}
// Apply downloaded filter
@ -647,6 +655,15 @@ function Hub() {
?.length || 0}
</span>
</div>
{filteredModels[virtualItem.index].tools && (
<div className="flex items-center gap-1">
<IconTool
size={17}
className="text-main-view-fg/50"
title={t('hub:tools')}
/>
</div>
)}
{filteredModels[virtualItem.index].quants.length >
1 && (
<div className="flex items-center gap-2 hub-show-variants-step">

View File

@ -29,6 +29,7 @@ export interface CatalogModel {
mmproj_models?: MMProjModel[]
created_at?: string
readme?: string
tools?: boolean
}
export type ModelCatalog = CatalogModel[]