mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-07 02:55:08 +08:00
Fix: dataset page enter key to save (#13035)
### What problem does this PR solve? Fix dataset page enter key to save Fix the warnings and optimize the code. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -101,7 +101,6 @@ export const RAGFlowAvatar = memo(
|
|||||||
}}
|
}}
|
||||||
className={cn(
|
className={cn(
|
||||||
'bg-gradient-to-b',
|
'bg-gradient-to-b',
|
||||||
`from-[${from}] to-[${to}]`,
|
|
||||||
'flex items-center justify-center',
|
'flex items-center justify-center',
|
||||||
'text-white ',
|
'text-white ',
|
||||||
{ 'rounded-md': !isPerson },
|
{ 'rounded-md': !isPerson },
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|||||||
import { Loader, X } from 'lucide-react';
|
import { Loader, X } from 'lucide-react';
|
||||||
import { FC, ReactNode, useCallback, useEffect, useMemo } from 'react';
|
import { FC, ReactNode, useCallback, useEffect, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { DialogDescription } from '../dialog';
|
||||||
import { createPortalModal } from './modal-manage';
|
import { createPortalModal } from './modal-manage';
|
||||||
|
|
||||||
export interface ModalProps {
|
export interface ModalProps {
|
||||||
@ -184,6 +185,7 @@ const Modal: ModalType = ({
|
|||||||
style={style}
|
style={style}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
|
<DialogDescription></DialogDescription>
|
||||||
{/* title */}
|
{/* title */}
|
||||||
{title && (
|
{title && (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { ButtonLoading } from '@/components/ui/button';
|
|||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
DialogFooter,
|
DialogFooter,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
@ -155,10 +156,20 @@ export function DatasetCreatingDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open onOpenChange={hideModal}>
|
<Dialog open onOpenChange={hideModal}>
|
||||||
<DialogContent className="sm:max-w-[425px] focus-visible:!outline-none flex flex-col">
|
<DialogContent
|
||||||
|
className="sm:max-w-[425px] focus-visible:!outline-none flex flex-col"
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && !e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
const form = document.getElementById(FormId) as HTMLFormElement;
|
||||||
|
form?.requestSubmit();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{t('knowledgeList.createKnowledgeBase')}</DialogTitle>
|
<DialogTitle>{t('knowledgeList.createKnowledgeBase')}</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
<DialogDescription></DialogDescription>
|
||||||
<InputForm onOk={onOk}></InputForm>
|
<InputForm onOk={onOk}></InputForm>
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<ButtonLoading type="submit" form={FormId} loading={loading}>
|
<ButtonLoading type="submit" form={FormId} loading={loading}>
|
||||||
|
|||||||
@ -101,6 +101,12 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
experimentalMinChunkSize: 30 * 1024,
|
experimentalMinChunkSize: 30 * 1024,
|
||||||
chunkSizeWarningLimit: 1000,
|
chunkSizeWarningLimit: 1000,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
onwarn(warning, warn) {
|
||||||
|
if (warning.code === 'EMPTY_BUNDLE') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
warn(warning);
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
manualChunks(id) {
|
manualChunks(id) {
|
||||||
// if (id.includes('src/components')) {
|
// if (id.includes('src/components')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user