mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 17:16:52 +08:00
Feat: Extract the save buttons for dataset and chat configurations to separate files to increase permission control #3221 (#9803)
### What problem does this PR solve? Feat: Extract the save buttons for dataset and chat configurations to separate files to increase permission control #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Button, ButtonLoading } from '@/components/ui/button';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Form } from '@/components/ui/form';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { DatasetMetadata } from '@/constants/chat';
|
||||
@ -18,6 +18,7 @@ import { z } from 'zod';
|
||||
import ChatBasicSetting from './chat-basic-settings';
|
||||
import { ChatModelSettings } from './chat-model-settings';
|
||||
import { ChatPromptEngine } from './chat-prompt-engine';
|
||||
import { SavingButton } from './saving-button';
|
||||
import { useChatSettingSchema } from './use-chat-setting-schema';
|
||||
|
||||
type ChatSettingsProps = { switchSettingVisible(): void };
|
||||
@ -110,9 +111,7 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||
<Button variant={'outline'} onClick={switchSettingVisible}>
|
||||
{t('chat.cancel')}
|
||||
</Button>
|
||||
<ButtonLoading type="submit" loading={loading}>
|
||||
{t('common.save')}
|
||||
</ButtonLoading>
|
||||
<SavingButton loading={loading}></SavingButton>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
16
web/src/pages/next-chats/chat/app-settings/saving-button.tsx
Normal file
16
web/src/pages/next-chats/chat/app-settings/saving-button.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
import { ButtonLoading } from '@/components/ui/button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
type SaveButtonProps = {
|
||||
loading: boolean;
|
||||
};
|
||||
|
||||
export function SavingButton({ loading }: SaveButtonProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<ButtonLoading type="submit" loading={loading}>
|
||||
{t('common.save')}
|
||||
</ButtonLoading>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user