瀏覽代碼

Fix: LLM with ___ return cannot be deleted #5585 (#5587)

### What problem does this PR solve?

Fix: LLM with ___ return cannot be deleted #5585

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.1
balibabu 8 月之前
父節點
當前提交
a283fefd18
No account linked to committer's email address
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1
    1
      web/src/hooks/llm-hooks.tsx
  2. 3
    1
      web/src/pages/user-setting/setting-model/index.tsx

+ 1
- 1
web/src/hooks/llm-hooks.tsx 查看文件

name: key, name: key,
logo: factoryList.find((x) => x.name === key)?.logo ?? '', logo: factoryList.find((x) => x.name === key)?.logo ?? '',
...value, ...value,
llm: value.llm.map((x) => ({ ...x, name: getRealModelName(x.name) })),
llm: value.llm.map((x) => ({ ...x, name: x.name })),
})); }));
}, [myLlmList, factoryList]); }, [myLlmList, factoryList]);



+ 3
- 1
web/src/pages/user-setting/setting-model/index.tsx 查看文件

import { LLMFactory } from '@/constants/llm'; import { LLMFactory } from '@/constants/llm';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks'; import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { LlmItem, useSelectLlmList } from '@/hooks/llm-hooks'; import { LlmItem, useSelectLlmList } from '@/hooks/llm-hooks';
import { getRealModelName } from '@/utils/llm-util';
import { CloseCircleOutlined, SettingOutlined } from '@ant-design/icons'; import { CloseCircleOutlined, SettingOutlined } from '@ant-design/icons';
import { import {
Button, Button,
renderItem={(item) => ( renderItem={(item) => (
<List.Item> <List.Item>
<Space> <Space>
{item.name} <Tag color="#b8b8b8">{item.type}</Tag>
{getRealModelName(item.name)}
<Tag color="#b8b8b8">{item.type}</Tag>
<Tooltip title={t('delete', { keyPrefix: 'common' })}> <Tooltip title={t('delete', { keyPrefix: 'common' })}>
<Button type={'text'} onClick={handleDeleteLlm(item.name)}> <Button type={'text'} onClick={handleDeleteLlm(item.name)}>
<CloseCircleOutlined style={{ color: '#D92D20' }} /> <CloseCircleOutlined style={{ color: '#D92D20' }} />

Loading…
取消
儲存