From 67f027c3064c6f1ea2007a63bed41d6fa6b6d512 Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 31 Jul 2026 13:54:59 +0800 Subject: [PATCH] Feat: Add a link to create a template to the operator parameter of the compiler operator. (#17563) --- .../compilation-template-form-field.tsx | 6 ++++ web/src/components/ragflow-form.tsx | 33 ++++++++++++++----- web/src/locales/en.ts | 1 + web/src/locales/zh.ts | 1 + 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/web/src/components/compilation-template-form-field.tsx b/web/src/components/compilation-template-form-field.tsx index 1d9175fd07..8369e5ef53 100644 --- a/web/src/components/compilation-template-form-field.tsx +++ b/web/src/components/compilation-template-form-field.tsx @@ -1,5 +1,6 @@ import { RAGFlowFormItem } from '@/components/ragflow-form'; import { useCompilationTemplateGroupOptions } from '@/hooks/use-compilation-template-group-request'; +import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks'; import { useTranslation } from 'react-i18next'; import { SelectWithSearch } from './originui/select-with-search'; @@ -13,12 +14,17 @@ export function CompilationTemplateFormField({ name = 'parser_config.compilation_template_group_id', }: CompilationTemplateFormFieldProps) { const { t } = useTranslation(); + const { navigateToAgents } = useNavigatePage(); const options = useCompilationTemplateGroupOptions(); return ( diff --git a/web/src/components/ragflow-form.tsx b/web/src/components/ragflow-form.tsx index 72fddad41a..2a46fdcfbe 100644 --- a/web/src/components/ragflow-form.tsx +++ b/web/src/components/ragflow-form.tsx @@ -6,6 +6,7 @@ import { FormMessage, } from '@/components/ui/form'; import { cn } from '@/lib/utils'; +import { ArrowUpRight } from 'lucide-react'; import { ReactNode, cloneElement, isValidElement } from 'react'; import { ControllerRenderProps, @@ -23,6 +24,10 @@ type RAGFlowFormItemProps = { labelClassName?: string; valueClassName?: string; className?: string; + labelLink?: { + text: ReactNode; + onClick: () => void; + }; } & Pick, 'rules'>; export function RAGFlowFormItem({ @@ -36,6 +41,7 @@ export function RAGFlowFormItem({ valueClassName, className, rules, + labelLink, }: RAGFlowFormItemProps) { const form = useFormContext(); return ( @@ -47,19 +53,30 @@ export function RAGFlowFormItem({ {label && ( - - {label} - +
+ + {label} + + {labelLink && ( +
+ {labelLink.text} + +
+ )} +
)}