草,copilot我谢谢你

This commit is contained in:
shenjack 2024-01-25 22:17:18 +08:00
parent 5a91b54fdd
commit 666678ef23
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -232,11 +232,11 @@ async def add_message(data: Dict[str, Any]):
online_bandwidth: int = data["bandwidth"]
data_lens = ["B", "KB", "MB", "GB", "TB"]
for i in range(5):
if data_bandwidth < 1024:
data_bandwidth = round(data_bandwidth, 5)
data_bandwidth = f"{data_bandwidth}{data_lens[i]}"
if data_bytes < 1024:
data_bytes = round(data_bytes, 5)
data_bytes = f"{data_bytes}{data_lens[i]}"
break
data_bandwidth /= 1024
data_bytes /= 1024
report_msg = (
"OpenBMCLAPI 状态:\n"