diff --git a/web/projects/setup-wizard/src/app/pages/recover.page.ts b/web/projects/setup-wizard/src/app/pages/recover.page.ts index 9ba144af0..480e7269b 100644 --- a/web/projects/setup-wizard/src/app/pages/recover.page.ts +++ b/web/projects/setup-wizard/src/app/pages/recover.page.ts @@ -12,7 +12,7 @@ import { 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 { ApiService, StartOSDiskInfoWithId } from 'src/app/services/api.service' +import { ApiService, StartOSDiskInfoFull } from 'src/app/services/api.service' import { StateService } from 'src/app/services/state.service' @Component({ @@ -47,7 +47,7 @@ import { StateService } from 'src/app/services/state.service' @for (server of servers; track $index) { } @@ -76,7 +76,7 @@ export default class RecoverPage { private readonly stateService = inject(StateService) loading = true - servers: StartOSDiskInfoWithId[] = [] + servers: StartOSDiskInfoFull[] = [] async ngOnInit() { this.stateService.setupType = 'restore' @@ -111,15 +111,14 @@ export default class RecoverPage { } } - select(password: string, serverId: string) { + select(password: string, server: StartOSDiskInfoFull) { this.stateService.recoverySource = { type: 'backup', target: { type: 'disk', - // @TODO Matt where to get logicalname? - logicalname: '', + logicalname: server.partition.logicalname, }, - serverId, + serverId: server.id, password, } this.router.navigate(['storage']) diff --git a/web/projects/ui/src/app/routes/diagnostic/diagnostic.module.ts b/web/projects/ui/src/app/routes/diagnostic/diagnostic.module.ts index ddb8d4def..c18f0f011 100644 --- a/web/projects/ui/src/app/routes/diagnostic/diagnostic.module.ts +++ b/web/projects/ui/src/app/routes/diagnostic/diagnostic.module.ts @@ -1,11 +1,5 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' -import { WorkspaceConfig } from '@start9labs/shared' -import { DiagnosticService } from './services/diagnostic.service' -import { MockDiagnosticService } from './services/mock-diagnostic.service' -import { LiveDiagnosticService } from './services/live-diagnostic.service' - -const { useMocks } = require('../../../../../../config.json') as WorkspaceConfig const ROUTES: Routes = [ { @@ -22,11 +16,5 @@ const ROUTES: Routes = [ @NgModule({ imports: [RouterModule.forChild(ROUTES)], - providers: [ - { - provide: DiagnosticService, - useClass: useMocks ? MockDiagnosticService : LiveDiagnosticService, - }, - ], }) export class DiagnosticModule {} diff --git a/web/projects/ui/src/app/routes/diagnostic/home/home.page.ts b/web/projects/ui/src/app/routes/diagnostic/home/home.page.ts index 9040dc069..636568977 100644 --- a/web/projects/ui/src/app/routes/diagnostic/home/home.page.ts +++ b/web/projects/ui/src/app/routes/diagnostic/home/home.page.ts @@ -1,17 +1,10 @@ -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts import { TUI_CONFIRM } from '@taiga-ui/kit' import { Component, Inject } from '@angular/core' import { WINDOW } from '@ng-web-apis/common' import { LoadingService } from '@start9labs/shared' import { TuiDialogService } from '@taiga-ui/core' import { filter } from 'rxjs' -import { DiagnosticService } from '../services/diagnostic.service' -======== -import { Component } from '@angular/core' -import { AlertController } from '@ionic/angular' -import { LoadingService } from '@start9labs/shared' import { ApiService } from 'src/app/services/api/embassy-api.service' ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts @Component({ selector: 'diagnostic-home', @@ -29,14 +22,9 @@ export class HomePage { constructor( private readonly loader: LoadingService, -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts - private readonly api: DiagnosticService, + private readonly api: ApiService, private readonly dialogs: TuiDialogService, @Inject(WINDOW) private readonly window: Window, -======== - private readonly api: ApiService, - private readonly alertCtrl: AlertController, ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts ) {} async ngOnInit() { @@ -102,11 +90,7 @@ export class HomePage { } async restart(): Promise { -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts - const loader = this.loader.open('').subscribe() -======== const loader = this.loader.open('Loading...').subscribe() ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts try { await this.api.diagnosticRestart() @@ -119,11 +103,7 @@ export class HomePage { } async forgetDrive(): Promise { -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts - const loader = this.loader.open('').subscribe() -======== const loader = this.loader.open('Loading...').subscribe() ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts try { await this.api.diagnosticForgetDrive() @@ -136,31 +116,6 @@ export class HomePage { } } -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts - async presentAlertSystemRebuild() { - this.dialogs - .open(TUI_CONFIRM, { - label: 'Warning', - size: 's', - data: { - no: 'Cancel', - yes: 'Rebuild', - content: - '

This action will tear down all service containers and rebuild them from scratch. No data will be deleted.

A system rebuild can be useful if your system gets into a bad state, and it should only be performed if you are experiencing general performance or reliability issues.

It may take up to an hour to complete. During this time, you will lose all connectivity to your Start9 server.

', - }, - }) - .pipe(filter(Boolean)) - .subscribe(() => { - try { - this.systemRebuild() - } catch (e) { - console.error(e) - } - }) - } - -======== ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts async presentAlertRepairDisk() { this.dialogs .open(TUI_CONFIRM, { @@ -187,27 +142,8 @@ export class HomePage { this.window.location.reload() } -<<<<<<<< HEAD:web/projects/ui/src/app/routes/diagnostic/home/home.page.ts - private async systemRebuild(): Promise { - const loader = this.loader.open('').subscribe() - - try { - await this.api.systemRebuild() - await this.api.restart() - this.restarted = true - } catch (e) { - console.error(e) - } finally { - loader.unsubscribe() - } - } - - private async repairDisk(): Promise { - const loader = this.loader.open('').subscribe() -======== private async repairDisk(): Promise { const loader = this.loader.open('Loading...').subscribe() ->>>>>>>> 94a5075b6daa1375433420abf5d121171dae72cb:web/projects/ui/src/app/pages/diagnostic-routes/home/home.page.ts try { await this.api.diagnosticRepairDisk() diff --git a/web/projects/ui/src/app/routes/diagnostic/logs/logs.page.ts b/web/projects/ui/src/app/routes/diagnostic/logs/logs.page.ts index fb3a3d76b..15c44adb7 100644 --- a/web/projects/ui/src/app/routes/diagnostic/logs/logs.page.ts +++ b/web/projects/ui/src/app/routes/diagnostic/logs/logs.page.ts @@ -2,7 +2,7 @@ import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core' import { INTERSECTION_ROOT } from '@ng-web-apis/intersection-observer' import { convertAnsi, ErrorService } from '@start9labs/shared' import { TuiScrollbar } from '@taiga-ui/core' -import { DiagnosticService } from 'src/app/routes/diagnostic/services/diagnostic.service' +import { ApiService } from 'src/app/services/api/embassy-api.service' @Component({ selector: 'logs', @@ -28,7 +28,7 @@ import { DiagnosticService } from 'src/app/routes/diagnostic/services/diagnostic export class LogsPage implements OnInit { @ViewChild(TuiScrollbar, { read: ElementRef }) private readonly scrollbar?: ElementRef - private readonly api = inject(DiagnosticService) + private readonly api = inject(ApiService) private readonly errorService = inject(ErrorService) startCursor?: string @@ -59,7 +59,7 @@ export class LogsPage implements OnInit { this.loading = true try { - const response = await this.api.getLogs({ + const response = await this.api.diagnosticGetLogs({ cursor: this.startCursor, before: !!this.startCursor, limit: 200, diff --git a/web/projects/ui/src/app/routes/loading/loading.page.ts b/web/projects/ui/src/app/routes/loading/loading.page.ts index 2fee80fad..243a88eb6 100644 --- a/web/projects/ui/src/app/routes/loading/loading.page.ts +++ b/web/projects/ui/src/app/routes/loading/loading.page.ts @@ -5,7 +5,6 @@ import { provideSetupLogsService, provideSetupService, } from '@start9labs/shared' - import { ApiService } from 'src/app/services/api/embassy-api.service' @Component({