
>((pre, [key, value]) => {
pre[key] = Object.values(value).map((v) => ({
- label: v === PdfOutputFormat.Json ? 'JSON' : upperFirst(v),
+ label: UppercaseFields.some((x) => x === v)
+ ? upperCase(v)
+ : upperFirst(v),
value: v,
}));
return pre;
diff --git a/web/src/pages/data-flow/form/parser-form/index.tsx b/web/src/pages/data-flow/form/parser-form/index.tsx
index 836f5414e..cfb06e06d 100644
--- a/web/src/pages/data-flow/form/parser-form/index.tsx
+++ b/web/src/pages/data-flow/form/parser-form/index.tsx
@@ -1,4 +1,7 @@
-import { SelectWithSearch } from '@/components/originui/select-with-search';
+import {
+ SelectWithSearch,
+ SelectWithSearchFlagOptionType,
+} from '@/components/originui/select-with-search';
import { RAGFlowFormItem } from '@/components/ragflow-form';
import { BlockButton, Button } from '@/components/ui/button';
import { Form } from '@/components/ui/form';
@@ -49,6 +52,7 @@ type ParserItemProps = {
index: number;
fieldLength: number;
remove: UseFieldArrayRemove;
+ fileFormatOptions: SelectWithSearchFlagOptionType[];
};
export const FormSchema = z.object({
@@ -67,7 +71,13 @@ export const FormSchema = z.object({
export type ParserFormSchemaType = z.infer
;
-function ParserItem({ name, index, fieldLength, remove }: ParserItemProps) {
+function ParserItem({
+ name,
+ index,
+ fieldLength,
+ remove,
+ fileFormatOptions,
+}: ParserItemProps) {
const { t } = useTranslation();
const form = useFormContext();
const ref = useRef(null);
@@ -79,23 +89,15 @@ function ParserItem({ name, index, fieldLength, remove }: ParserItemProps) {
const values = form.getValues();
const parserList = values.setups.slice(); // Adding, deleting, or modifying the parser array will not change the reference.
- const FileFormatOptions = buildOptions(
- FileType,
- t,
- 'dataflow.fileFormatOptions',
- ).filter(
- (x) => x.value !== FileType.Video, // Temporarily hide the video option
- );
-
const filteredFileFormatOptions = useMemo(() => {
const otherFileFormatList = parserList
.filter((_, idx) => idx !== index)
.map((x) => x.fileFormat);
- return FileFormatOptions.filter((x) => {
+ return fileFormatOptions.filter((x) => {
return !otherFileFormatList.includes(x.value);
});
- }, [FileFormatOptions, index, parserList]);
+ }, [fileFormatOptions, index, parserList]);
const Widget =
typeof fileFormat === 'string' && fileFormat in FileFormatWidgetMap
@@ -158,6 +160,14 @@ const ParserForm = ({ node }: INextOperatorForm) => {
const { t } = useTranslation();
const defaultValues = useFormValues(initialParserValues, node);
+ const FileFormatOptions = buildOptions(
+ FileType,
+ t,
+ 'dataflow.fileFormatOptions',
+ ).filter(
+ (x) => x.value !== FileType.Video, // Temporarily hide the video option
+ );
+
const form = useForm>({
defaultValues,
resolver: zodResolver(FormSchema),
@@ -194,12 +204,15 @@ const ParserForm = ({ node }: INextOperatorForm) => {
index={index}
fieldLength={fields.length}
remove={remove}
+ fileFormatOptions={FileFormatOptions}
>
);
})}
-
- {t('dataflow.addParser')}
-
+ {fields.length < FileFormatOptions.length && (
+
+ {t('dataflow.addParser')}
+
+ )}
diff --git a/web/src/pages/data-flow/form/tokenizer-form/index.tsx b/web/src/pages/data-flow/form/tokenizer-form/index.tsx
index 1b4975db9..cc949d5cd 100644
--- a/web/src/pages/data-flow/form/tokenizer-form/index.tsx
+++ b/web/src/pages/data-flow/form/tokenizer-form/index.tsx
@@ -58,6 +58,7 @@ const TokenizerForm = ({ node }: INextOperatorForm) => {
{(field) => (
-
+
{isParsing || running ? t('dataflow.running') : t('flow.run')}
diff --git a/web/src/pages/data-flow/log-sheet/dataflow-timeline.tsx b/web/src/pages/data-flow/log-sheet/dataflow-timeline.tsx
index 25787a2e4..e15465baf 100644
--- a/web/src/pages/data-flow/log-sheet/dataflow-timeline.tsx
+++ b/web/src/pages/data-flow/log-sheet/dataflow-timeline.tsx
@@ -78,7 +78,7 @@ export function DataflowTimeline({ traceList }: DataflowTimelineProps) {
- {progress}%
+ {progress.toFixed(2)}%
diff --git a/web/src/pages/data-flow/log-sheet/index.tsx b/web/src/pages/data-flow/log-sheet/index.tsx
index a5bcb2787..546d28328 100644
--- a/web/src/pages/data-flow/log-sheet/index.tsx
+++ b/web/src/pages/data-flow/log-sheet/index.tsx
@@ -55,10 +55,10 @@ export function LogSheet({
return (
e.preventDefault()}
>
-
+
{t('flow.log')}
{isCompleted && (
@@ -82,30 +82,32 @@ export function LogSheet({
)}
-
+
- {isParsing ? (
-
- ) : (
-
- )}
+
+ {isParsing ? (
+
+ ) : (
+
+ )}
+
);
diff --git a/web/src/pages/home/banner.tsx b/web/src/pages/home/banner.tsx
index 3173a40ba..973e417aa 100644
--- a/web/src/pages/home/banner.tsx
+++ b/web/src/pages/home/banner.tsx
@@ -42,7 +42,7 @@ export function Banner() {
export function NextBanner() {
const { t } = useTranslation();
return (
-
+
{t('header.welcome')}
RAGFlow
diff --git a/web/src/pages/home/index.tsx b/web/src/pages/home/index.tsx
index 54b2f83d5..137f50ec5 100644
--- a/web/src/pages/home/index.tsx
+++ b/web/src/pages/home/index.tsx
@@ -4,15 +4,13 @@ import { Datasets } from './datasets';
const Home = () => {
return (
-
+
);
};