feat(web): model add volcano provider

This commit is contained in:
zhaoying
2026-03-25 14:24:13 +08:00
parent 8873078006
commit 49364802c2
11 changed files with 21 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -608,6 +608,7 @@ export const en = {
official: 'Official',
deprecated: 'Deprecated',
image: 'Image',
llm: 'LLM',
chat: 'Chat',
embedding: 'Embedding',

View File

@@ -1246,6 +1246,7 @@ export const zh = {
official: '官方',
deprecated: '已弃用',
image: '图片',
llm: 'LLM',
chat: 'Chat',
embedding: 'Embedding',

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:50:10
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-25 12:27:51
* @Last Modified time: 2026-03-25 14:21:01
*/
/**
* Model List View
@@ -72,10 +72,10 @@ const ModelList = forwardRef<BaseRef, { query: any; handleEdit: (vo?: ModelListI
avatarUrl={getListLogoUrl(item.provider, item.logo)}
avatarText={item.provider[0].toUpperCase()}
title={<Flex vertical gap={6}>
<Tooltip title={t(`modelNew.${item.provider}`)}>
<div className="rb:wrap-break-word rb:line-clamp-1">{t(`modelNew.${item.provider}`)}</div>
<Tooltip title={String(item.provider).charAt(0).toUpperCase() + String(item.provider).slice(1)}>
<div className="rb:wrap-break-word rb:line-clamp-1">{String(item.provider).charAt(0).toUpperCase() + String(item.provider).slice(1)}</div>
</Tooltip>
<Flex gap={8}>{item.tags.map(tag => <Tag key={tag}>{t(`modelNew.${tag}`)}</Tag>)}</Flex>
<Flex gap={8} className="rb:overflow-hidden rb:flex-nowrap rb:w-auto!">{item.tags.map(tag => <Tag key={tag} className="rb:shrink-0">{t(`modelNew.${tag}`)}</Tag>)}</Flex>
</Flex>}
isNeedTooltip={false}
footer={<Row gutter={9} className="rb:pt-2!">

View File

@@ -74,7 +74,7 @@ const ModelSquare = forwardRef <BaseRef, { query: any; }>(({ query }, ref) => {
'rb:text-[#171719]': activeProvider === vo.provider,
})}
onClick={() => setActiveProvider(vo.provider)}
>{t(`modelNew.${vo.provider}`)}</div>
>{String(vo.provider).charAt(0).toUpperCase() + String(vo.provider).slice(1)}</div>
))}
</Space>
{list.filter(vo => vo.provider === activeProvider).map(vo => (
@@ -105,7 +105,7 @@ const ModelSquare = forwardRef <BaseRef, { query: any; }>(({ query }, ref) => {
}
isNeedTooltip={false}
footer={<Flex justify="space-between" align="center" className="rb:text-[#5B6167] rb:text-[12px]">
@{t(`modelNew.${vo.provider}`)}
@{String(item.provider).charAt(0).toUpperCase() + String(item.provider).slice(1)}
<Space size={4}><UsergroupAddOutlined /> {item.add_count}</Space>
</Flex>}
>

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:49:28
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-25 12:27:33
* @Last Modified time: 2026-03-25 14:07:10
*/
/**
* Custom Model Modal
@@ -210,7 +210,7 @@ const CustomModelModal = forwardRef<CustomModelModalRef, CustomModelModalProps>(
url={modelProviderUrl}
hasAll={false}
disabled={isEdit}
format={(items) => items.map((item) => ({ label: t(`modelNew.${item}`), value: String(item) }))}
format={(items) => items.map((item) => ({ label: String(item).charAt(0).toUpperCase() + String(item).slice(1), value: String(item) }))}
/>
</Form.Item>

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:49:20
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-04 11:51:01
* @Last Modified time: 2026-03-25 14:07:08
*/
/**
* Sub-Model Modal
@@ -178,7 +178,7 @@ const SubModelModal = forwardRef<SubModelModalRef, SubModelModalProps>(({
url={modelProviderUrl}
hasAll={false}
format={(items) => items.map((item) => ({
label: t(`modelNew.${typeof item === 'object' ? item.value : item}`),
label: String(typeof item === 'object' ? item.value : item).charAt(0).toUpperCase() + String(typeof item === 'object' ? item.value : item).slice(1),
value: typeof item === 'object' ? item.value : item
}))}
onChange={(value) => handleChangeProvider(value)}

View File

@@ -1,8 +1,8 @@
/*
* @Author: ZhaoYing
* @Date: 2026-02-03 16:49:12
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 16:49:12
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-25 14:14:14
*/
/**
* Model Implementation Component
@@ -106,7 +106,7 @@ const ModelImplement: FC<ModelImplementProps> = ({ type, value, onChange }) => {
></div>
</Flex>
<div className="rb:text-[#5B6167] rb:my-2">{item.api_key}</div>
<Tag className="rb:mb-2">{t(`modelNew.${item.provider}`)}</Tag>
<Tag className="rb:mb-2">{String(item.provider).charAt(0).toUpperCase() + String(item.provider).slice(1)}</Tag>
</div>
)
})}

View File

@@ -111,7 +111,7 @@ const ModelListDetail = forwardRef<ModelListDetailRef, ModelListDetailProps>(({
return (
<RbDrawer
title={<>{t(`modelNew.${data.provider}`)} {t('modelNew.modelList')} ({list.length}{t('modelNew.item')})</>}
title={<>{String(data.provider).charAt(0).toUpperCase() + String(data.provider).slice(1)} {t('modelNew.modelList')} ({list.length}{t('modelNew.item')})</>}
open={open}
onClose={handleClose}
>

View File

@@ -111,7 +111,7 @@ const tabKeys = ['group', 'list', 'square']
<CustomSelect
url={modelProviderUrl}
hasAll={false}
format={(items) => items.map((item) => ({ label: t(`modelNew.${item}`), value: String(item) }))}
format={(items) => items.map((item) => ({ label: String(item).charAt(0).toUpperCase() + String(item).slice(1), value: String(item) }))}
className="rb:w-40"
allowClear={true}
placeholder={t('modelNew.provider')}

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:50:22
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-27 10:22:46
* @Last Modified time: 2026-03-25 14:03:13
*/
/**
* Utility functions for Model Management
@@ -14,6 +14,7 @@ import gpustackIcon from '@/assets/images/model/gpustack.png'
import ollamaIcon from '@/assets/images/model/ollama.svg'
import openaiIcon from '@/assets/images/model/openai.svg'
import xinferenceIcon from '@/assets/images/model/xinference.svg'
import volcanoIcon from '@/assets/images/model/volcano.png'
/**
* Provider icon mapping
@@ -24,7 +25,8 @@ export const ICONS = {
gpustack: gpustackIcon,
ollama: ollamaIcon,
openai: openaiIcon,
xinference: xinferenceIcon
xinference: xinferenceIcon,
volcano: volcanoIcon,
}
/**