Skip to content

Commit 204690c

Browse files
committed
fix: 修复已知问题
1 parent d1d4353 commit 204690c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bmclapi_dashboard/static/js/index.min.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ class Alert {
23832383
)
23842384
}
23852385
process() {
2386-
2386+
23872387
}
23882388
}
23892389
class Authentication {
@@ -2593,15 +2593,17 @@ class Authentication {
25932593
}
25942594
async login(username, password, forever = false) {
25952595
var [err, ack] = await $MainSocket.send("auth", {
2596-
"username": username,
2596+
"username": btoa(username),
25972597
"password": btoa(password)
2598-
}, true)
2598+
})
25992599
if (ack && ack.success) {
26002600
this.username = ack.username
26012601
this.avatar = ack.avatar
26022602
this.token = ack.token
26032603
this.refreshToken = ack.refreshToken
26042604
return true
2605+
} else {
2606+
26052607
}
26062608
return false
26072609
}

core/cluster.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,8 @@ async def fetch(self):
958958
"Authorization": f"Bearer {self.cluster.token}"
959959
}
960960
) as session:
961-
await dashboard.set_status("files.fetching")
961+
if not self.checked:
962+
await dashboard.set_status("files.fetching")
962963
async with session.get(
963964
"/openbmclapi/files", params={
964965
"lastModified": self.lastModified * 1000.0
@@ -1093,6 +1094,7 @@ async def check(self, files: set[BMCLAPIFile]) -> dict[Storage, set[BMCLAPIFile]
10931094
await dashboard.set_status_by_tqdm("files.copying", pbar)
10941095
for storage, failed in zip(copy_storage.keys(), await asyncio.gather(*[asyncio.create_task(self.copy_storage(origin, files_storage, pbar)) for origin, files_storage in copy_storage.items()])):
10951096
miss_storages[storage] = failed
1097+
self.checked = True
10961098
return miss_storages
10971099

10981100
async def copy_storage(self, origin_storage: Storage, files_storage: dict[BMCLAPIFile, Storage], pbar: tqdm):
@@ -1132,7 +1134,7 @@ async def _get_storage_data(self, storage: Storage, file: BMCLAPIFile) -> Option
11321134
) as resp:
11331135
if not resp.ok:
11341136
return None
1135-
content.write(resp.read())
1137+
content.write(await resp.read())
11361138
content.seek(0)
11371139
if get_hash_content(file.hash, content) != file.hash:
11381140
return None

0 commit comments

Comments
 (0)