Skip to content

Commit 07edf16

Browse files
authored
fix ui bugs (#51)
* fix: adjust upload step handling and improve error display in configuration step
1 parent a055546 commit 07edf16

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

frontend/src/pages/OperatorMarket/Create/OperatorPluginCreate.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default function OperatorPluginCreate() {
4747
const handleFileUpload = async (files: FileList) => {
4848
setIsUploading(true);
4949
setParseError(null);
50-
setUploadStep("parsing");
5150
try {
5251
const fileName = files[0].name;
5352
await handleUpload({
@@ -67,6 +66,7 @@ export default function OperatorPluginCreate() {
6766
// 解析文件过程
6867
const res = await uploadOperatorUsingPost({ fileName });
6968
setParsedInfo({ ...parsedInfo, ...res.data, fileName });
69+
setUploadStep("parsing");
7070
} catch (err) {
7171
setParseError("文件解析失败," + err.data.message);
7272
} finally {
@@ -92,6 +92,7 @@ export default function OperatorPluginCreate() {
9292
// 编辑模式,加载已有算子信息逻辑待实现
9393
const { data } = await queryOperatorByIdUsingGet(operatorId);
9494
setParsedInfo(data);
95+
setUploadStep("configure");
9596
};
9697

9798
useEffect(() => {

frontend/src/pages/OperatorMarket/Create/components/ConfigureStep.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ export default function ConfigureStep({
88
setParsedInfo,
99
}) {
1010
const [form] = Form.useForm();
11-
11+
1212
useEffect(() => {
1313
form.setFieldsValue(parsedInfo);
1414
}, [parsedInfo]);
15-
15+
1616
return (
1717
<>
1818
{/* 解析结果 */}
1919
{parseError && (
20-
<Alert
21-
message="解析过程中发现问题"
22-
description={parseError}
23-
type="error"
24-
showIcon
25-
/>
20+
<div className="mb-4">
21+
<Alert
22+
message="解析过程中发现问题"
23+
description={parseError}
24+
type="error"
25+
showIcon
26+
/>
27+
</div>
2628
)}
2729

28-
{parsedInfo && (
30+
{!parseError && parsedInfo && (
2931
<Form
30-
form={form}
32+
form={form}
3133
layout="vertical"
3234
initialValues={parsedInfo}
3335
onValuesChange={(_, allValues) => {
@@ -76,7 +78,7 @@ export default function ConfigureStep({
7678
</div>
7779
</div>
7880

79-
<h3 className="text-lg font-semibold text-gray-900 mt-8">高级配置</h3>
81+
{/* <h3 className="text-lg font-semibold text-gray-900 mt-8">高级配置</h3> */}
8082
</Form>
8183
)}
8284
</>

frontend/src/pages/OperatorMarket/Home/components/List.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export function ListView({ operators = [], pagination, operations }) {
9797
>
9898
<List.Item.Meta
9999
avatar={
100-
<div className="w-12 h-12 bg-gradient-to-br from-blue-100 to-blue-200 rounded-lg flex items-center justify-center">
101-
{operator?.icon}
100+
<div className="w-12 h-12 bg-gradient-to-br from-sky-300 to-blue-500 rounded-lg flex items-center justify-center">
101+
<div className="w-8 h-8 text-white">{operator?.icon}</div>
102102
</div>
103103
}
104104
title={

0 commit comments

Comments
 (0)