mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 23:16:58 +08:00
### What problem does this PR solve? fix(dataset): Optimized the dataset configuration page UI - Added the DataPipelineSelect component for selecting data pipelines - Restructured the layout and style of the dataset settings page - Removed unnecessary components and code - Optimized data pipeline configuration - Adjusted the Create Dataset dialog box - Updated the processing log modal style ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
93 lines
2.9 KiB
TypeScript
93 lines
2.9 KiB
TypeScript
import { AvatarUpload } from '@/components/avatar-upload';
|
|
import {
|
|
FormControl,
|
|
FormField,
|
|
FormItem,
|
|
FormLabel,
|
|
FormMessage,
|
|
} from '@/components/ui/form';
|
|
import { Input } from '@/components/ui/input';
|
|
import { useFormContext } from 'react-hook-form';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { EmbeddingModelItem } from './configuration/common-item';
|
|
import { PermissionFormField } from './permission-form-field';
|
|
|
|
export function GeneralForm() {
|
|
const form = useFormContext();
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<>
|
|
<FormField
|
|
control={form.control}
|
|
name="name"
|
|
render={({ field }) => (
|
|
<FormItem className="items-center space-y-0">
|
|
<div className="flex">
|
|
<FormLabel className="text-sm text-muted-foreground whitespace-nowrap w-1/4">
|
|
<span className="text-red-600">*</span>
|
|
{t('common.name')}
|
|
</FormLabel>
|
|
<FormControl className="w-3/4">
|
|
<Input {...field}></Input>
|
|
</FormControl>
|
|
</div>
|
|
<div className="flex pt-1">
|
|
<div className="w-1/4"></div>
|
|
<FormMessage />
|
|
</div>
|
|
</FormItem>
|
|
)}
|
|
/>
|
|
<FormField
|
|
control={form.control}
|
|
name="avatar"
|
|
render={({ field }) => (
|
|
<FormItem className="items-center space-y-0">
|
|
<div className="flex">
|
|
<FormLabel className="text-sm text-muted-foreground whitespace-nowrap w-1/4">
|
|
{t('setting.avatar')}
|
|
</FormLabel>
|
|
<FormControl className="w-3/4">
|
|
<AvatarUpload {...field}></AvatarUpload>
|
|
</FormControl>
|
|
</div>
|
|
<div className="flex pt-1">
|
|
<div className="w-1/4"></div>
|
|
<FormMessage />
|
|
</div>
|
|
</FormItem>
|
|
)}
|
|
/>
|
|
<FormField
|
|
control={form.control}
|
|
name="description"
|
|
render={({ field }) => {
|
|
// null initialize empty string
|
|
if (typeof field.value === 'object' && !field.value) {
|
|
form.setValue('description', ' ');
|
|
}
|
|
return (
|
|
<FormItem className="items-center space-y-0">
|
|
<div className="flex">
|
|
<FormLabel className="text-sm text-muted-foreground whitespace-nowrap w-1/4">
|
|
{t('flow.description')}
|
|
</FormLabel>
|
|
<FormControl className="w-3/4">
|
|
<Input {...field}></Input>
|
|
</FormControl>
|
|
</div>
|
|
<div className="flex pt-1">
|
|
<div className="w-1/4"></div>
|
|
<FormMessage />
|
|
</div>
|
|
</FormItem>
|
|
);
|
|
}}
|
|
/>
|
|
<PermissionFormField></PermissionFormField>
|
|
<EmbeddingModelItem></EmbeddingModelItem>
|
|
</>
|
|
);
|
|
}
|