feat: Update model label format to include provider information (#2793)

* feat: Update model label format to include provider information

* feat: Improve AddModelPopup layout and button styling
This commit is contained in:
Asurada 2025-03-04 15:36:07 +08:00 committed by GitHub
parent 93c2a94658
commit 846e7ca097
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -39,7 +39,7 @@ const ModelSettings: FC = () => {
options: sortBy(p.models, 'name')
.filter((m) => !isEmbeddingModel(m))
.map((m) => ({
label: m.name,
label: `${m.name} | ${p.isSystem ? t(`provider.${p.id}`) : p.name}`,
value: getModelUniqId(m)
}))
}))

View File

@ -2,7 +2,7 @@ import { TopView } from '@renderer/components/TopView'
import { useProvider } from '@renderer/hooks/useProvider'
import { Model, Provider } from '@renderer/types'
import { getDefaultGroupName } from '@renderer/utils'
import { Button, Form, FormProps, Input, Modal } from 'antd'
import { Button, Flex, Form, FormProps, Input, Modal } from 'antd'
import { find } from 'lodash'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
@ -120,10 +120,14 @@ const PopupContainer: React.FC<Props> = ({ title, provider, resolve }) => {
tooltip={t('settings.models.add.group_name.tooltip')}>
<Input placeholder={t('settings.models.add.group_name.placeholder')} spellCheck={false} />
</Form.Item>
<Form.Item label=" ">
<Button type="primary" htmlType="submit">
{t('settings.models.add.add_model')}
</Button>
<Form.Item style={{ marginBottom: 15, textAlign: 'center' }}>
<Flex justify="center" align="center" style={{ position: 'relative' }}>
<div>
<Button type="primary" htmlType="submit" size="middle">
{t('settings.models.add.add_model')}
</Button>
</div>
</Flex>
</Form.Item>
</Form>
</Modal>