Skip to content

Commit ec87e4f

Browse files
authored
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
1 parent 8f52995 commit ec87e4f

File tree

7 files changed

+577
-367
lines changed

7 files changed

+577
-367
lines changed

deployment/helm/label-studio/templates/_helpers.tpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Expand the name of the chart.
33
*/}}
44
{{- define "label-studio.name" -}}
5-
{{- default .Chart.name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
5+
{{- default .Values.nameOverride .Chart.Name | trunc 63 | trimSuffix "-" -}}
66
{{- end -}}
77

88
{{/*
@@ -12,7 +12,7 @@ Create a default fully qualified app name.
1212
{{- if .Values.fullnameOverride -}}
1313
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
1414
{{- else -}}
15-
{{- $name := default .Chart.name .Values.nameOverride -}}
15+
{{- $name := default .Values.nameOverride .Chart.Name -}}
1616
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
1717
{{- end -}}
1818
{{- end -}}
@@ -21,6 +21,5 @@ Create a default fully qualified app name.
2121
Create chart name and version as used by the chart label.
2222
*/}}
2323
{{- define "label-studio.chart" -}}
24-
{{- printf "%s-%s" .Chart.name .Chart.version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
24+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
2525
{{- end -}}
26-

deployment/helm/label-studio/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Default values for label-studio Helm chart.
22
# This mirrors the configuration from deployment/docker/label-studio/docker-compose.yml
3+
fullnameOverride: label-studio
34

45
replicaCount: 1
56

@@ -24,9 +25,9 @@ postgres:
2425
size: 10Gi
2526

2627
service:
27-
type: ClusterIP
28+
type: NodePort
2829
port: 8000
29-
nodePort: null
30+
nodePort: 30001
3031

3132
# Corresponds to docker-compose port mapping 30001:8000
3233
ingress:
@@ -54,7 +55,7 @@ env:
5455
POSTGRE_USER: "postgres"
5556
POSTGRE_PASSWORD: ""
5657
POSTGRE_PORT: 5432
57-
POSTGRE_HOST: "db"
58+
POSTGRE_HOST: "label-studio-postgres"
5859
LABEL_STUDIO_HOST: "" # can be overridden
5960
LOCAL_FILES_SERVING_ENABLED: "true"
6061
LOCAL_FILES_DOCUMENT_ROOT: "/label-studio/local"
@@ -75,5 +76,6 @@ persistence:
7576
# If not set and persistence.enabled=true, a PVC will be created automatically.
7677
datasetVolume:
7778
enabled: true
78-
claimName: "" # if empty, uses same PVC as persistence or creates a dedicated one
79+
claimName: datamate-dataset-pvc # if empty, uses same PVC as persistence or creates a dedicated one
80+
7981

frontend/src/pages/SynthesisTask/CreateTask.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ export default function SynthesisTaskCreate() {
146146
}
147147

148148
// 构造后端要求的参数格式
149-
const payload = {
150-
name: values.name || form.getFieldValue("name"), // 必选,确保传递
151-
description: values.description ?? "", // 可选,始终传递
149+
const payload: Record<string, unknown> = {
150+
name: values.name || form.getFieldValue("name"),
152151
model_id: selectedModel,
153152
source_file_id: selectedFiles,
154153
text_split_config: {
@@ -161,10 +160,14 @@ export default function SynthesisTaskCreate() {
161160
synthesis_type: taskType === "qa" ? "QA" : "COT",
162161
};
163162

163+
// 只有在有真实内容时携带 description,避免强制传空字符串
164+
const desc = values.description ?? form.getFieldValue("description");
165+
if (typeof desc === "string" && desc.trim().length > 0) {
166+
payload.description = desc.trim();
167+
}
168+
164169
setSubmitting(true);
165-
const res = (await createSynthesisTaskUsingPost(
166-
payload as unknown as Record<string, unknown>
167-
)) as CreateTaskApiResponse;
170+
const res = (await createSynthesisTaskUsingPost(payload)) as CreateTaskApiResponse;
168171

169172
const ok =
170173
res?.success === true ||

0 commit comments

Comments
 (0)