mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
fix: fix build after minor merged into major
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
||||
import { toSignal } from '@angular/core/rxjs-interop'
|
||||
import { Router } from '@angular/router'
|
||||
import { ErrorService, InitializingComponent } from '@start9labs/shared'
|
||||
import {
|
||||
ErrorService,
|
||||
formatProgress,
|
||||
InitializingComponent,
|
||||
} from '@start9labs/shared'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import {
|
||||
catchError,
|
||||
@@ -40,9 +44,8 @@ export default class LoadingPage {
|
||||
startWith(progress),
|
||||
catchError((_, watch$) =>
|
||||
interval(2000).pipe(
|
||||
switchMap(() =>
|
||||
from(this.api.getStatus()).pipe(catchError(() => EMPTY)),
|
||||
),
|
||||
switchMap(() => from(this.api.getStatus())),
|
||||
catchError(() => EMPTY),
|
||||
take(1),
|
||||
switchMap(() => watch$),
|
||||
),
|
||||
@@ -54,13 +57,7 @@ export default class LoadingPage {
|
||||
}),
|
||||
),
|
||||
),
|
||||
map(({ phases, overall }) => ({
|
||||
total: getDecimal(overall),
|
||||
message: phases
|
||||
.filter(p => p.progress !== true && p.progress !== null)
|
||||
.map(p => `${p.name}${getPhaseBytes(p.progress)}`)
|
||||
.join(','),
|
||||
})),
|
||||
map(formatProgress),
|
||||
catchError(e => {
|
||||
this.errorService.handleError(e)
|
||||
return EMPTY
|
||||
@@ -87,19 +84,3 @@ export default class LoadingPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getDecimal(progress: T.Progress): number {
|
||||
if (progress === true) {
|
||||
return 1
|
||||
} else if (!progress || !progress.total) {
|
||||
return 0
|
||||
} else {
|
||||
return progress.total && progress.done / progress.total
|
||||
}
|
||||
}
|
||||
|
||||
function getPhaseBytes(progress: T.Progress): string {
|
||||
return progress === true || !progress
|
||||
? ''
|
||||
: `: (${progress.done}/${progress.total})`
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DatePipe } from '@angular/common'
|
||||
import { Component, inject } from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { ErrorService } from '@start9labs/shared'
|
||||
import { ErrorService, ServerComponent } from '@start9labs/shared'
|
||||
import {
|
||||
TuiButton,
|
||||
TuiDialogService,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '@taiga-ui/core'
|
||||
import { TuiCardLarge, TuiCell } from '@taiga-ui/layout'
|
||||
import { CIFS, CifsResponse } from 'src/app/components/cifs.component'
|
||||
import { ServerComponent } from 'src/app/components/server.component'
|
||||
import { PasswordDirective } from 'src/app/components/password.directive'
|
||||
import { ApiService, StartOSDiskInfoFull } from 'src/app/services/api.service'
|
||||
import { StateService } from 'src/app/services/state.service'
|
||||
|
||||
@@ -66,6 +66,7 @@ import { StateService } from 'src/app/services/state.service'
|
||||
TuiTitle,
|
||||
DatePipe,
|
||||
ServerComponent,
|
||||
PasswordDirective,
|
||||
],
|
||||
})
|
||||
export default class RecoverPage {
|
||||
|
||||
Reference in New Issue
Block a user