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)
This commit is contained in:
chanx
2025-08-19 17:35:32 +08:00
committed by GitHub
parent 0aa3c4cdae
commit f2c5ad170d
14 changed files with 152 additions and 67 deletions

View File

@ -317,7 +317,11 @@ export function ChunkMethodDialog({
</FormContainer>
)}
{showGraphRagItems(selectedTag as DocumentParserType) &&
useGraphRag && <UseGraphRagFormField></UseGraphRagFormField>}
useGraphRag && (
<FormContainer>
<UseGraphRagFormField></UseGraphRagFormField>
</FormContainer>
)}
{showEntityTypes && <EntityTypesFormField></EntityTypesFormField>}
</form>
</Form>

View File

@ -50,10 +50,10 @@ export function DelimiterFormField() {
}
return (
<FormItem className=" items-center space-y-0 ">
<div className="flex items-center">
<div className="flex items-center gap-1">
<FormLabel
tooltip={t('knowledgeDetails.delimiterTip')}
className="text-sm text-muted-foreground whitespace-nowrap w-1/4"
className="text-sm text-muted-foreground whitespace-break-spaces w-1/4"
>
{t('knowledgeDetails.delimiter')}
</FormLabel>

View File

@ -25,10 +25,10 @@ export function ExcelToHtmlFormField() {
return (
<FormItem defaultChecked={false} className=" items-center space-y-0 ">
<div className="flex items-center">
<div className="flex items-center gap-1">
<FormLabel
tooltip={t('html4excelTip')}
className="text-sm text-muted-foreground whitespace-nowrap w-1/4"
className="text-sm text-muted-foreground whitespace-break-spaces w-1/4"
>
{t('html4excel')}
</FormLabel>

View File

@ -59,10 +59,10 @@ export function UseGraphRagFormField() {
name="parser_config.graphrag.use_graphrag"
render={({ field }) => (
<FormItem defaultChecked={false} className=" items-center space-y-0 ">
<div className="flex items-center">
<div className="flex items-center gap-1">
<FormLabel
tooltip={t('useGraphRagTip')}
className="text-sm text-muted-foreground whitespace-nowrap w-1/4"
className="text-sm text-muted-foreground whitespace-break-spaces w-1/4"
>
{t('useGraphRag')}
</FormLabel>

View File

@ -86,10 +86,10 @@ const RaptorFormFields = () => {
defaultChecked={false}
className="items-center space-y-0 "
>
<div className="flex items-center">
<div className="flex items-center gap-1">
<FormLabel
tooltip={t('useRaptorTip')}
className="text-sm text-muted-foreground whitespace-nowrap w-1/4"
className="text-sm text-muted-foreground w-1/4 whitespace-break-spaces"
>
{t('useRaptor')}
</FormLabel>

View File

@ -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<typeof AvatarPrimitive.Root>,
@ -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={{

View File

@ -49,12 +49,12 @@ export function SliderInputFormField({
defaultValue={defaultValue || 0}
render={({ field }) => (
<FormItem
className={cn({ 'flex items-center space-y-0': isHorizontal })}
className={cn({ 'flex items-center gap-1 space-y-0': isHorizontal })}
>
<FormLabel
tooltip={tooltip}
className={cn({
'text-sm text-muted-foreground whitespace-nowrap w-1/4':
'text-sm text-muted-foreground whitespace-break-spaces w-1/4':
isHorizontal,
})}
>