mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
async fixed
This commit is contained in:
committed by
Aiden McClelland
parent
fd62de7a91
commit
cfc937f17a
@@ -177,7 +177,7 @@
|
||||
<ion-toolbar style="border-top: 1px solid var(--ion-color-dark);" color="light">
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>Install Progress</ion-label>
|
||||
<ion-label>Install Progress: {{ (100 * (osUpdateProgress?.downloaded || 1) / (osUpdateProgress?.size || 1)).toFixed(0) }}%</ion-label>
|
||||
</ion-list-header>
|
||||
<div style="padding: 0 15px;">
|
||||
<ion-progress-bar
|
||||
|
||||
@@ -105,10 +105,7 @@ export class WizardBaker {
|
||||
action,
|
||||
verb: 'beginning update for',
|
||||
title,
|
||||
executeAction: async () => {
|
||||
this.embassyApi.updateServer({ })
|
||||
return
|
||||
},
|
||||
executeAction: () => this.embassyApi.updateServer({ }),
|
||||
},
|
||||
},
|
||||
bottomBar: {
|
||||
|
||||
@@ -119,40 +119,8 @@ export class MockApiService extends ApiService {
|
||||
},
|
||||
]
|
||||
const res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
|
||||
console.log('update progress created')
|
||||
await this.updateOSProgress(initialProgress.size)
|
||||
|
||||
console.log('about to update')
|
||||
setTimeout(async () => {
|
||||
const patch = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/status',
|
||||
value: ServerStatus.Running,
|
||||
},
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/version',
|
||||
value: '3.1.0',
|
||||
},
|
||||
{
|
||||
op: PatchOp.REMOVE,
|
||||
path: '/server-info/update-progress',
|
||||
},
|
||||
]
|
||||
|
||||
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
|
||||
// quickly revert patch to proper version to prevent infinite refresh loop
|
||||
const patch2 = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/version',
|
||||
value: require('../../../../package.json').version,
|
||||
},
|
||||
]
|
||||
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch: patch2 } })
|
||||
}, 10000)
|
||||
|
||||
this.updateOSProgress(initialProgress.size)
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -607,5 +575,36 @@ export class MockApiService extends ApiService {
|
||||
},
|
||||
]
|
||||
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
|
||||
|
||||
setTimeout(async () => {
|
||||
const patch = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/status',
|
||||
value: ServerStatus.Running,
|
||||
},
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/version',
|
||||
value: '3.1.0',
|
||||
},
|
||||
{
|
||||
op: PatchOp.REMOVE,
|
||||
path: '/server-info/update-progress',
|
||||
},
|
||||
]
|
||||
|
||||
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
|
||||
// quickly revert patch to proper version to prevent infinite refresh loop
|
||||
const patch2 = [
|
||||
{
|
||||
op: PatchOp.REPLACE,
|
||||
path: '/server-info/version',
|
||||
value: require('../../../../package.json').version,
|
||||
},
|
||||
]
|
||||
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch: patch2 } })
|
||||
}, 10000)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user