mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 15:06:50 +08:00
### What problem does this PR solve? Feat: Render chat page #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '@/components/ui/sheet';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { ChatSettings } from './chat-settings';
|
||||
|
||||
export function ChatSettingSheet({ children }: PropsWithChildren) {
|
||||
return (
|
||||
<Sheet>
|
||||
<SheetTrigger asChild>{children}</SheetTrigger>
|
||||
<SheetContent>
|
||||
<SheetHeader>
|
||||
<SheetTitle>Chat Settings</SheetTitle>
|
||||
</SheetHeader>
|
||||
<ChatSettings></ChatSettings>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
);
|
||||
}
|
||||
@ -7,8 +7,9 @@ import { ChatModelSettings } from './chat-model-settings';
|
||||
import { ChatPromptEngine } from './chat-prompt-engine';
|
||||
import { useChatSettingSchema } from './use-chat-setting-schema';
|
||||
|
||||
export function AppSettings() {
|
||||
export function ChatSettings() {
|
||||
const formSchema = useChatSettingSchema();
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
@ -32,27 +33,19 @@ export function AppSettings() {
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="py-6 w-[500px] max-w-[25%] ">
|
||||
<div className="text-2xl font-bold mb-4 text-colors-text-neutral-strong px-6">
|
||||
App settings
|
||||
</div>
|
||||
<div className="overflow-auto max-h-[81vh] px-6 ">
|
||||
<FormProvider {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
|
||||
<ChatBasicSetting></ChatBasicSetting>
|
||||
<ChatPromptEngine></ChatPromptEngine>
|
||||
<ChatModelSettings></ChatModelSettings>
|
||||
</form>
|
||||
</FormProvider>
|
||||
</div>
|
||||
<div className="p-6 text-center">
|
||||
<p className="text-colors-text-neutral-weak mb-1">
|
||||
There are unsaved changes
|
||||
</p>
|
||||
<Button variant={'tertiary'} className="w-full">
|
||||
Update
|
||||
</Button>
|
||||
</div>
|
||||
<section className="py-6">
|
||||
<FormProvider {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-6 overflow-auto max-h-[88vh] pr-4"
|
||||
>
|
||||
<ChatBasicSetting></ChatBasicSetting>
|
||||
<ChatPromptEngine></ChatPromptEngine>
|
||||
<ChatModelSettings></ChatModelSettings>
|
||||
</form>
|
||||
</FormProvider>
|
||||
|
||||
<Button className="w-full my-4">Update</Button>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user