feat(frontend): 增强Synthesis Data Detail页面UX体验 (#163)

* fix(chart): update Helm chart helpers and values for improved configuration

* feat(SynthesisTaskTab): enhance task table with tooltip support and improved column widths

* feat(CreateTask, SynthFileTask): improve task creation and detail view with enhanced payload handling and UI updates

* feat(SynthFileTask): enhance file display with progress tracking and delete action

* feat(SynthFileTask): enhance file display with progress tracking and delete action

* feat(SynthDataDetail): add delete action for chunks with confirmation prompt

* feat(SynthDataDetail): update edit and delete buttons to icon-only format

* feat(SynthDataDetail): add confirmation modals for chunk and synthesis data deletion
This commit is contained in:
Dallas98
2025-12-11 21:02:44 +08:00
committed by GitHub
parent 8f529952f6
commit ec87e4f204
7 changed files with 580 additions and 370 deletions

View File

@@ -2,7 +2,7 @@ from datetime import datetime
from enum import Enum
from typing import List, Optional, Dict, Any
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, field_validator
class TextSplitConfig(BaseModel):
@@ -27,13 +27,21 @@ class SynthesisType(Enum):
class CreateSynthesisTaskRequest(BaseModel):
"""创建数据合成任务请求"""
name: str = Field(..., description="合成任务名称")
description: str = Field(None, description="合成任务描述")
description: Optional[str] = Field(None, description="合成任务描述")
model_id: str = Field(..., description="模型ID")
source_file_id: list[str] = Field(..., description="原始文件ID列表")
text_split_config: TextSplitConfig = Field(None, description="文本切片配置")
synthesis_config: SynthesisConfig = Field(..., description="合成配置")
synthesis_type: SynthesisType = Field(..., description="合成类型")
@field_validator("description")
@classmethod
def empty_string_to_none(cls, v: Optional[str]) -> Optional[str]:
"""前端如果传入空字符串,将其统一转换为 None,避免存库时看起来像有描述但实际上为空。"""
if isinstance(v, str) and v.strip() == "":
return None
return v
class DataSynthesisTaskItem(BaseModel):
"""数据合成任务列表/详情项"""