fix: add other category

This commit is contained in:
jialin
2026-02-12 19:38:47 +08:00
parent 16c0e00b4f
commit c67a8c4120
10 changed files with 35 additions and 15 deletions
+16 -4
View File
@@ -1,7 +1,7 @@
import AutoComplete from '@/components/seal-form/auto-complete';
import SealSelect from '@/components/seal-form/seal-select';
import { PageAction } from '@/config';
import { categoryOptions } from '@/pages/llmodels/config';
import { categoryOptions, modelCategoriesMap } from '@/pages/llmodels/config';
import {
CheckCircleFilled,
LoadingOutlined,
@@ -197,9 +197,16 @@ const ModelItem: React.FC<ModelItemProps> = ({
</span>
</Tooltip>
<SealSelect
value={item.category || undefined}
allowNull
value={item.category}
onChange={handleOnCategoryChange}
options={categoryOptions}
options={[
...categoryOptions,
{
label: intl.formatMessage({ id: 'common.option.other' }),
value: null
}
]}
placeholder={intl.formatMessage({
id: 'models.form.categories'
})}
@@ -207,7 +214,12 @@ const ModelItem: React.FC<ModelItemProps> = ({
<Tooltip
title={intl.formatMessage({ id: 'providers.form.model.test.tips' })}
>
<Button type="link" size="small" onClick={handleTestModel}>
<Button
type="link"
size="small"
onClick={handleTestModel}
disabled={item.category !== modelCategoriesMap.llm || !item.name}
>
{testLoading ? (
<LoadingOutlined />
) : (