Feat/update progress (#1944)

* uodate FE to show progress once calculated

* update mocks

* only show progress when known

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2022-11-15 20:57:03 -07:00
committed by Aiden McClelland
parent 5b91b5f436
commit 18ee1e2685
9 changed files with 59 additions and 32 deletions

View File

@@ -232,12 +232,12 @@ export class MockApiService extends ApiService {
async updateServer(url?: string): Promise<RR.UpdateServerRes> {
await pauseFor(2000)
const initialProgress = {
size: 10000,
size: null,
downloaded: 0,
}
setTimeout(() => {
this.updateOSProgress(initialProgress.size)
this.updateOSProgress()
}, 500)
const patch = [
@@ -916,8 +916,19 @@ export class MockApiService extends ApiService {
}, 1000)
}
private async updateOSProgress(size: number) {
private async updateOSProgress() {
let size = 10000
let downloaded = 0
const patch0 = [
{
op: PatchOp.REPLACE,
path: `/server-info/status-info/update-progress/size`,
value: size,
},
]
this.mockRevision(patch0)
while (downloaded < size) {
await pauseFor(250)
downloaded += 500