Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: dataset page enter key to save (#13035)

chanx00c392e633a9
diff --git a/web/src/components/ragflow-avatar.tsx b/web/src/components/ragflow-avatar.tsx
index e3bfc5700e..e71e6886e8 100644
--- a/web/src/components/ragflow-avatar.tsx
+++ b/web/src/components/ragflow-avatar.tsx
@@ -101,7 +101,6 @@ export const RAGFlowAvatar = memo(
}}
className={cn(
'bg-gradient-to-b',
- `from-[${from}] to-[${to}]`,
'flex items-center justify-center',
'text-white ',
{ 'rounded-md': !isPerson },
diff --git a/web/src/components/ui/modal/modal.tsx b/web/src/components/ui/modal/modal.tsx
index a3f6d06fe1..e62e0c1651 100644
--- a/web/src/components/ui/modal/modal.tsx
+++ b/web/src/components/ui/modal/modal.tsx
@@ -4,6 +4,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
import { Loader, X } from 'lucide-react';
import { FC, ReactNode, useCallback, useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
+import { DialogDescription } from '../dialog';
import { createPortalModal } from './modal-manage';
export interface ModalProps {
@@ -184,6 +185,7 @@ const Modal: ModalType = ({
style={style}
onClick={(e) => e.stopPropagation()}
>
+ <DialogDescription></DialogDescription>
{/* title */}
{title && (
<div
diff --git a/web/src/pages/datasets/dataset-creating-dialog.tsx b/web/src/pages/datasets/dataset-creating-dialog.tsx
index 75202838df..39e155732c 100644
--- a/web/src/pages/datasets/dataset-creating-dialog.tsx
+++ b/web/src/pages/datasets/dataset-creating-dialog.tsx
@@ -3,6 +3,7 @@ import { ButtonLoading } from '@/components/ui/button';
import {
Dialog,
DialogContent,
+ DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
@@ -155,10 +156,20 @@ export function DatasetCreatingDialog({
return (
<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>
<DialogTitle>{t('knowledgeList.createKnowledgeBase')}</DialogTitle>
</DialogHeader>
+ <DialogDescription></DialogDescription>
<InputForm onOk={onOk}></InputForm>
<DialogFooter>
<ButtonLoading type="submit" form={FormId} loading={loading}>
diff --git a/web/vite.config.ts b/web/vite.config.ts
index 1d54c6d04b..833aebcb9a 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -101,6 +101,12 @@ export default defineConfig(({ mode, command }) => {
experimentalMinChunkSize: 30 * 1024,
chunkSizeWarningLimit: 1000,
rollupOptions: {
+ onwarn(warning, warn) {
+ if (warning.code === 'EMPTY_BUNDLE') {
+ return;
+ }
+ warn(warning);
+ },
output: {
manualChunks(id) {
// if (id.includes('src/components')) {