feat(chunk): add chunk editing and image preview functionality

This commit is contained in:
2025-10-30 17:56:03 +08:00
parent b35fe51d60
commit 19b70a4abd
13 changed files with 448 additions and 147 deletions

View File

@@ -27,6 +27,9 @@ import {
TextFormField,
type SelectOption,
} from '@/components/FormField';
import { LlmSvgIcon } from '@/components/AppSvgIcon';
import {type LLMFactory } from '@/constants/llm';
import { getFactoryIconName } from '@/utils/common';
// 解析器选项配置
const PARSER_OPTIONS = [
@@ -365,7 +368,13 @@ export function EmbeddingModelItem() {
<ListSubheader key={group.label}>{group.label}</ListSubheader>,
...group.options.map((option) => (
<MenuItem key={option.value} value={option.value} disabled={option.disabled}>
{option.label}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<LlmSvgIcon
name={getFactoryIconName(group.label as LLMFactory)}
sx={{ width: 20, height: 20, color: 'primary.main' }}
/>
{option.label}
</Box>
</MenuItem>
))
])}

View File

@@ -32,8 +32,10 @@ import type { INextTestingResult } from '@/interfaces/database/knowledge';
import KnowledgeBreadcrumbs from './components/KnowledgeBreadcrumbs';
import TestChunkResult from './components/TestChunkResult';
import { useSnackbar } from '@/components/Provider/SnackbarProvider';
import { toLower } from 'lodash';
import { type LLMFactory } from '@/constants/llm';
import { t } from 'i18next';
import { LlmSvgIcon } from '@/components/AppSvgIcon';
import { getFactoryIconName } from '@/utils/common';
// 语言选项常量
const options = [
@@ -231,7 +233,7 @@ function KnowledgeBaseTesting() {
<Container maxWidth="lg" sx={{ py: 4 }}>
{/* 面包屑导航 */}
<KnowledgeBreadcrumbs
<KnowledgeBreadcrumbs
kbItems={[
{
label: t('knowledgeTesting.knowledgeBase'),
@@ -327,7 +329,13 @@ function KnowledgeBaseTesting() {
<ListSubheader key={group.label}>{group.label}</ListSubheader>,
...group.options.map((option) => (
<MenuItem key={option.value} value={option.value} disabled={option.disabled}>
{option.label}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<LlmSvgIcon
name={getFactoryIconName(group.label as LLMFactory)}
sx={{ width: 20, height: 20, color: 'primary.main' }}
/>
{option.label}
</Box>
</MenuItem>
))
])}