mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
refactor: break routing down to apps level (#2285)
This commit is contained in:
committed by
Aiden McClelland
parent
3804a46f3b
commit
c9a487fa4d
@@ -19,10 +19,9 @@ import {
|
|||||||
} from '@start9labs/shared'
|
} from '@start9labs/shared'
|
||||||
|
|
||||||
import { AppComponent } from './app.component'
|
import { AppComponent } from './app.component'
|
||||||
import { AppRoutingModule } from './app-routing.module'
|
import { RoutingModule } from './routing.module'
|
||||||
import { OSWelcomePageModule } from './modals/os-welcome/os-welcome.module'
|
import { OSWelcomePageModule } from './modals/os-welcome/os-welcome.module'
|
||||||
import { GenericInputComponentModule } from './modals/generic-input/generic-input.component.module'
|
import { GenericInputComponentModule } from './modals/generic-input/generic-input.component.module'
|
||||||
import { MarketplaceModule } from './marketplace.module'
|
|
||||||
import { PreloaderModule } from './app/preloader/preloader.module'
|
import { PreloaderModule } from './app/preloader/preloader.module'
|
||||||
import { FooterModule } from './app/footer/footer.module'
|
import { FooterModule } from './app/footer/footer.module'
|
||||||
import { MenuModule } from './app/menu/menu.module'
|
import { MenuModule } from './app/menu/menu.module'
|
||||||
@@ -31,7 +30,7 @@ import { APP_PROVIDERS } from './app.providers'
|
|||||||
import { PatchDbModule } from './services/patch-db/patch-db.module'
|
import { PatchDbModule } from './services/patch-db/patch-db.module'
|
||||||
import { ToastContainerModule } from './components/toast-container/toast-container.module'
|
import { ToastContainerModule } from './components/toast-container/toast-container.module'
|
||||||
import { ConnectionBarComponentModule } from './components/connection-bar/connection-bar.component.module'
|
import { ConnectionBarComponentModule } from './components/connection-bar/connection-bar.component.module'
|
||||||
import { WidgetsPageModule } from './pages/widgets/widgets.module'
|
import { WidgetsPageModule } from 'src/app/apps/ui/pages/widgets/widgets.module'
|
||||||
import { ServiceWorkerModule } from '@angular/service-worker'
|
import { ServiceWorkerModule } from '@angular/service-worker'
|
||||||
import { environment } from '../environments/environment'
|
import { environment } from '../environments/environment'
|
||||||
import { LoadingModule } from './modals/loading/loading.module'
|
import { LoadingModule } from './modals/loading/loading.module'
|
||||||
@@ -45,7 +44,7 @@ import { FormPageModule } from './modals/form/form.module'
|
|||||||
IonicModule.forRoot({
|
IonicModule.forRoot({
|
||||||
mode: 'md',
|
mode: 'md',
|
||||||
}),
|
}),
|
||||||
AppRoutingModule,
|
RoutingModule,
|
||||||
MenuModule,
|
MenuModule,
|
||||||
PreloaderModule,
|
PreloaderModule,
|
||||||
FooterModule,
|
FooterModule,
|
||||||
@@ -55,7 +54,6 @@ import { FormPageModule } from './modals/form/form.module'
|
|||||||
GenericInputComponentModule,
|
GenericInputComponentModule,
|
||||||
MonacoEditorModule,
|
MonacoEditorModule,
|
||||||
SharedPipesModule,
|
SharedPipesModule,
|
||||||
MarketplaceModule,
|
|
||||||
PatchDbModule,
|
PatchDbModule,
|
||||||
ToastContainerModule,
|
ToastContainerModule,
|
||||||
ConnectionBarComponentModule,
|
ConnectionBarComponentModule,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
TUI_DATE_VALUE_TRANSFORMER,
|
TUI_DATE_VALUE_TRANSFORMER,
|
||||||
} from '@taiga-ui/kit'
|
} from '@taiga-ui/kit'
|
||||||
import { RELATIVE_URL, THEME, WorkspaceConfig } from '@start9labs/shared'
|
import { RELATIVE_URL, THEME, WorkspaceConfig } from '@start9labs/shared'
|
||||||
|
import { AbstractMarketplaceService } from '@start9labs/marketplace'
|
||||||
import { ApiService } from './services/api/embassy-api.service'
|
import { ApiService } from './services/api/embassy-api.service'
|
||||||
import { MockApiService } from './services/api/embassy-mock-api.service'
|
import { MockApiService } from './services/api/embassy-mock-api.service'
|
||||||
import { LiveApiService } from './services/api/embassy-live-api.service'
|
import { LiveApiService } from './services/api/embassy-live-api.service'
|
||||||
@@ -22,6 +23,7 @@ import { FilterPackagesPipe } from '../../../marketplace/src/pipes/filter-packag
|
|||||||
import { ThemeSwitcherService } from './services/theme-switcher.service'
|
import { ThemeSwitcherService } from './services/theme-switcher.service'
|
||||||
import { DateTransformerService } from './services/date-transformer.service'
|
import { DateTransformerService } from './services/date-transformer.service'
|
||||||
import { DatetimeTransformerService } from './services/datetime-transformer.service'
|
import { DatetimeTransformerService } from './services/datetime-transformer.service'
|
||||||
|
import { MarketplaceService } from './services/marketplace.service'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
useMocks,
|
useMocks,
|
||||||
@@ -73,6 +75,10 @@ export const APP_PROVIDERS: Provider[] = [
|
|||||||
provide: THEME,
|
provide: THEME,
|
||||||
useExisting: ThemeSwitcherService,
|
useExisting: ThemeSwitcherService,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: AbstractMarketplaceService,
|
||||||
|
useClass: MarketplaceService,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export function appInitializer(
|
export function appInitializer(
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||||
import { heightCollapse } from '../../util/animations'
|
import { heightCollapse } from 'src/app/util/animations'
|
||||||
import { PatchDB } from 'patch-db-client'
|
import { PatchDB } from 'patch-db-client'
|
||||||
import { map } from 'rxjs/operators'
|
import { map } from 'rxjs/operators'
|
||||||
import { DataModel } from '../../services/patch-db/data-model'
|
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'footer[appFooter]',
|
selector: 'footer[appFooter]',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
inject,
|
inject,
|
||||||
Inject,
|
Inject,
|
||||||
} from '@angular/core'
|
} from '@angular/core'
|
||||||
import { EOSService } from '../../services/eos.service'
|
import { EOSService } from 'src/app/services/eos.service'
|
||||||
import { PatchDB } from 'patch-db-client'
|
import { PatchDB } from 'patch-db-client'
|
||||||
import {
|
import {
|
||||||
combineLatest,
|
combineLatest,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Directive, HostListener, Input } from '@angular/core'
|
import { Directive, HostListener, Input } from '@angular/core'
|
||||||
import { LoadingController, ModalController } from '@ionic/angular'
|
import { LoadingController, ModalController } from '@ionic/angular'
|
||||||
import { ErrorToastService } from '@start9labs/shared'
|
import { ErrorToastService } from '@start9labs/shared'
|
||||||
import { SnakePage } from '../../modals/snake/snake.page'
|
import { SnakePage } from 'src/app/modals/snake/snake.page'
|
||||||
import { ApiService } from '../../services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'img[appSnek]',
|
selector: 'img[appSnek]',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core'
|
import { NgModule } from '@angular/core'
|
||||||
|
|
||||||
import { SnakePageModule } from '../../modals/snake/snake.module'
|
import { SnakePageModule } from 'src/app/modals/snake/snake.module'
|
||||||
import { SnekDirective } from './snek.directive'
|
import { SnekDirective } from './snek.directive'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|||||||
17
frontend/projects/ui/src/app/apps/loading/loading.module.ts
Normal file
17
frontend/projects/ui/src/app/apps/loading/loading.module.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core'
|
||||||
|
import { RouterModule, Routes } from '@angular/router'
|
||||||
|
import { LoadingModule } from '@start9labs/shared'
|
||||||
|
import { LoadingPage } from './loading.page'
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: LoadingPage,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [LoadingModule, RouterModule.forChild(routes)],
|
||||||
|
declarations: [LoadingPage],
|
||||||
|
})
|
||||||
|
export class LoadingPageModule {}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<app-loading
|
||||||
|
class="ion-page"
|
||||||
|
(finished)="navCtrl.navigateForward('/login')"
|
||||||
|
></app-loading>
|
||||||
19
frontend/projects/ui/src/app/apps/loading/loading.page.ts
Normal file
19
frontend/projects/ui/src/app/apps/loading/loading.page.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { Component, inject } from '@angular/core'
|
||||||
|
import { NavController } from '@ionic/angular'
|
||||||
|
import {
|
||||||
|
provideSetupLogsService,
|
||||||
|
provideSetupService,
|
||||||
|
} from '@start9labs/shared'
|
||||||
|
|
||||||
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'loading.page.html',
|
||||||
|
providers: [
|
||||||
|
provideSetupService(ApiService),
|
||||||
|
provideSetupLogsService(ApiService),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class LoadingPage {
|
||||||
|
readonly navCtrl = inject(NavController)
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@ import { RouterModule, Routes } from '@angular/router'
|
|||||||
import { CommonModule } from '@angular/common'
|
import { CommonModule } from '@angular/common'
|
||||||
import { FormsModule } from '@angular/forms'
|
import { FormsModule } from '@angular/forms'
|
||||||
import { IonicModule } from '@ionic/angular'
|
import { IonicModule } from '@ionic/angular'
|
||||||
import { LoginPage } from './login.page'
|
|
||||||
import { SharedPipesModule } from '@start9labs/shared'
|
import { SharedPipesModule } from '@start9labs/shared'
|
||||||
|
import { LoginPage } from './login.page'
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
DataModel,
|
DataModel,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
} from 'src/app/services/patch-db/data-model'
|
} from 'src/app/services/patch-db/data-model'
|
||||||
import { getPackageInfo, PkgInfo } from '../../../util/get-package-info'
|
import { getPackageInfo, PkgInfo } from 'src/app/util/get-package-info'
|
||||||
import { PatchDB } from 'patch-db-client'
|
import { PatchDB } from 'patch-db-client'
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
@@ -24,10 +24,9 @@
|
|||||||
<ion-item *ngIf="stopped$ | async" class="ion-margin-bottom">
|
<ion-item *ngIf="stopped$ | async" class="ion-margin-bottom">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p>
|
<p>
|
||||||
<ion-text color="warning"
|
<ion-text color="warning">
|
||||||
>Service is stopped. Information on this page could be
|
Service is stopped. Information on this page could be inaccurate.
|
||||||
inaccurate.</ion-text
|
</ion-text>
|
||||||
>
|
|
||||||
</p>
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
@@ -43,8 +43,8 @@
|
|||||||
<span *ngIf="result === 'loading'">
|
<span *ngIf="result === 'loading'">
|
||||||
{{ $any(check).message }}
|
{{ $any(check).message }}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="result === 'success'"
|
<span *ngIf="result === 'success'">
|
||||||
>:
|
:
|
||||||
{{ $any(check).message }}
|
{{ $any(check).message }}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Directive, HostListener } from '@angular/core'
|
import { Directive, HostListener } from '@angular/core'
|
||||||
import { LoadingController, ModalController } from '@ionic/angular'
|
import { LoadingController, ModalController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { BackupSelectPage } from 'src/app/pages/backups-routes/modals/backup-select/backup-select.page'
|
import { BackupSelectPage } from 'src/app/apps/ui/pages/backups-routes/modals/backup-select/backup-select.page'
|
||||||
import { TargetSelectPage } from '../modals/target-select/target-select.page'
|
import { TargetSelectPage } from '../modals/target-select/target-select.page'
|
||||||
import {
|
import {
|
||||||
CifsBackupTarget,
|
CifsBackupTarget,
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
GenericInputOptions,
|
GenericInputOptions,
|
||||||
} from 'src/app/modals/generic-input/generic-input.component'
|
} from 'src/app/modals/generic-input/generic-input.component'
|
||||||
import { BackupInfo, BackupTarget } from 'src/app/services/api/api.types'
|
import { BackupInfo, BackupTarget } from 'src/app/services/api/api.types'
|
||||||
import { RecoverSelectPage } from 'src/app/pages/backups-routes/modals/recover-select/recover-select.page'
|
import { RecoverSelectPage } from 'src/app/apps/ui/pages/backups-routes/modals/recover-select/recover-select.page'
|
||||||
import * as argon2 from '@start9labs/argon2'
|
import * as argon2 from '@start9labs/argon2'
|
||||||
import { TargetSelectPage } from '../modals/target-select/target-select.page'
|
import { TargetSelectPage } from '../modals/target-select/target-select.page'
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title
|
<ion-title>
|
||||||
>Select Backup {{ type === 'create' ? 'Target' : 'Source' }}</ion-title
|
Select Backup {{ type === 'create' ? 'Target' : 'Source' }}
|
||||||
>
|
</ion-title>
|
||||||
<ion-buttons slot="end">
|
<ion-buttons slot="end">
|
||||||
<ion-button (click)="dismiss()">
|
<ion-button (click)="dismiss()">
|
||||||
<ion-icon slot="icon-only" name="close"></ion-icon>
|
<ion-icon slot="icon-only" name="close"></ion-icon>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<div *ngIf="!targets.length" class="ion-text-center ion-padding-top">
|
<div *ngIf="!targets.length" class="ion-text-center ion-padding-top">
|
||||||
<h2 class="ion-padding-bottom">No saved targets</h2>
|
<h2 class="ion-padding-bottom">No saved targets</h2>
|
||||||
<ion-button (click)="goToTargets()"> Go to Targets </ion-button>
|
<ion-button (click)="goToTargets()">Go to Targets</ion-button>
|
||||||
</div>
|
</div>
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user