fix: model selector overlay (#5511)

This commit is contained in:
Archer
2025-08-20 21:58:13 +08:00
committed by GitHub
parent c7fd9308a3
commit e19eddf976
7 changed files with 49 additions and 37 deletions

View File

@@ -100,6 +100,7 @@ description: FastGPT 文档目录
- [/docs/upgrading/4-11/4111](/docs/upgrading/4-11/4111)
- [/docs/upgrading/4-12/4120](/docs/upgrading/4-12/4120)
- [/docs/upgrading/4-12/4121](/docs/upgrading/4-12/4121)
- [/docs/upgrading/4-12/4122](/docs/upgrading/4-12/4122)
- [/docs/upgrading/4-8/40](/docs/upgrading/4-8/40)
- [/docs/upgrading/4-8/41](/docs/upgrading/4-8/41)
- [/docs/upgrading/4-8/42](/docs/upgrading/4-8/42)

View File

@@ -0,0 +1,23 @@
---
title: 'V4.12.2(进行中)'
description: 'FastGPT V4.12.2 更新说明'
---
## 🚀 新增内容
## ⚙️ 优化
## 🐛 修复
1. 独立对话页部分 UI 异常。
2. 多选选择器导致的页面崩溃。
3. 移动端,分享链接,异常加载了登录态对话页的导航。
4. 用户同步可能出现写冲突问题。
5. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
## 🔨 工具更新
1. Doc2x 工具响应值异常。

View File

@@ -19,7 +19,7 @@
"document/content/docs/introduction/development/custom-models/ollama.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/design/design_plugin.mdx": "2025-07-24T13:00:27+08:00",
"document/content/docs/introduction/development/design/design_plugin.mdx": "2025-08-20T19:00:48+08:00",
"document/content/docs/introduction/development/docker.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/faq.mdx": "2025-08-12T22:22:18+08:00",
"document/content/docs/introduction/development/intro.mdx": "2025-08-05T23:20:39+08:00",
@@ -81,7 +81,7 @@
"document/content/docs/introduction/guide/knowledge_base/websync.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/guide/knowledge_base/yuque_dataset.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/bing_search_plugin.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/dev_system_tool.mdx": "2025-08-18T14:59:46+08:00",
"document/content/docs/introduction/guide/plugins/dev_system_tool.mdx": "2025-08-20T19:00:48+08:00",
"document/content/docs/introduction/guide/plugins/doc2x_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/google_search_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/searxng_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",

View File

@@ -347,7 +347,7 @@
"core.chat.Mark": "Mark Expected Answer",
"core.chat.Mark Description": "The current marking function is in beta.\n\nAfter clicking to add a mark, you need to select a Dataset to store the marked data. You can quickly mark questions and expected answers through this function to guide the model's next answer.\n\nCurrently, the marking function is the same as other data in the Dataset and is affected by the model, which does not mean that it will 100% meet expectations after marking.\n\nMarking data is only synchronized with the Dataset in one direction. If the Dataset modifies the marked data, the marked data displayed in the log cannot be synchronized.",
"core.chat.Mark Description Title": "Marking Function Introduction",
"core.chat.New Chat": "New Chat",
"core.chat.New Chat": "New",
"core.chat.Pin": "Pin",
"core.chat.Question Guide": "Guess What You Want to Ask",
"core.chat.Quote": "Quote",
@@ -355,7 +355,7 @@
"core.chat.Read Mark Description": "View Marking Function Introduction",
"core.chat.Recent use": "Recently Used",
"core.chat.Record": "Voice Input",
"core.chat.Restart": "Restart Chat",
"core.chat.Restart": "Restart",
"core.chat.Run test": "Run Preview",
"core.chat.Select dataset": "Select Dataset",
"core.chat.Select dataset Desc": "Select a Dataset to store the expected answer",

View File

@@ -4,18 +4,13 @@ import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import MySelect, { type SelectProps } from '@fastgpt/web/components/common/MySelect';
import { HUGGING_FACE_ICON } from '@fastgpt/global/common/system/constants';
import { Box, Flex, HStack } from '@chakra-ui/react';
import { Box, Flex } from '@chakra-ui/react';
import Avatar from '@fastgpt/web/components/common/Avatar';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
import dynamic from 'next/dynamic';
import { ModelProviderList } from '@fastgpt/global/core/ai/provider';
import MultipleRowSelect from '@fastgpt/web/components/common/MySelect/MultipleRowSelect';
import { getModelFromList } from '@fastgpt/global/core/ai/model';
const ModelPriceModal = dynamic(() =>
import('@/components/core/ai/ModelTable').then((mod) => mod.ModelPriceModal)
);
type Props = SelectProps & {
disableTip?: string;
};
@@ -88,29 +83,22 @@ const OneRowSelector = ({ list, onChange, disableTip, ...props }: Props) => {
}}
>
<MyTooltip label={disableTip}>
<ModelPriceModal>
{({ onOpen }) => (
<MySelect
className="nowheel"
isDisabled={!!disableTip}
list={avatarList}
placeholder={t('common:not_model_config')}
h={'40px'}
{...props}
onChange={(e) => {
if (e === 'price') {
onOpen();
return;
}
return onChange?.(e);
}}
/>
)}
</ModelPriceModal>
<MySelect
className="nowheel"
isDisabled={!!disableTip}
list={avatarList}
placeholder={t('common:not_model_config')}
h={'40px'}
{...props}
onChange={(e) => {
return onChange?.(e);
}}
/>
</MyTooltip>
</Box>
);
};
const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props }: Props) => {
const { t } = useTranslation();
const { llmModelList, embeddingModelList, ttsModelList, sttModelList, reRankModelList } =
@@ -184,7 +172,7 @@ const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props
[onChange]
);
const SelectedModel = useMemo(() => {
const SelectedLabel = useMemo(() => {
if (!props.value) return <>{t('common:not_model_config')}</>;
const modelData = getModelFromList(modelList, props.value);
@@ -193,7 +181,7 @@ const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props
setValue([modelData.provider, props.value]);
return (
<HStack spacing={1}>
<Flex alignItems={'center'} py={1}>
<Avatar
borderRadius={'0'}
mr={2}
@@ -201,8 +189,8 @@ const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props
fallbackSrc={HUGGING_FACE_ICON}
w={avatarSize}
/>
<Box>{modelData?.name}</Box>
</HStack>
<Box noOfLines={1}>{modelData?.name}</Box>
</Flex>
);
}, [modelList, props.value, t, avatarSize]);
@@ -216,7 +204,7 @@ const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props
>
<MyTooltip label={disableTip}>
<MultipleRowSelect
label={SelectedModel}
label={SelectedLabel}
list={selectorList}
onSelect={onSelect}
value={value}
@@ -234,7 +222,7 @@ const MultipleRowSelector = ({ list, onChange, disableTip, placeholder, ...props
};
const AIModelSelector = (props: Props) => {
return props.list.length > 10 ? (
return props.list.length > 100 ? (
<MultipleRowSelector {...props} />
) : (
<OneRowSelector {...props} />

View File

@@ -256,7 +256,7 @@ const ChatInput = ({
gap={[0, 1]}
>
{/* 左侧自定义按钮组 */}
<Flex alignItems={'center'} gap={2}>
<Flex alignItems={'center'} gap={2} flex={'1 0 0'} w={0}>
{InputLeftComponent}
</Flex>

View File

@@ -241,7 +241,7 @@ const HomeChatWindow = ({ myApps }: Props) => {
<>
{/* 模型选择 */}
{availableModels.length > 0 && (
<Box w="auto">
<Box w={[0, 'auto']} flex={['1 0 0', '0 0 auto']}>
<AIModelSelector
h={['30px', '36px']}
boxShadow={'none'}