From f2c5ad170d35671440bd730ea1073a1a1665ff66 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Tue, 19 Aug 2025 17:35:32 +0800 Subject: [PATCH] Fix(search): Search application list supports renaming function #3221 (#9555) ### What problem does this PR solve? Fix (search): Search application list supports renaming function #3221 -Update the search application list page and add a renaming operation entry -Modify the search application details interface to support obtaining detailed information -Optimize search settings page layout and style ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../components/chunk-method-dialog/index.tsx | 6 +- web/src/components/delimiter-form-field.tsx | 4 +- .../components/excel-to-html-form-field.tsx | 4 +- .../graph-rag-form-fields.tsx | 4 +- .../raptor-form-fields.tsx | 4 +- web/src/components/ragflow-avatar.tsx | 21 ++++--- .../components/slider-input-form-field.tsx | 4 +- web/src/pages/next-search/index.tsx | 2 +- .../search-setting-aisummery-config.tsx | 24 ++++--- web/src/pages/next-search/search-setting.tsx | 41 +++++------- web/src/pages/next-searches/hooks.ts | 16 ++++- web/src/pages/next-searches/index.tsx | 63 +++++++++++++++++-- web/src/pages/next-searches/search-card.tsx | 8 ++- .../pages/next-searches/search-dropdown.tsx | 18 ++++-- 14 files changed, 152 insertions(+), 67 deletions(-) diff --git a/web/src/components/chunk-method-dialog/index.tsx b/web/src/components/chunk-method-dialog/index.tsx index a5613787f..783212f36 100644 --- a/web/src/components/chunk-method-dialog/index.tsx +++ b/web/src/components/chunk-method-dialog/index.tsx @@ -317,7 +317,11 @@ export function ChunkMethodDialog({ )} {showGraphRagItems(selectedTag as DocumentParserType) && - useGraphRag && } + useGraphRag && ( + + + + )} {showEntityTypes && } diff --git a/web/src/components/delimiter-form-field.tsx b/web/src/components/delimiter-form-field.tsx index cc1affd56..7374945e3 100644 --- a/web/src/components/delimiter-form-field.tsx +++ b/web/src/components/delimiter-form-field.tsx @@ -50,10 +50,10 @@ export function DelimiterFormField() { } return ( -
+
{t('knowledgeDetails.delimiter')} diff --git a/web/src/components/excel-to-html-form-field.tsx b/web/src/components/excel-to-html-form-field.tsx index 90fa5de81..a51587405 100644 --- a/web/src/components/excel-to-html-form-field.tsx +++ b/web/src/components/excel-to-html-form-field.tsx @@ -25,10 +25,10 @@ export function ExcelToHtmlFormField() { return ( -
+
{t('html4excel')} diff --git a/web/src/components/parse-configuration/graph-rag-form-fields.tsx b/web/src/components/parse-configuration/graph-rag-form-fields.tsx index fddc65cf6..21a239938 100644 --- a/web/src/components/parse-configuration/graph-rag-form-fields.tsx +++ b/web/src/components/parse-configuration/graph-rag-form-fields.tsx @@ -59,10 +59,10 @@ export function UseGraphRagFormField() { name="parser_config.graphrag.use_graphrag" render={({ field }) => ( -
+
{t('useGraphRag')} diff --git a/web/src/components/parse-configuration/raptor-form-fields.tsx b/web/src/components/parse-configuration/raptor-form-fields.tsx index 17d631ad3..3552c8976 100644 --- a/web/src/components/parse-configuration/raptor-form-fields.tsx +++ b/web/src/components/parse-configuration/raptor-form-fields.tsx @@ -86,10 +86,10 @@ const RaptorFormFields = () => { defaultChecked={false} className="items-center space-y-0 " > -
+
{t('useRaptor')} diff --git a/web/src/components/ragflow-avatar.tsx b/web/src/components/ragflow-avatar.tsx index ab46f9f73..e84a01b34 100644 --- a/web/src/components/ragflow-avatar.tsx +++ b/web/src/components/ragflow-avatar.tsx @@ -3,6 +3,13 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar'; import { forwardRef, memo, useEffect, useRef, useState } from 'react'; import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar'; +const PREDEFINED_COLORS = [ + { from: '#4F6DEE', to: '#67BDF9' }, + { from: '#38A04D', to: '#93DCA2' }, + { from: '#C35F2B', to: '#EDB395' }, + { from: '#633897', to: '#CBA1FF' }, +]; + const getStringHash = (str: string): number => { const normalized = str.trim().toLowerCase(); let hash = 104729; @@ -17,16 +24,12 @@ const getStringHash = (str: string): number => { return Math.abs(hash); }; -// Generate a hash function with a fixed color const getColorForName = (name: string): { from: string; to: string } => { const hash = getStringHash(name); - const hue = hash % 360; - - return { - to: `hsl(${hue}, 70%, 80%)`, - from: `hsl(${hue}, 60%, 30%)`, - }; + const index = hash % PREDEFINED_COLORS.length; + return PREDEFINED_COLORS[index]; }; + export const RAGFlowAvatar = memo( forwardRef< React.ElementRef, @@ -43,7 +46,7 @@ export const RAGFlowAvatar = memo( if (parts.length === 1) { return parts[0][0].toUpperCase(); } - return parts[0][0].toUpperCase() + parts[1][0].toUpperCase(); + return parts[0][0].toUpperCase(); }; const initials = getInitials(name); @@ -98,7 +101,7 @@ export const RAGFlowAvatar = memo( 'bg-gradient-to-b', `from-[${from}] to-[${to}]`, 'flex items-center justify-center', - 'text-white font-bold', + 'text-white ', { 'rounded-md': !isPerson }, )} style={{ diff --git a/web/src/components/slider-input-form-field.tsx b/web/src/components/slider-input-form-field.tsx index 5986a3075..c31408192 100644 --- a/web/src/components/slider-input-form-field.tsx +++ b/web/src/components/slider-input-form-field.tsx @@ -49,12 +49,12 @@ export function SliderInputFormField({ defaultValue={defaultValue || 0} render={({ field }) => ( diff --git a/web/src/pages/next-search/index.tsx b/web/src/pages/next-search/index.tsx index 201c60baa..b9185a433 100644 --- a/web/src/pages/next-search/index.tsx +++ b/web/src/pages/next-search/index.tsx @@ -126,7 +126,7 @@ export default function SearchPage() { // > }
-
+