Fix: knowledge base's embedded model form layout and dependency imports in the main branch. #9869 (#10160)

### What problem does this PR solve?

Fix: Fixed the knowledge base's embedded model form layout and
dependency imports in the main branch.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-09-19 09:57:21 +08:00
committed by GitHub
parent 4693c5382a
commit a0ccbec8bd
3 changed files with 6 additions and 7 deletions

View File

@ -17,7 +17,7 @@ export function MaxTokenNumberFormField({ max = 2048, initialValue }: IProps) {
tooltip={t('chunkTokenNumberTip')} tooltip={t('chunkTokenNumberTip')}
max={max} max={max}
defaultValue={initialValue ?? 0} defaultValue={initialValue ?? 0}
layout={FormLayout.Horizontal} layout={FormLayout.Vertical}
></SliderInputFormField> ></SliderInputFormField>
); );
} }

View File

@ -1,6 +1,6 @@
import { FormLayout } from '@/constants/form'; import { FormLayout } from '@/constants/form';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { ReactNode } from 'react'; import { ReactNode, useMemo } from 'react';
import { useFormContext } from 'react-hook-form'; import { useFormContext } from 'react-hook-form';
import { SingleFormSlider } from './ui/dual-range-slider'; import { SingleFormSlider } from './ui/dual-range-slider';
import { import {
@ -40,7 +40,7 @@ export function SliderInputFormField({
}: SliderInputFormFieldProps) { }: SliderInputFormFieldProps) {
const form = useFormContext(); const form = useFormContext();
const isHorizontal = layout === FormLayout.Horizontal; const isHorizontal = useMemo(() => layout === FormLayout.Vertical, [layout]);
return ( return (
<FormField <FormField

View File

@ -70,16 +70,15 @@ export function EmbeddingModelItem() {
name={'embd_id'} name={'embd_id'}
render={({ field }) => ( render={({ field }) => (
<FormItem className=" items-center space-y-0 "> <FormItem className=" items-center space-y-0 ">
<div className=""> <div className="flex items-center">
<FormLabel <FormLabel
required required
tooltip={t('embeddingModelTip')} tooltip={t('embeddingModelTip')}
className="text-sm whitespace-wrap " className="text-sm whitespace-wrap w-1/4"
> >
<span className="text-destructive mr-1"> *</span>
{t('embeddingModel')} {t('embeddingModel')}
</FormLabel> </FormLabel>
<div className="text-muted-foreground"> <div className="text-muted-foreground w-3/4">
<FormControl> <FormControl>
<RAGFlowSelect <RAGFlowSelect
{...field} {...field}