mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
修复资源添加
This commit is contained in:
@@ -80,7 +80,7 @@ class HTTPClient:
|
|||||||
info(f"首次添加资源,当前远程地址: {self.remote_addr}")
|
info(f"首次添加资源,当前远程地址: {self.remote_addr}")
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{self.remote_addr}/edge/material",
|
f"{self.remote_addr}/edge/material",
|
||||||
json={"nodes": resources.dump()[0], "mount_uuid": mount_uuid},
|
json={"nodes": [x for xs in resources.dump() for x in xs], "mount_uuid": mount_uuid},
|
||||||
headers={"Authorization": f"Lab {self.auth}"},
|
headers={"Authorization": f"Lab {self.auth}"},
|
||||||
timeout=100,
|
timeout=100,
|
||||||
)
|
)
|
||||||
@@ -102,8 +102,6 @@ class HTTPClient:
|
|||||||
data = res["data"]
|
data = res["data"]
|
||||||
for i in data:
|
for i in data:
|
||||||
uuid_mapping[i["uuid"]] = i["cloud_uuid"]
|
uuid_mapping[i["uuid"]] = i["cloud_uuid"]
|
||||||
if i["cloud_uuid"] == i["uuid"]:
|
|
||||||
print(i["cloud_uuid"], i["uuid"])
|
|
||||||
else:
|
else:
|
||||||
logger.error(f"添加物料失败: {response.text}")
|
logger.error(f"添加物料失败: {response.text}")
|
||||||
for u, n in old_uuids.items():
|
for u, n in old_uuids.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user