From b0804d939c25d1e2d7fc2507d79cef3c2b7f28d2 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Tue, 23 Dec 2025 14:50:35 +0800 Subject: [PATCH] Fix upload error not showing. Support str type category. --- unilabos/app/web/client.py | 4 ++++ unilabos/registry/registry.py | 2 ++ unilabos/workflow/wf_utils.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/unilabos/app/web/client.py b/unilabos/app/web/client.py index 1f40a0b..8968f03 100644 --- a/unilabos/app/web/client.py +++ b/unilabos/app/web/client.py @@ -300,6 +300,10 @@ class HTTPClient: ) if response.status_code not in [200, 201]: logger.error(f"注册资源失败: {response.status_code}, {response.text}") + if response.status_code == 200: + res = response.json() + if "code" in res and res["code"] != 0: + logger.error(f"注册资源失败: {response.text}") return response def request_startup_json(self) -> Optional[Dict[str, Any]]: diff --git a/unilabos/registry/registry.py b/unilabos/registry/registry.py index 49e5761..20e0245 100644 --- a/unilabos/registry/registry.py +++ b/unilabos/registry/registry.py @@ -237,6 +237,8 @@ class Registry: resource_info["category"] = [file.stem] elif file.stem not in resource_info["category"]: resource_info["category"].append(file.stem) + elif not isinstance(resource_info.get("category"), list): + resource_info["category"] = [resource_info["category"]] if "config_info" not in resource_info: resource_info["config_info"] = [] if "icon" not in resource_info: diff --git a/unilabos/workflow/wf_utils.py b/unilabos/workflow/wf_utils.py index f2dfc8c..4645128 100644 --- a/unilabos/workflow/wf_utils.py +++ b/unilabos/workflow/wf_utils.py @@ -111,7 +111,7 @@ def upload_workflow( if result.get("code") == 0: data = result.get("data", {}) - print_status("工作流上传成功!", "success") + print_status(f"工作流上传成功!{data}", "success") print_status(f" - UUID: {data.get('uuid', 'N/A')}", "info") print_status(f" - 名称: {data.get('name', 'N/A')}", "info") else: