mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: After deleting all conversation lists, the chat input box can still be used for input. #4907 (#4909)
### What problem does this PR solve? Fix: After deleting all conversation lists, the chat input box can still be used for input. #4907 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { LlmModelType } from '@/constants/knowledge';
|
||||
import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
|
||||
import { useMemo } from 'react';
|
||||
import { getLLMIconName, getLlmNameAndFIdByLlmId } from '@/utils/llm-util';
|
||||
import { LlmIcon } from '../svg-icon';
|
||||
|
||||
interface IProps {
|
||||
id?: string;
|
||||
@ -10,22 +9,19 @@ interface IProps {
|
||||
}
|
||||
|
||||
const LLMLabel = ({ value }: IProps) => {
|
||||
const modelOptions = useComposeLlmOptionsByModelTypes([
|
||||
LlmModelType.Chat,
|
||||
LlmModelType.Image2text,
|
||||
]);
|
||||
const { llmName, fId } = getLlmNameAndFIdByLlmId(value);
|
||||
|
||||
const label = useMemo(() => {
|
||||
for (const item of modelOptions) {
|
||||
for (const option of item.options) {
|
||||
if (option.value === value) {
|
||||
return option.label;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [modelOptions, value]);
|
||||
|
||||
return <div>{label}</div>;
|
||||
return (
|
||||
<div className="flex items-center gap-1">
|
||||
<LlmIcon
|
||||
name={getLLMIconName(fId, llmName)}
|
||||
width={20}
|
||||
height={20}
|
||||
size={'small'}
|
||||
/>
|
||||
{llmName}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LLMLabel;
|
||||
|
||||
@ -54,7 +54,11 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
||||
{...formItemLayout}
|
||||
rules={[{ required: true, message: t('modelMessage') }]}
|
||||
>
|
||||
<Select options={modelOptions} showSearch />
|
||||
<Select
|
||||
options={modelOptions}
|
||||
showSearch
|
||||
popupMatchSelectWidth={false}
|
||||
/>
|
||||
</Form.Item>
|
||||
<div className="border rounded-md">
|
||||
<div className="flex justify-between bg-slate-100 p-2 mb-2">
|
||||
|
||||
Reference in New Issue
Block a user