mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-04 05:15:10 +00:00
Fix upload error not showing.
Support str type category.
This commit is contained in:
@@ -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]]:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user