mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-10 13:45:44 +08:00
Fix: When adding a chat in the main interface, a warning will automatically pop up (#15685)
### What problem does this PR solve? Fix: When adding a chat in the main interface, a warning will automatically pop up (even if embedding and LLM model have already been configured). ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -235,7 +235,7 @@ export function TreeSelect({
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
className="p-0 w-[var(--radix-popover-trigger-width)]"
|
||||
className="p-0 w-auto min-w-[var(--radix-popover-trigger-width)]"
|
||||
align="start"
|
||||
sideOffset={4}
|
||||
>
|
||||
|
||||
@@ -366,7 +366,7 @@ export const useFetchDefaultModels = () => {
|
||||
};
|
||||
|
||||
export const useFetchDefaultModelDictionary = (showEmptyModelWarn = false) => {
|
||||
const { data: defaultModels } = useFetchDefaultModels();
|
||||
const { data: defaultModels, loading } = useFetchDefaultModels();
|
||||
|
||||
const result = useMemo(() => {
|
||||
const dict: Record<string, string> = {};
|
||||
@@ -377,7 +377,7 @@ export const useFetchDefaultModelDictionary = (showEmptyModelWarn = false) => {
|
||||
return dict;
|
||||
}, [defaultModels]);
|
||||
|
||||
useWarnEmptyModel(showEmptyModelWarn, result.embd_id, result.llm_id);
|
||||
useWarnEmptyModel(showEmptyModelWarn, result.embd_id, result.llm_id, loading);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ export const useFetchAllMemoryList = () => {
|
||||
queryFn: async () => {
|
||||
const { data: response } = await memoryService.getMemoryList(
|
||||
{
|
||||
params: { page_size: 100000000, page: 1 },
|
||||
params: { page_size: 100, page: 1 },
|
||||
data: {},
|
||||
},
|
||||
true,
|
||||
|
||||
@@ -90,7 +90,7 @@ export const useFetchTenantInfo = (
|
||||
},
|
||||
});
|
||||
|
||||
useWarnEmptyModel(showEmptyModelWarn, data?.embd_id, data?.llm_id);
|
||||
useWarnEmptyModel(showEmptyModelWarn, data?.embd_id, data?.llm_id, loading);
|
||||
|
||||
return { data, loading };
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@ export const useWarnEmptyModel = (
|
||||
showEmptyModelWarn: boolean,
|
||||
embdId?: string,
|
||||
llmId?: string,
|
||||
loading?: boolean,
|
||||
) => {
|
||||
const { t } = useTranslation();
|
||||
const warnedRef = useRef(false);
|
||||
@@ -18,6 +19,7 @@ export const useWarnEmptyModel = (
|
||||
if (
|
||||
showEmptyModelWarn &&
|
||||
!warnedRef.current &&
|
||||
!loading &&
|
||||
(isEmpty(embdId) || isEmpty(llmId)) &&
|
||||
typeof embdId === 'string' &&
|
||||
typeof llmId === 'string'
|
||||
@@ -39,5 +41,5 @@ export const useWarnEmptyModel = (
|
||||
},
|
||||
});
|
||||
}
|
||||
}, [showEmptyModelWarn, embdId, llmId, navigateToModelSetting, t]);
|
||||
}, [showEmptyModelWarn, embdId, llmId, loading, navigateToModelSetting, t]);
|
||||
};
|
||||
|
||||
@@ -170,6 +170,8 @@ export function GroupedSelectWithSecondaryMenu({
|
||||
>
|
||||
<HoverCardTrigger asChild>
|
||||
<CommandItem
|
||||
value={option.value}
|
||||
keywords={[option.label]}
|
||||
onSelect={() => {}}
|
||||
className="flex items-center justify-between cursor-default"
|
||||
>
|
||||
@@ -205,6 +207,8 @@ export function GroupedSelectWithSecondaryMenu({
|
||||
) : (
|
||||
<CommandItem
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
keywords={[option.label]}
|
||||
onSelect={() => {
|
||||
onChange?.(option.value);
|
||||
setOpen(false);
|
||||
|
||||
@@ -215,7 +215,7 @@ const Chunk = () => {
|
||||
</header>
|
||||
|
||||
<Spin spinning={loading} className="flex-1 h-0" size="large">
|
||||
<div className="relative @container h-full px-5 pb-5 overflow-x-hidden overflow-y-auto">
|
||||
<div className="relative @container h-full px-5 pb-5 overflow-hidden flex flex-col">
|
||||
<div
|
||||
className="
|
||||
sticky top-0 z-[1] bg-bg-base space-y-4 py-5
|
||||
@@ -245,7 +245,7 @@ const Chunk = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-4 flex-1 overflow-y-auto min-h-0">
|
||||
{chunkList.map((item) => (
|
||||
<ChunkCard
|
||||
item={item}
|
||||
|
||||
@@ -83,10 +83,10 @@ export function TestingResult({
|
||||
</FilterPopover>
|
||||
</header>
|
||||
|
||||
<div className="flex-1 h-0">
|
||||
<>
|
||||
{data.chunks?.length > 0 && !loading && (
|
||||
<>
|
||||
<section className="px-5 pb-5 flex flex-col gap-5 overflow-auto h-full scrollbar-thin">
|
||||
<section className="px-5 pb-5 flex flex-col gap-5 overflow-auto scrollbar-thin min-h-0">
|
||||
{data.chunks?.map((x) => (
|
||||
<article key={x.chunk_id}>
|
||||
<Card className="px-5 py-2.5 bg-transparent shadow-none">
|
||||
@@ -96,12 +96,14 @@ export function TestingResult({
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
<RAGFlowPagination
|
||||
total={data.total}
|
||||
onChange={onPaginationChange}
|
||||
current={page}
|
||||
pageSize={pageSize}
|
||||
></RAGFlowPagination>
|
||||
<div className="p-2">
|
||||
<RAGFlowPagination
|
||||
total={data.total}
|
||||
onChange={onPaginationChange}
|
||||
current={page}
|
||||
pageSize={pageSize}
|
||||
></RAGFlowPagination>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{!data.chunks?.length && !loading && (
|
||||
@@ -119,7 +121,7 @@ export function TestingResult({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user