fix ui bugs (#51)

* fix: adjust upload step handling and improve error display in configuration step
This commit is contained in:
chenghh-9609
2025-10-31 17:49:10 +08:00
committed by GitHub
parent a055546873
commit 07edf16044
3 changed files with 17 additions and 14 deletions

View File

@@ -47,7 +47,6 @@ export default function OperatorPluginCreate() {
const handleFileUpload = async (files: FileList) => {
setIsUploading(true);
setParseError(null);
setUploadStep("parsing");
try {
const fileName = files[0].name;
await handleUpload({
@@ -67,6 +66,7 @@ export default function OperatorPluginCreate() {
// 解析文件过程
const res = await uploadOperatorUsingPost({ fileName });
setParsedInfo({ ...parsedInfo, ...res.data, fileName });
setUploadStep("parsing");
} catch (err) {
setParseError("文件解析失败," + err.data.message);
} finally {
@@ -92,6 +92,7 @@ export default function OperatorPluginCreate() {
// 编辑模式,加载已有算子信息逻辑待实现
const { data } = await queryOperatorByIdUsingGet(operatorId);
setParsedInfo(data);
setUploadStep("configure");
};
useEffect(() => {

View File

@@ -17,15 +17,17 @@ export default function ConfigureStep({
<>
{/* 解析结果 */}
{parseError && (
<div className="mb-4">
<Alert
message="解析过程中发现问题"
description={parseError}
type="error"
showIcon
/>
</div>
)}
{parsedInfo && (
{!parseError && parsedInfo && (
<Form
form={form}
layout="vertical"
@@ -76,7 +78,7 @@ export default function ConfigureStep({
</div>
</div>
<h3 className="text-lg font-semibold text-gray-900 mt-8"></h3>
{/* <h3 className="text-lg font-semibold text-gray-900 mt-8">高级配置</h3> */}
</Form>
)}
</>

View File

@@ -97,8 +97,8 @@ export function ListView({ operators = [], pagination, operations }) {
>
<List.Item.Meta
avatar={
<div className="w-12 h-12 bg-gradient-to-br from-blue-100 to-blue-200 rounded-lg flex items-center justify-center">
{operator?.icon}
<div className="w-12 h-12 bg-gradient-to-br from-sky-300 to-blue-500 rounded-lg flex items-center justify-center">
<div className="w-8 h-8 text-white">{operator?.icon}</div>
</div>
}
title={