mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
bring back startup alerts
This commit is contained in:
committed by
Aiden McClelland
parent
2ad5213b44
commit
b07c9c2d69
@@ -14,6 +14,7 @@
|
|||||||
},
|
},
|
||||||
"mocks": {
|
"mocks": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
"marketplace": true,
|
||||||
"connection": "ws",
|
"connection": "ws",
|
||||||
"rpcPort": "5959",
|
"rpcPort": "5959",
|
||||||
"wsPort": "5960",
|
"wsPort": "5960",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { Storage } from '@ionic/storage'
|
import { Storage } from '@ionic/storage'
|
||||||
import { AuthService, AuthState } from './services/auth.service'
|
import { AuthService, AuthState } from './services/auth.service'
|
||||||
import { ApiService } from './services/api/api.service'
|
import { ApiService } from './services/api/embassy/embassy-api.service'
|
||||||
import { Router, RoutesRecognized } from '@angular/router'
|
import { Router, RoutesRecognized } from '@angular/router'
|
||||||
import { debounceTime, distinctUntilChanged, filter, finalize, takeWhile } from 'rxjs/operators'
|
import { debounceTime, distinctUntilChanged, filter, finalize, takeWhile } from 'rxjs/operators'
|
||||||
import { AlertController, IonicSafeString, ToastController } from '@ionic/angular'
|
import { AlertController, IonicSafeString, ToastController } from '@ionic/angular'
|
||||||
@@ -9,10 +9,11 @@ import { LoaderService } from './services/loader.service'
|
|||||||
import { Emver } from './services/emver.service'
|
import { Emver } from './services/emver.service'
|
||||||
import { SplitPaneTracker } from './services/split-pane.service'
|
import { SplitPaneTracker } from './services/split-pane.service'
|
||||||
import { LoadingOptions, ToastButton } from '@ionic/core'
|
import { LoadingOptions, ToastButton } from '@ionic/core'
|
||||||
import { PatchDbModel } from './services/patch-db/patch-db.service'
|
import { PatchDbService } from './services/patch-db/patch-db.service'
|
||||||
import { HttpService } from './services/http.service'
|
import { HttpService } from './services/http.service'
|
||||||
import { ServerStatus } from './services/patch-db/data-model'
|
import { ServerStatus } from './services/patch-db/data-model'
|
||||||
import { ConnectionFailure, ConnectionService } from './services/connection.service'
|
import { ConnectionFailure, ConnectionService } from './services/connection.service'
|
||||||
|
import { StartupAlertsService } from './services/startup-alerts.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
@@ -59,8 +60,9 @@ export class AppComponent {
|
|||||||
private readonly loader: LoaderService,
|
private readonly loader: LoaderService,
|
||||||
private readonly emver: Emver,
|
private readonly emver: Emver,
|
||||||
private readonly connectionService: ConnectionService,
|
private readonly connectionService: ConnectionService,
|
||||||
|
private readonly startupAlertsService: StartupAlertsService,
|
||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
readonly splitPane: SplitPaneTracker,
|
readonly splitPane: SplitPaneTracker,
|
||||||
) {
|
) {
|
||||||
// set dark theme
|
// set dark theme
|
||||||
@@ -93,6 +95,8 @@ export class AppComponent {
|
|||||||
this.watchStatus(auth)
|
this.watchStatus(auth)
|
||||||
// watch unread notification count to display toast
|
// watch unread notification count to display toast
|
||||||
this.watchNotifications(auth)
|
this.watchNotifications(auth)
|
||||||
|
// run startup alerts
|
||||||
|
this.startupAlertsService.runChecks()
|
||||||
// UNVERIFIED
|
// UNVERIFIED
|
||||||
} else if (auth === AuthState.UNVERIFIED) {
|
} else if (auth === AuthState.UNVERIFIED) {
|
||||||
this.http.authReqEnabled = false
|
this.http.authReqEnabled = false
|
||||||
|
|||||||
@@ -7,20 +7,20 @@ import { IonicStorageModule } from '@ionic/storage-angular'
|
|||||||
import { HttpClientModule } from '@angular/common/http'
|
import { HttpClientModule } from '@angular/common/http'
|
||||||
import { AppComponent } from './app.component'
|
import { AppComponent } from './app.component'
|
||||||
import { AppRoutingModule } from './app-routing.module'
|
import { AppRoutingModule } from './app-routing.module'
|
||||||
import { ApiService } from './services/api/api.service'
|
import { ApiService } from './services/api/embassy/embassy-api.service'
|
||||||
import { ApiServiceFactory, MarketplaceApiServiceFactory } from './services/api/api.service.factory'
|
import { ApiServiceFactory, MarketplaceApiServiceFactory } from './services/api/api.service.factory'
|
||||||
import { PatchDbModelFactory } from './services/patch-db/patch-db.factory'
|
import { PatchDbServiceFactory } from './services/patch-db/patch-db.factory'
|
||||||
import { HttpService } from './services/http.service'
|
import { HttpService } from './services/http.service'
|
||||||
import { ConfigService } from './services/config.service'
|
import { ConfigService } from './services/config.service'
|
||||||
import { QRCodeModule } from 'angularx-qrcode'
|
import { QRCodeModule } from 'angularx-qrcode'
|
||||||
import { appConfigComponents } from './modals/app-config-injectable'
|
import { appConfigComponents } from './modals/app-config-injectable'
|
||||||
import { OSWelcomePageModule } from './modals/os-welcome/os-welcome.module'
|
import { OSWelcomePageModule } from './modals/os-welcome/os-welcome.module'
|
||||||
import { MarkdownPageModule } from './modals/markdown/markdown.module'
|
import { MarkdownPageModule } from './modals/markdown/markdown.module'
|
||||||
import { PatchDbModel } from './services/patch-db/patch-db.service'
|
import { PatchDbService } from './services/patch-db/patch-db.service'
|
||||||
import { LocalStorageBootstrap } from './services/patch-db/local-storage-bootstrap'
|
import { LocalStorageBootstrap } from './services/patch-db/local-storage-bootstrap'
|
||||||
import { SharingModule } from './modules/sharing.module'
|
import { SharingModule } from './modules/sharing.module'
|
||||||
import { APP_CONFIG_COMPONENT_MAPPING } from './services/tracking-modal-controller.service'
|
import { APP_CONFIG_COMPONENT_MAPPING } from './services/tracking-modal-controller.service'
|
||||||
import { MarketplaceApiService } from './services/api/marketplace-api.service'
|
import { MarketplaceApiService } from './services/api/marketplace/marketplace-api.service'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent],
|
||||||
@@ -45,8 +45,8 @@ import { MarketplaceApiService } from './services/api/marketplace-api.service'
|
|||||||
Storage,
|
Storage,
|
||||||
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
||||||
{ provide: ApiService , useFactory: ApiServiceFactory, deps: [ConfigService, HttpService] }, { provide: ApiService , useFactory: ApiServiceFactory, deps: [ConfigService, HttpService] },
|
{ provide: ApiService , useFactory: ApiServiceFactory, deps: [ConfigService, HttpService] }, { provide: ApiService , useFactory: ApiServiceFactory, deps: [ConfigService, HttpService] },
|
||||||
{ provide: MarketplaceApiService , useFactory: MarketplaceApiServiceFactory, deps: [ConfigService, HttpService, PatchDbModel] },
|
{ provide: MarketplaceApiService , useFactory: MarketplaceApiServiceFactory, deps: [ConfigService, HttpService, PatchDbService] },
|
||||||
{ provide: PatchDbModel, useFactory: PatchDbModelFactory, deps: [ConfigService, LocalStorageBootstrap, ApiService] },
|
{ provide: PatchDbService, useFactory: PatchDbServiceFactory, deps: [ConfigService, LocalStorageBootstrap, ApiService] },
|
||||||
{ provide: APP_CONFIG_COMPONENT_MAPPING, useValue: appConfigComponents },
|
{ provide: APP_CONFIG_COMPONENT_MAPPING, useValue: appConfigComponents },
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { SplitPaneTracker } from 'src/app/services/split-pane.service'
|
import { SplitPaneTracker } from 'src/app/services/split-pane.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { combineLatest, Subscription } from 'rxjs'
|
import { combineLatest, Subscription } from 'rxjs'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -17,7 +17,7 @@ export class BadgeMenuComponent {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly splitPane: SplitPaneTracker,
|
private readonly splitPane: SplitPaneTracker,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnInit } from '@angular/core'
|
||||||
import { BehaviorSubject, from, Subject } from 'rxjs'
|
import { BehaviorSubject, from, Subject } from 'rxjs'
|
||||||
import { takeUntil, tap } from 'rxjs/operators'
|
import { takeUntil, tap } from 'rxjs/operators'
|
||||||
import { Breakages } from 'src/app/services/api/api-types'
|
import { Breakages } from 'src/app/services/api/api.types'
|
||||||
import { markAsLoadingDuring$ } from 'src/app/services/loader.service'
|
import { markAsLoadingDuring$ } from 'src/app/services/loader.service'
|
||||||
import { capitalizeFirstLetter, isEmptyObject } from 'src/app/util/misc.util'
|
import { capitalizeFirstLetter, isEmptyObject } from 'src/app/util/misc.util'
|
||||||
import { Loadable } from '../loadable'
|
import { Loadable } from '../loadable'
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<div class="slide-content">
|
<div class="slide-content">
|
||||||
<div style="margin-top: 25px;">
|
<div style="margin-top: 25px;">
|
||||||
<div style="margin: 15px; display: flex; justify-content: center; align-items: center;">
|
<div style="margin: 15px; display: flex; justify-content: center; align-items: center;">
|
||||||
<ion-label [color]="params.titleColor" style="font-size: xx-large; font-weight: bold;">
|
<ion-label [color]="params.titleColor">
|
||||||
{{ params.title }}
|
<h1>{{ params.title }}</h1>
|
||||||
|
<h2>{{ params.headline }}</h2>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let note of params.notes | keyvalue : asIsOrder">
|
<div *ngFor="let note of params.notes | keyvalue : asIsOrder">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class NotesComponent implements OnInit, Loadable {
|
|||||||
notes: { [version: string]: string }
|
notes: { [version: string]: string }
|
||||||
title: string
|
title: string
|
||||||
titleColor: string
|
titleColor: string
|
||||||
|
headline: string
|
||||||
}
|
}
|
||||||
|
|
||||||
loading$ = new BehaviorSubject(false)
|
loading$ = new BehaviorSubject(false)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||||
import { Breakages } from 'src/app/services/api/api-types'
|
import { Breakages } from 'src/app/services/api/api.types'
|
||||||
import { exists } from 'src/app/util/misc.util'
|
import { exists } from 'src/app/util/misc.util'
|
||||||
import { ApiService } from '../../services/api/api.service'
|
import { ApiService } from '../../services/api/embassy/embassy-api.service'
|
||||||
import { InstallWizardComponent, SlideDefinition, TopbarParams } from './install-wizard.component'
|
import { InstallWizardComponent, SlideDefinition, TopbarParams } from './install-wizard.component'
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@@ -12,7 +12,10 @@ export class WizardBaker {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
install (values: {
|
install (values: {
|
||||||
id: string, title: string, version: string, installAlert?: string
|
id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
installAlert?: string
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { id, title, version, installAlert } = values
|
const { id, title, version, installAlert } = values
|
||||||
|
|
||||||
@@ -53,7 +56,10 @@ export class WizardBaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update (values: {
|
update (values: {
|
||||||
id: string, title: string, version: string, installAlert?: string
|
id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
installAlert?: string
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { id, title, version, installAlert } = values
|
const { id, title, version, installAlert } = values
|
||||||
|
|
||||||
@@ -111,9 +117,11 @@ export class WizardBaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateOS (values: {
|
updateOS (values: {
|
||||||
version: string, releaseNotes: { [version: string]: string }
|
version: string
|
||||||
|
releaseNotes: { [version: string]: string }
|
||||||
|
headline: string
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { version, releaseNotes } = values
|
const { version, releaseNotes, headline } = values
|
||||||
|
|
||||||
const action = 'update'
|
const action = 'update'
|
||||||
const title = 'EmbassyOS'
|
const title = 'EmbassyOS'
|
||||||
@@ -127,6 +135,7 @@ export class WizardBaker {
|
|||||||
notes: releaseNotes,
|
notes: releaseNotes,
|
||||||
title: 'Release Notes',
|
title: 'Release Notes',
|
||||||
titleColor: 'dark',
|
titleColor: 'dark',
|
||||||
|
headline,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
bottomBar: {
|
bottomBar: {
|
||||||
@@ -153,7 +162,10 @@ export class WizardBaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downgrade (values: {
|
downgrade (values: {
|
||||||
id: string, title: string, version: string, installAlert?: string
|
id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
installAlert?: string
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { id, title, version, installAlert } = values
|
const { id, title, version, installAlert } = values
|
||||||
|
|
||||||
@@ -205,7 +217,10 @@ export class WizardBaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uninstall (values: {
|
uninstall (values: {
|
||||||
id: string, title: string, version: string, uninstallAlert?: string
|
id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
uninstallAlert?: string
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { id, title, version, uninstallAlert } = values
|
const { id, title, version, uninstallAlert } = values
|
||||||
|
|
||||||
@@ -253,7 +268,10 @@ export class WizardBaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stop (values: {
|
stop (values: {
|
||||||
breakages: Breakages, id: string, title: string, version: string
|
id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
breakages: Breakages
|
||||||
}): InstallWizardComponent['params'] {
|
}): InstallWizardComponent['params'] {
|
||||||
const { breakages, title, version } = values
|
const { breakages, title, version } = values
|
||||||
|
|
||||||
@@ -277,7 +295,10 @@ export class WizardBaker {
|
|||||||
return { toolbar, slideDefinitions }
|
return { toolbar, slideDefinitions }
|
||||||
}
|
}
|
||||||
|
|
||||||
configure (values: { breakages: Breakages, pkg: PackageDataEntry }): InstallWizardComponent['params'] {
|
configure (values: {
|
||||||
|
pkg: PackageDataEntry
|
||||||
|
breakages: Breakages
|
||||||
|
}): InstallWizardComponent['params'] {
|
||||||
const { breakages, pkg } = values
|
const { breakages, pkg } = values
|
||||||
const { title, version } = pkg.manifest
|
const { title, version } = pkg.manifest
|
||||||
const action = 'configure'
|
const action = 'configure'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import { CanActivate, Router, CanActivateChild } from '@angular/router'
|
import { CanActivate, Router, CanActivateChild } from '@angular/router'
|
||||||
import { tap } from 'rxjs/operators'
|
import { tap } from 'rxjs/operators'
|
||||||
import { ServerStatus } from '../services/patch-db/data-model'
|
import { ServerStatus } from '../services/patch-db/data-model'
|
||||||
import { PatchDbModel } from '../services/patch-db/patch-db.service'
|
import { PatchDbService } from '../services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@@ -10,7 +10,7 @@ import { PatchDbModel } from '../services/patch-db/patch-db.service'
|
|||||||
export class MaintenanceGuard implements CanActivate, CanActivateChild {
|
export class MaintenanceGuard implements CanActivate, CanActivateChild {
|
||||||
constructor (
|
constructor (
|
||||||
private readonly router: Router,
|
private readonly router: Router,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
canActivate (): boolean {
|
canActivate (): boolean {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import { CanActivate, Router } from '@angular/router'
|
import { CanActivate, Router } from '@angular/router'
|
||||||
import { tap } from 'rxjs/operators'
|
import { tap } from 'rxjs/operators'
|
||||||
import { ServerStatus } from '../services/patch-db/data-model'
|
import { ServerStatus } from '../services/patch-db/data-model'
|
||||||
import { PatchDbModel } from '../services/patch-db/patch-db.service'
|
import { PatchDbService } from '../services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@@ -12,7 +12,7 @@ export class UnmaintenanceGuard implements CanActivate {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly router: Router,
|
private readonly router: Router,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) {
|
) {
|
||||||
this.patch.sequence$.subscribe(_ => {
|
this.patch.sequence$.subscribe(_ => {
|
||||||
this.serverStatus = this.patch.data['server-info'].status
|
this.serverStatus = this.patch.data['server-info'].status
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { ModalController } from '@ionic/angular'
|
import { ModalController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Input } from '@angular/core'
|
import { Component, Input } from '@angular/core'
|
||||||
import { ModalController } from '@ionic/angular'
|
import { ModalController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { AlertController, IonContent, ModalController, NavController } from '@ionic/angular'
|
import { AlertController, IonContent, ModalController, NavController } from '@ionic/angular'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { HttpErrorResponse } from '@angular/common/http'
|
import { HttpErrorResponse } from '@angular/common/http'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Action, Manifest, PackageDataEntry, PackageMainStatus } from 'src/app/services/patch-db/data-model'
|
import { Action, Manifest, PackageDataEntry, PackageMainStatus } from 'src/app/services/patch-db/data-model'
|
||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
||||||
@@ -32,7 +32,7 @@ export class AppActionsPage {
|
|||||||
private readonly loaderService: LoaderService,
|
private readonly loaderService: LoaderService,
|
||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
private readonly navCtrl: NavController,
|
private readonly navCtrl: NavController,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { NavController, AlertController, ModalController, IonContent } from '@ionic/angular'
|
import { NavController, AlertController, ModalController, IonContent } from '@ionic/angular'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { isEmptyObject, Recommendation } from 'src/app/util/misc.util'
|
import { isEmptyObject, Recommendation } from 'src/app/util/misc.util'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { TrackingModalController } from 'src/app/services/tracking-modal-controller.service'
|
import { TrackingModalController } from 'src/app/services/tracking-modal-controller.service'
|
||||||
@@ -12,7 +12,7 @@ import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
|||||||
import { ConfigSpec } from 'src/app/pkg-config/config-types'
|
import { ConfigSpec } from 'src/app/pkg-config/config-types'
|
||||||
import { ConfigCursor } from 'src/app/pkg-config/config-cursor'
|
import { ConfigCursor } from 'src/app/pkg-config/config-cursor'
|
||||||
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-config',
|
selector: 'app-config',
|
||||||
@@ -55,7 +55,7 @@ export class AppConfigPage {
|
|||||||
private readonly alertCtrl: AlertController,
|
private readonly alertCtrl: AlertController,
|
||||||
private readonly modalController: ModalController,
|
private readonly modalController: ModalController,
|
||||||
private readonly trackingModalCtrl: TrackingModalController,
|
private readonly trackingModalCtrl: TrackingModalController,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { IonContent } from '@ionic/angular'
|
import { IonContent } from '@ionic/angular'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -20,7 +20,7 @@ export class AppInstructionsPage {
|
|||||||
private readonly route: ActivatedRoute,
|
private readonly route: ActivatedRoute,
|
||||||
private readonly errToast: ErrorToastService,
|
private readonly errToast: ErrorToastService,
|
||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router'
|
|||||||
import { IonContent, ToastController } from '@ionic/angular'
|
import { IonContent, ToastController } from '@ionic/angular'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { InstalledPackageDataEntry, PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import { InstalledPackageDataEntry, PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { copyToClipboard } from 'src/app/util/web.util'
|
import { copyToClipboard } from 'src/app/util/web.util'
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ export class AppInterfacesPage {
|
|||||||
private readonly route: ActivatedRoute,
|
private readonly route: ActivatedRoute,
|
||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { ConnectionService } from 'src/app/services/connection.service'
|
import { ConnectionService } from 'src/app/services/connection.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||||
import { combineLatest, Subscription } from 'rxjs'
|
import { combineLatest, Subscription } from 'rxjs'
|
||||||
import { PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
|
import { PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
|
||||||
@@ -25,7 +25,7 @@ export class AppListPage {
|
|||||||
constructor (
|
constructor (
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
public readonly connectionService: ConnectionService,
|
public readonly connectionService: ConnectionService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { IonContent } from '@ionic/angular'
|
import { IonContent } from '@ionic/angular'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Component, ViewChild } from '@angular/core'
|
|||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { getManifest } from 'src/app/services/config.service'
|
import { getManifest } from 'src/app/services/config.service'
|
||||||
import * as JsonPointer from 'json-pointer'
|
import * as JsonPointer from 'json-pointer'
|
||||||
import { IonContent } from '@ionic/angular'
|
import { IonContent } from '@ionic/angular'
|
||||||
@@ -23,7 +23,7 @@ export class AppManifestPage {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly route: ActivatedRoute,
|
private readonly route: ActivatedRoute,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { IonContent } from '@ionic/angular'
|
import { IonContent } from '@ionic/angular'
|
||||||
import { Metric } from 'src/app/services/api/api-types'
|
import { Metric } from 'src/app/services/api/api.types'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { pauseFor } from 'src/app/util/misc.util'
|
import { pauseFor } from 'src/app/util/misc.util'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -25,7 +25,7 @@ export class AppMetricsPage {
|
|||||||
constructor (
|
constructor (
|
||||||
private readonly route: ActivatedRoute,
|
private readonly route: ActivatedRoute,
|
||||||
private readonly errToast: ErrorToastService,
|
private readonly errToast: ErrorToastService,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { copyToClipboard } from 'src/app/util/web.util'
|
import { copyToClipboard } from 'src/app/util/web.util'
|
||||||
import { AlertController, IonContent, NavController, PopoverController, ToastController } from '@ionic/angular'
|
import { AlertController, IonContent, NavController, PopoverController, ToastController } from '@ionic/angular'
|
||||||
import { PackageProperties } from 'src/app/util/properties.util'
|
import { PackageProperties } from 'src/app/util/properties.util'
|
||||||
import { QRComponent } from 'src/app/components/qr/qr.component'
|
import { QRComponent } from 'src/app/components/qr/qr.component'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { PackageMainStatus } from 'src/app/services/patch-db/data-model'
|
import { PackageMainStatus } from 'src/app/services/patch-db/data-model'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
import * as JsonPointer from 'json-pointer'
|
import * as JsonPointer from 'json-pointer'
|
||||||
@@ -36,7 +36,7 @@ export class AppPropertiesPage {
|
|||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
private readonly popoverCtrl: PopoverController,
|
private readonly popoverCtrl: PopoverController,
|
||||||
private readonly navCtrl: NavController,
|
private readonly navCtrl: NavController,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { IonContent, LoadingController, ModalController } from '@ionic/angular'
|
import { IonContent, LoadingController, ModalController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { BackupConfirmationComponent } from 'src/app/modals/backup-confirmation/backup-confirmation.component'
|
import { BackupConfirmationComponent } from 'src/app/modals/backup-confirmation/backup-confirmation.component'
|
||||||
import { DiskInfo } from 'src/app/services/api/api-types'
|
import { DiskInfo } from 'src/app/services/api/api.types'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -28,7 +28,7 @@ export class AppRestorePage {
|
|||||||
private readonly modalCtrl: ModalController,
|
private readonly modalCtrl: ModalController,
|
||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
private readonly loadingCtrl: LoadingController,
|
private readonly loadingCtrl: LoadingController,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { AlertController, NavController, ModalController, IonContent } from '@ionic/angular'
|
import { AlertController, NavController, ModalController, IonContent } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ActivatedRoute, NavigationExtras } from '@angular/router'
|
import { ActivatedRoute, NavigationExtras } from '@angular/router'
|
||||||
import { chill, isEmptyObject, Recommendation } from 'src/app/util/misc.util'
|
import { chill, isEmptyObject, Recommendation } from 'src/app/util/misc.util'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
@@ -8,7 +8,7 @@ import { combineLatest, Observable, of, Subscription } from 'rxjs'
|
|||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { DependencyErrorConfigUnsatisfied, DependencyErrorNotInstalled, DependencyErrorType, PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
import { DependencyErrorConfigUnsatisfied, DependencyErrorNotInstalled, DependencyErrorType, PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
||||||
import { FEStatus, PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
|
import { FEStatus, PkgStatusRendering, renderPkgStatus } from 'src/app/services/pkg-status-rendering.service'
|
||||||
import { ConnectionService } from 'src/app/services/connection.service'
|
import { ConnectionService } from 'src/app/services/connection.service'
|
||||||
@@ -43,7 +43,7 @@ export class AppShowPage {
|
|||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
public readonly connectionService: ConnectionService,
|
public readonly connectionService: ConnectionService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ServerStatus } from 'src/app/services/patch-db/data-model'
|
import { ServerStatus } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'Maintenance',
|
selector: 'Maintenance',
|
||||||
@@ -11,7 +11,7 @@ export class MaintenancePage {
|
|||||||
ServerStatus = ServerStatus
|
ServerStatus = ServerStatus
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { MarketplaceData, MarketplaceEOS, MarketplacePkg } from 'src/app/services/api/api-types'
|
import { MarketplaceData, MarketplaceEOS, MarketplacePkg } from 'src/app/services/api/api.types'
|
||||||
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
import { wizardModal } from 'src/app/components/install-wizard/install-wizard.component'
|
||||||
import { IonContent, ModalController } from '@ionic/angular'
|
import { IonContent, ModalController } from '@ionic/angular'
|
||||||
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { PackageState } from 'src/app/services/patch-db/data-model'
|
import { PackageState } from 'src/app/services/patch-db/data-model'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
import { MarketplaceService } from '../marketplace.service'
|
import { MarketplaceService } from '../marketplace.service'
|
||||||
import { MarketplaceApiService } from 'src/app/services/api/marketplace-api.service'
|
import { MarketplaceApiService } from 'src/app/services/api/marketplace/marketplace-api.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'marketplace-list',
|
selector: 'marketplace-list',
|
||||||
@@ -41,7 +41,7 @@ export class MarketplaceListPage {
|
|||||||
private readonly modalCtrl: ModalController,
|
private readonly modalCtrl: ModalController,
|
||||||
private readonly errToast: ErrorToastService,
|
private readonly errToast: ErrorToastService,
|
||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
@@ -91,6 +91,7 @@ export class MarketplaceListPage {
|
|||||||
this.modalCtrl,
|
this.modalCtrl,
|
||||||
this.wizardBaker.updateOS({
|
this.wizardBaker.updateOS({
|
||||||
version: this.eos.version,
|
version: this.eos.version,
|
||||||
|
headline: this.eos.headline,
|
||||||
releaseNotes: this.eos['release-notes'],
|
releaseNotes: this.eos['release-notes'],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { WizardBaker } from 'src/app/components/install-wizard/prebaked-wizards'
|
|||||||
import { Emver } from 'src/app/services/emver.service'
|
import { Emver } from 'src/app/services/emver.service'
|
||||||
import { displayEmver } from 'src/app/pipes/emver.pipe'
|
import { displayEmver } from 'src/app/pipes/emver.pipe'
|
||||||
import { pauseFor, Recommendation } from 'src/app/util/misc.util'
|
import { pauseFor, Recommendation } from 'src/app/util/misc.util'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry, PackageState } from 'src/app/services/patch-db/data-model'
|
||||||
import { MarketplaceService } from '../marketplace.service'
|
import { MarketplaceService } from '../marketplace.service'
|
||||||
@@ -37,7 +37,7 @@ export class MarketplaceShowPage {
|
|||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
private readonly navCtrl: NavController,
|
private readonly navCtrl: NavController,
|
||||||
private readonly emver: Emver,
|
private readonly emver: Emver,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
private readonly marketplaceService: MarketplaceService,
|
private readonly marketplaceService: MarketplaceService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { MarketplacePkg } from 'src/app/services/api/api-types'
|
import { MarketplacePkg } from 'src/app/services/api/api.types'
|
||||||
import { MarketplaceApiService } from 'src/app/services/api/marketplace-api.service'
|
import { MarketplaceApiService } from 'src/app/services/api/marketplace/marketplace-api.service'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { ServerNotification, ServerNotifications } from 'src/app/services/api/api-types'
|
import { ServerNotification, ServerNotifications } from 'src/app/services/api/api.types'
|
||||||
import { AlertController } from '@ionic/angular'
|
import { AlertController } from '@ionic/angular'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ServerConfigService } from 'src/app/services/server-config.service'
|
import { ServerConfigService } from 'src/app/services/server-config.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dev-options',
|
selector: 'dev-options',
|
||||||
@@ -11,7 +11,7 @@ export class DevOptionsPage {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly serverConfigService: ServerConfigService,
|
private readonly serverConfigService: ServerConfigService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async presentModalValueEdit (key: string, current?: any): Promise<void> {
|
async presentModalValueEdit (key: string, current?: any): Promise<void> {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { AlertController } from '@ionic/angular'
|
|||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { SSHService } from './ssh.service'
|
import { SSHService } from './ssh.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { SSHKeys } from 'src/app/services/api/api-types'
|
import { SSHKeys } from 'src/app/services/api/api.types'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { BehaviorSubject } from 'rxjs'
|
import { BehaviorSubject } from 'rxjs'
|
||||||
import { SSHKeys } from 'src/app/services/api/api-types'
|
import { SSHKeys } from 'src/app/services/api/api.types'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { isPlatform, ToastController } from '@ionic/angular'
|
|||||||
import { copyToClipboard } from 'src/app/util/web.util'
|
import { copyToClipboard } from 'src/app/util/web.util'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -27,7 +27,7 @@ export class LANPage {
|
|||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
private readonly loader: LoaderService,
|
private readonly loader: LoaderService,
|
||||||
private readonly apiService: ApiService,
|
private readonly apiService: ApiService,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ServerConfigService } from 'src/app/services/server-config.service'
|
import { ServerConfigService } from 'src/app/services/server-config.service'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ export class PrivacyPage {
|
|||||||
constructor (
|
constructor (
|
||||||
private readonly serverConfigService: ServerConfigService,
|
private readonly serverConfigService: ServerConfigService,
|
||||||
public readonly config: ConfigService,
|
public readonly config: ConfigService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async presentModalValueEdit (key: string, current?: string): Promise<void> {
|
async presentModalValueEdit (key: string, current?: string): Promise<void> {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { LoadingController, ModalController } from '@ionic/angular'
|
import { LoadingController, ModalController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { BackupConfirmationComponent } from 'src/app/modals/backup-confirmation/backup-confirmation.component'
|
import { BackupConfirmationComponent } from 'src/app/modals/backup-confirmation/backup-confirmation.component'
|
||||||
import { DiskInfo } from 'src/app/services/api/api-types'
|
import { DiskInfo } from 'src/app/services/api/api.types'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'server-backup',
|
selector: 'server-backup',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, ViewChild } from '@angular/core'
|
import { Component, ViewChild } from '@angular/core'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { IonContent } from '@ionic/angular'
|
import { IonContent } from '@ionic/angular'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { Metrics } from 'src/app/services/api/api-types'
|
import { Metrics } from 'src/app/services/api/api.types'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
import { pauseFor } from 'src/app/util/misc.util'
|
import { pauseFor } from 'src/app/util/misc.util'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { LoadingOptions } from '@ionic/core'
|
import { LoadingOptions } from '@ionic/core'
|
||||||
import { AlertController, NavController } from '@ionic/angular'
|
import { AlertController, NavController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ToastController } from '@ionic/angular'
|
import { ToastController } from '@ionic/angular'
|
||||||
import { copyToClipboard } from 'src/app/util/web.util'
|
import { copyToClipboard } from 'src/app/util/web.util'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -14,7 +14,7 @@ export class ServerSpecsPage {
|
|||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async copy (address: string) {
|
async copy (address: string) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { NavController } from '@ionic/angular'
|
import { NavController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { WifiService } from '../wifi.service'
|
import { WifiService } from '../wifi.service'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { ActionSheetController } from '@ionic/angular'
|
import { ActionSheetController } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
import { ActionSheetButton } from '@ionic/core'
|
import { ActionSheetButton } from '@ionic/core'
|
||||||
import { WifiService } from './wifi.service'
|
import { WifiService } from './wifi.service'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
import { WiFiInfo } from 'src/app/services/patch-db/data-model'
|
import { WiFiInfo } from 'src/app/services/patch-db/data-model'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ export class WifiListPage {
|
|||||||
private readonly errToast: ErrorToastService,
|
private readonly errToast: ErrorToastService,
|
||||||
private readonly actionCtrl: ActionSheetController,
|
private readonly actionCtrl: ActionSheetController,
|
||||||
private readonly wifiService: WifiService,
|
private readonly wifiService: WifiService,
|
||||||
public readonly patch: PatchDbModel,
|
public readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async presentAction (ssid: string, wifi: WiFiInfo) {
|
async presentAction (ssid: string, wifi: WiFiInfo) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import { AlertController, ToastController } from '@ionic/angular'
|
import { AlertController, ToastController } from '@ionic/angular'
|
||||||
import { merge, Observable, timer } from 'rxjs'
|
import { merge, Observable, timer } from 'rxjs'
|
||||||
import { filter, map, take, tap } from 'rxjs/operators'
|
import { filter, map, take, tap } from 'rxjs/operators'
|
||||||
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
@@ -12,7 +12,7 @@ export class WifiService {
|
|||||||
constructor (
|
constructor (
|
||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
private readonly alertCtrl: AlertController,
|
private readonly alertCtrl: AlertController,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
confirmWifi (ssid: string): Observable<boolean> {
|
confirmWifi (ssid: string): Observable<boolean> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core'
|
import { Pipe, PipeTransform } from '@angular/core'
|
||||||
import { NotificationLevel, ServerNotification } from '../services/api/api-types'
|
import { NotificationLevel, ServerNotification } from '../services/api/api.types'
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'notificationColor',
|
name: 'notificationColor',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Pipe, PipeTransform } from '@angular/core'
|
import { Pipe, PipeTransform } from '@angular/core'
|
||||||
import { combineLatest, Observable } from 'rxjs'
|
import { combineLatest, Observable } from 'rxjs'
|
||||||
import { map } from 'rxjs/operators'
|
import { map } from 'rxjs/operators'
|
||||||
import { PatchDbModel } from '../services/patch-db/patch-db.service'
|
import { PatchDbService } from '../services/patch-db/patch-db.service'
|
||||||
import { FEStatus, renderPkgStatus } from '../services/pkg-status-rendering.service'
|
import { FEStatus, renderPkgStatus } from '../services/pkg-status-rendering.service'
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({
|
||||||
@@ -10,7 +10,7 @@ import { FEStatus, renderPkgStatus } from '../services/pkg-status-rendering.serv
|
|||||||
export class StatusPipe implements PipeTransform {
|
export class StatusPipe implements PipeTransform {
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
transform (pkgId: string): Observable<FEStatus> {
|
transform (pkgId: string): Observable<FEStatus> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { DependencyErrorType, DockerIoFormat, Manifest, PackageDataEntry, PackageMainStatus, PackageState, ServerStatus } from 'src/app/services/patch-db/data-model'
|
import { DependencyErrorType, DockerIoFormat, Manifest, PackageDataEntry, PackageMainStatus, PackageState, ServerStatus } from 'src/app/services/patch-db/data-model'
|
||||||
import { MarketplacePkg, Metric, NotificationLevel, RR, ServerNotification, ServerNotifications } from './api-types'
|
import { MarketplacePkg, Metric, NotificationLevel, RR, ServerNotification, ServerNotifications } from './api.types'
|
||||||
|
|
||||||
export module Mock {
|
export module Mock {
|
||||||
|
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
import { HttpService } from '../http.service'
|
import { HttpService } from '../http.service'
|
||||||
import { MockApiService } from './mock-api.service'
|
import { MockApiService } from './embassy/embassy-mock-api.service'
|
||||||
import { LiveApiService } from './live-api.service'
|
import { LiveApiService } from './embassy/embassy-live-api.service'
|
||||||
import { ConfigService } from '../config.service'
|
import { ConfigService } from '../config.service'
|
||||||
import { PatchDbModel } from '../patch-db/patch-db.service'
|
import { PatchDbService } from '../patch-db/patch-db.service'
|
||||||
import { MarketplaceLiveApiService } from './marketplace-live-api.service'
|
import { MarketplaceLiveApiService } from './marketplace/marketplace-live-api.service'
|
||||||
import { MarketplaceMockApiService } from './marketplace-mock-api.service'
|
import { MarketplaceMockApiService } from './marketplace/marketplace-mock-api.service'
|
||||||
|
|
||||||
export function ApiServiceFactory (config: ConfigService, http: HttpService) {
|
export function ApiServiceFactory (config: ConfigService, http: HttpService) {
|
||||||
if (config.mocks.enabled) {
|
if (config.mocks.enabled) {
|
||||||
return new MockApiService(config, http)
|
return new MockApiService(http, config)
|
||||||
} else {
|
} else {
|
||||||
return new LiveApiService(config, http)
|
return new LiveApiService(http, config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MarketplaceApiServiceFactory (config: ConfigService, http: HttpService, patch: PatchDbModel) {
|
export function MarketplaceApiServiceFactory (config: ConfigService, http: HttpService, patch: PatchDbService) {
|
||||||
if (config.mocks.enabled) {
|
if (config.mocks.enabled) {
|
||||||
return new MarketplaceMockApiService(http, patch)
|
return new MarketplaceMockApiService(http, config, patch)
|
||||||
} else {
|
} else {
|
||||||
return new MarketplaceLiveApiService(http, patch)
|
return new MarketplaceLiveApiService(http, config, patch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,17 @@ export module RR {
|
|||||||
export type GetMarketplaceEOSReq = { }
|
export type GetMarketplaceEOSReq = { }
|
||||||
export type GetMarketplaceEOSRes = MarketplaceEOS
|
export type GetMarketplaceEOSRes = MarketplaceEOS
|
||||||
|
|
||||||
export type GetMarketplacePackagesReq = { id?: string, version?: string, category?: string, query?: string, page?: string, 'per-page'?: string }
|
export type GetMarketplacePackagesReq = {
|
||||||
|
ids?: string[]
|
||||||
|
id?: string
|
||||||
|
// iff id
|
||||||
|
version?: string
|
||||||
|
// iff !id
|
||||||
|
category?: string
|
||||||
|
query?: string
|
||||||
|
page?: string
|
||||||
|
'per-page'?: string
|
||||||
|
}
|
||||||
export type GetMarketplacePackagesRes = MarketplacePkg[]
|
export type GetMarketplacePackagesRes = MarketplacePkg[]
|
||||||
|
|
||||||
export type GetReleaseNotesReq = { id: string }
|
export type GetReleaseNotesReq = { id: string }
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Subject, Observable } from 'rxjs'
|
import { Subject, Observable } from 'rxjs'
|
||||||
import { Http, Update, Operation, Revision, Source, Store } from 'patch-db-client'
|
import { Http, Update, Operation, Revision, Source, Store } from 'patch-db-client'
|
||||||
import { RR } from './api-types'
|
import { RR } from '../api.types'
|
||||||
import { DataModel } from 'src/app/services/patch-db/data-model'
|
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
export abstract class ApiService implements Source<DataModel>, Http<DataModel> {
|
export abstract class ApiService implements Source<DataModel>, Http<DataModel> {
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HttpService, Method } from '../http.service'
|
import { HttpService, Method } from '../../http.service'
|
||||||
import { ApiService } from './api.service'
|
import { ApiService } from './embassy-api.service'
|
||||||
import { RR } from './api-types'
|
import { RR } from '../api.types'
|
||||||
import { parsePropertiesPermissive } from 'src/app/util/properties.util'
|
import { parsePropertiesPermissive } from 'src/app/util/properties.util'
|
||||||
import { ConfigService } from '../config.service'
|
import { ConfigService } from '../../config.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LiveApiService extends ApiService {
|
export class LiveApiService extends ApiService {
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly config: ConfigService,
|
|
||||||
private readonly http: HttpService,
|
private readonly http: HttpService,
|
||||||
|
private readonly config: ConfigService,
|
||||||
) { super() }
|
) { super() }
|
||||||
|
|
||||||
async getStatic (url: string): Promise<string> {
|
async getStatic (url: string): Promise<string> {
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { pauseFor } from '../../util/misc.util'
|
import { pauseFor } from '../../../util/misc.util'
|
||||||
import { ApiService } from './api.service'
|
import { ApiService } from './embassy-api.service'
|
||||||
import { PatchOp } from 'patch-db-client'
|
import { PatchOp } from 'patch-db-client'
|
||||||
import { PackageDataEntry, PackageMainStatus, PackageState, ServerStatus } from 'src/app/services/patch-db/data-model'
|
import { PackageDataEntry, PackageMainStatus, PackageState, ServerStatus } from 'src/app/services/patch-db/data-model'
|
||||||
import { RR, WithRevision } from './api-types'
|
import { RR, WithRevision } from '../api.types'
|
||||||
import { parsePropertiesPermissive } from 'src/app/util/properties.util'
|
import { parsePropertiesPermissive } from 'src/app/util/properties.util'
|
||||||
import { Mock } from './mock-app-fixures'
|
import { Mock } from '../api.fixures'
|
||||||
import { HttpService } from '../http.service'
|
import { HttpService } from '../../http.service'
|
||||||
import markdown from 'raw-loader!src/assets/markdown/md-sample.md'
|
import markdown from 'raw-loader!src/assets/markdown/md-sample.md'
|
||||||
import { ConfigService } from '../config.service'
|
import { ConfigService } from '../../config.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MockApiService extends ApiService {
|
export class MockApiService extends ApiService {
|
||||||
welcomeAck = false
|
welcomeAck = false
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly config: ConfigService,
|
|
||||||
private readonly http: HttpService,
|
private readonly http: HttpService,
|
||||||
|
private readonly config: ConfigService,
|
||||||
) { super() }
|
) { super() }
|
||||||
|
|
||||||
async getStatic (url: string): Promise<string> {
|
async getStatic (url: string): Promise<string> {
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { RR } from './api-types'
|
|
||||||
// import { DataModel } from 'src/app/services/patch-db/data-model'
|
|
||||||
import { DataModel } from '../../../../src/app/services/patch-db/data-model'
|
|
||||||
|
|
||||||
export abstract class MarketplaceApiService {
|
|
||||||
abstract getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes>
|
|
||||||
|
|
||||||
abstract getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes>
|
|
||||||
|
|
||||||
abstract getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes>
|
|
||||||
|
|
||||||
abstract getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes>
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getMarketURL (eosOrPackage: 'eos' | 'package', data: DataModel): string {
|
|
||||||
const eosMarketplace = data['server-info']['eos-marketplace']
|
|
||||||
if (eosOrPackage === 'eos') {
|
|
||||||
return eosMarketplace
|
|
||||||
} else {
|
|
||||||
const packageMarketplace = data['server-info']['package-marketplace']
|
|
||||||
return packageMarketplace || eosMarketplace
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core'
|
|
||||||
import { HttpService } from '../http.service'
|
|
||||||
import { getMarketURL } from './marketplace-api.service'
|
|
||||||
import { RR } from './api-types'
|
|
||||||
import { MarketplaceApiService } from './marketplace-api.service'
|
|
||||||
import { PatchDbModel } from '../patch-db/patch-db.service'
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class MarketplaceLiveApiService extends MarketplaceApiService {
|
|
||||||
|
|
||||||
constructor (
|
|
||||||
private readonly http: HttpService,
|
|
||||||
private readonly patch: PatchDbModel,
|
|
||||||
) { super() }
|
|
||||||
|
|
||||||
async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> {
|
|
||||||
return this.http.simpleGet<RR.GetMarketplaceDataRes>(getMarketURL('package', this.patch.data), params)
|
|
||||||
}
|
|
||||||
|
|
||||||
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
|
||||||
return this.http.simpleGet<RR.GetMarketplaceEOSRes>(getMarketURL('eos', this.patch.data), params)
|
|
||||||
}
|
|
||||||
|
|
||||||
async getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes> {
|
|
||||||
return this.http.simpleGet<RR.GetMarketplacePackagesRes>(getMarketURL('package', this.patch.data), params)
|
|
||||||
}
|
|
||||||
|
|
||||||
async getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes> {
|
|
||||||
return this.http.simpleGet<RR.GetReleaseNotesRes>(getMarketURL('package', this.patch.data), params)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { RR } from '../api.types'
|
||||||
|
import { ConfigService } from '../../config.service'
|
||||||
|
import { PatchDbService } from '../../patch-db/patch-db.service'
|
||||||
|
|
||||||
|
export abstract class MarketplaceApiService {
|
||||||
|
|
||||||
|
constructor (
|
||||||
|
readonly config: ConfigService,
|
||||||
|
readonly patch: PatchDbService,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
abstract getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes>
|
||||||
|
|
||||||
|
abstract getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes>
|
||||||
|
|
||||||
|
abstract getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes>
|
||||||
|
|
||||||
|
abstract getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes>
|
||||||
|
|
||||||
|
getMarketplaceURL (type: 'eos' | 'package'): string {
|
||||||
|
const eosMarketplace = this.patch.data['server-info']['eos-marketplace'] || this.config.start9Marketplace.clearnet
|
||||||
|
if (type === 'eos') {
|
||||||
|
return eosMarketplace
|
||||||
|
} else {
|
||||||
|
const packageMarketplace = this.patch.data['server-info']['package-marketplace']
|
||||||
|
return packageMarketplace || eosMarketplace
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { Injectable } from '@angular/core'
|
||||||
|
import { HttpService } from '../../http.service'
|
||||||
|
import { RR } from '../api.types'
|
||||||
|
import { MarketplaceApiService } from './marketplace-api.service'
|
||||||
|
import { PatchDbService } from '../../patch-db/patch-db.service'
|
||||||
|
import { ConfigService } from '../../config.service'
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class MarketplaceLiveApiService extends MarketplaceApiService {
|
||||||
|
|
||||||
|
constructor (
|
||||||
|
private readonly http: HttpService,
|
||||||
|
config: ConfigService,
|
||||||
|
patch: PatchDbService,
|
||||||
|
) {
|
||||||
|
super(config, patch)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
||||||
|
return this.http.simpleGet<RR.GetMarketplaceEOSRes>(this.getMarketplaceURL('eos'), params)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> {
|
||||||
|
return this.http.simpleGet<RR.GetMarketplaceDataRes>(this.getMarketplaceURL('package'), params)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes> {
|
||||||
|
return this.http.simpleGet<RR.GetMarketplacePackagesRes>(this.getMarketplaceURL('package'), params)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes> {
|
||||||
|
return this.http.simpleGet<RR.GetReleaseNotesRes>(this.getMarketplaceURL('package'), params)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,62 +1,68 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { pauseFor } from '../../util/misc.util'
|
import { pauseFor } from '../../../util/misc.util'
|
||||||
import { RR } from './api-types'
|
import { RR } from '../api.types'
|
||||||
import { Mock } from './mock-app-fixures'
|
import { Mock } from '../api.fixures'
|
||||||
import { HttpService } from '../http.service'
|
import { HttpService } from '../../http.service'
|
||||||
import { MarketplaceApiService } from './marketplace-api.service'
|
import { MarketplaceApiService } from './marketplace-api.service'
|
||||||
import { getMarketURL } from './marketplace-api.service'
|
import { PatchDbService } from '../../patch-db/patch-db.service'
|
||||||
import { PatchDbModel } from '../patch-db/patch-db.service'
|
import { ConfigService } from '../../config.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MarketplaceMockApiService extends MarketplaceApiService {
|
export class MarketplaceMockApiService extends MarketplaceApiService {
|
||||||
welcomeAck = false
|
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly http: HttpService,
|
private readonly http: HttpService,
|
||||||
private readonly patch: PatchDbModel,
|
config: ConfigService,
|
||||||
) { super() }
|
patch: PatchDbService,
|
||||||
|
) {
|
||||||
|
super(config, patch)
|
||||||
|
}
|
||||||
|
|
||||||
// marketplace
|
// marketplace
|
||||||
|
|
||||||
|
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
||||||
|
let url = this.getMarketplaceURL('eos')
|
||||||
|
if (this.useLocal(url)) {
|
||||||
|
await pauseFor(2000)
|
||||||
|
return Mock.MarketplaceEos
|
||||||
|
}
|
||||||
|
url = `${url}/sys/version/eos`
|
||||||
|
return this.http.simpleGet<RR.GetMarketplaceEOSRes>(url)
|
||||||
|
}
|
||||||
|
|
||||||
async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> {
|
async getMarketplaceData (params: RR.GetMarketplaceDataReq): Promise<RR.GetMarketplaceDataRes> {
|
||||||
const registryURL = getMarketURL('package', this.patch.data)
|
let url = this.getMarketplaceURL('package')
|
||||||
if (!registryURL) {
|
if (this.useLocal(url)) {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return {
|
return {
|
||||||
categories: ['featured', 'bitcoin', 'lightning', 'data', 'messaging', 'social', 'alt coin'],
|
categories: ['featured', 'bitcoin', 'lightning', 'data', 'messaging', 'social', 'alt coin'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = `${registryURL}/marketplace/data`
|
url = `${url}/marketplace/data`
|
||||||
return this.http.simpleGet<RR.GetMarketplaceDataRes>(url)
|
return this.http.simpleGet<RR.GetMarketplaceDataRes>(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
|
||||||
const registryURL = getMarketURL('eos', this.patch.data)
|
|
||||||
if (!registryURL) {
|
|
||||||
await pauseFor(2000)
|
|
||||||
return Mock.MarketplaceEos
|
|
||||||
}
|
|
||||||
const url = `${registryURL}/sys/version/eos`
|
|
||||||
return this.http.simpleGet<RR.GetMarketplaceEOSRes>(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
async getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes> {
|
async getMarketplacePkgs (params: RR.GetMarketplacePackagesReq): Promise<RR.GetMarketplacePackagesRes> {
|
||||||
const registryURL = getMarketURL('package', this.patch.data)
|
let url = this.getMarketplaceURL('package')
|
||||||
if (!registryURL) {
|
if (this.useLocal(url)) {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return Mock.AvailableList
|
return Mock.AvailableList
|
||||||
}
|
}
|
||||||
const url = `${registryURL}/marketplace/packages`
|
url = `${url}/marketplace/packages`
|
||||||
return this.http.simpleGet<RR.GetMarketplacePackagesRes>(url, params)
|
return this.http.simpleGet<RR.GetMarketplacePackagesRes>(url, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes> {
|
async getReleaseNotes (params: RR.GetReleaseNotesReq): Promise<RR.GetReleaseNotesRes> {
|
||||||
const registryURL = getMarketURL('package', this.patch.data)
|
let url = this.getMarketplaceURL('package')
|
||||||
if (!registryURL) {
|
if (this.useLocal(url)) {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return Mock.ReleaseNotes
|
return Mock.ReleaseNotes
|
||||||
}
|
}
|
||||||
const url = `${registryURL}/marketplace/release-notes`
|
url = `${url}/marketplace/release-notes`
|
||||||
return this.http.simpleGet<RR.GetReleaseNotesRes>(url)
|
return this.http.simpleGet<RR.GetReleaseNotesRes>(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private useLocal (url: string): boolean {
|
||||||
|
return !url || this.config.mocks.marketplace
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { BehaviorSubject, Observable } from 'rxjs'
|
import { BehaviorSubject, Observable } from 'rxjs'
|
||||||
import { distinctUntilChanged } from 'rxjs/operators'
|
import { distinctUntilChanged } from 'rxjs/operators'
|
||||||
import { ApiService } from './api/api.service'
|
import { ApiService } from './api/embassy/embassy-api.service'
|
||||||
import { Storage } from '@ionic/storage'
|
import { Storage } from '@ionic/storage'
|
||||||
|
|
||||||
export enum AuthState {
|
export enum AuthState {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ type UiConfig = {
|
|||||||
}
|
}
|
||||||
mocks: {
|
mocks: {
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
|
marketplace: boolean
|
||||||
connection: 'ws' | 'poll'
|
connection: 'ws' | 'poll'
|
||||||
rpcPort: number
|
rpcPort: number
|
||||||
wsPort: number
|
wsPort: number
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { BehaviorSubject, combineLatest, fromEvent, merge, Subscription } from 'rxjs'
|
import { BehaviorSubject, combineLatest, fromEvent, merge, Subscription } from 'rxjs'
|
||||||
import { ConnectionStatus, PatchDbModel } from './patch-db/patch-db.service'
|
import { ConnectionStatus, PatchDbService } from './patch-db/patch-db.service'
|
||||||
import { HttpService, Method } from './http.service'
|
import { HttpService, Method } from './http.service'
|
||||||
import { distinctUntilChanged } from 'rxjs/operators'
|
import { distinctUntilChanged } from 'rxjs/operators'
|
||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
@@ -16,7 +16,7 @@ export class ConnectionService {
|
|||||||
constructor (
|
constructor (
|
||||||
private readonly httpService: HttpService,
|
private readonly httpService: HttpService,
|
||||||
private readonly configService: ConfigService,
|
private readonly configService: ConfigService,
|
||||||
private readonly patch: PatchDbModel,
|
private readonly patch: PatchDbService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
watchFailure$ () {
|
watchFailure$ () {
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import { PollSource, Source, WebsocketSource } from 'patch-db-client'
|
|||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { DataModel } from './data-model'
|
import { DataModel } from './data-model'
|
||||||
import { LocalStorageBootstrap } from './local-storage-bootstrap'
|
import { LocalStorageBootstrap } from './local-storage-bootstrap'
|
||||||
import { PatchDbModel } from './patch-db.service'
|
import { PatchDbService } from './patch-db.service'
|
||||||
import { ApiService } from 'src/app/services/api/api.service'
|
import { ApiService } from 'src/app/services/api/embassy/embassy-api.service'
|
||||||
|
|
||||||
export function PatchDbModelFactory (
|
export function PatchDbServiceFactory (
|
||||||
config: ConfigService,
|
config: ConfigService,
|
||||||
bootstrapper: LocalStorageBootstrap,
|
bootstrapper: LocalStorageBootstrap,
|
||||||
apiService: ApiService,
|
apiService: ApiService,
|
||||||
): PatchDbModel {
|
): PatchDbService {
|
||||||
|
|
||||||
const { mocks, patchDb: { poll }, isConsulate } = config
|
const { mocks, patchDb: { poll }, isConsulate } = config
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ export function PatchDbModelFactory (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PatchDbModel(source, apiService, bootstrapper)
|
return new PatchDbService(source, apiService, bootstrapper)
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ import { Inject, Injectable, InjectionToken } from '@angular/core'
|
|||||||
import { Bootstrapper, PatchDB, Source, Store } from 'patch-db-client'
|
import { Bootstrapper, PatchDB, Source, Store } from 'patch-db-client'
|
||||||
import { BehaviorSubject, Observable, of, Subscription } from 'rxjs'
|
import { BehaviorSubject, Observable, of, Subscription } from 'rxjs'
|
||||||
import { catchError, debounceTime, finalize, map, tap } from 'rxjs/operators'
|
import { catchError, debounceTime, finalize, map, tap } from 'rxjs/operators'
|
||||||
import { ApiService } from '../api/api.service'
|
import { ApiService } from '../api/embassy/embassy-api.service'
|
||||||
import { DataModel } from './data-model'
|
import { DataModel } from './data-model'
|
||||||
|
|
||||||
export const PATCH_HTTP = new InjectionToken<Source<DataModel>>('app.config')
|
export const PATCH_HTTP = new InjectionToken<Source<DataModel>>('app.config')
|
||||||
@@ -18,7 +18,7 @@ export enum ConnectionStatus {
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class PatchDbModel {
|
export class PatchDbService {
|
||||||
connectionStatus$ = new BehaviorSubject(ConnectionStatus.Initializing)
|
connectionStatus$ = new BehaviorSubject(ConnectionStatus.Initializing)
|
||||||
sequence$: Observable<number>
|
sequence$: Observable<number>
|
||||||
data: DataModel
|
data: DataModel
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { AppConfigValuePage } from '../modals/app-config-value/app-config-value.page'
|
import { AppConfigValuePage } from '../modals/app-config-value/app-config-value.page'
|
||||||
import { ApiService } from './api/api.service'
|
import { ApiService } from './api/embassy/embassy-api.service'
|
||||||
import { ConfigSpec } from '../pkg-config/config-types'
|
import { ConfigSpec } from '../pkg-config/config-types'
|
||||||
import { ConfigCursor } from '../pkg-config/config-cursor'
|
import { ConfigCursor } from '../pkg-config/config-cursor'
|
||||||
import { SSHService } from '../pages/server-routes/developer-routes/dev-ssh-keys/ssh.service'
|
import { SSHService } from '../pages/server-routes/developer-routes/dev-ssh-keys/ssh.service'
|
||||||
|
|||||||
@@ -4,60 +4,65 @@ import { wizardModal } from '../components/install-wizard/install-wizard.compone
|
|||||||
import { WizardBaker } from '../components/install-wizard/prebaked-wizards'
|
import { WizardBaker } from '../components/install-wizard/prebaked-wizards'
|
||||||
import { OSWelcomePage } from '../modals/os-welcome/os-welcome.page'
|
import { OSWelcomePage } from '../modals/os-welcome/os-welcome.page'
|
||||||
import { displayEmver } from '../pipes/emver.pipe'
|
import { displayEmver } from '../pipes/emver.pipe'
|
||||||
import { ApiService } from './api/api.service'
|
import { RR } from './api/api.types'
|
||||||
|
import { MarketplaceApiService } from './api/marketplace/marketplace-api.service'
|
||||||
|
import { PatchDbService } from './patch-db/patch-db.service'
|
||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
import { Emver } from './emver.service'
|
import { Emver } from './emver.service'
|
||||||
import { OsUpdateService } from './os-update.service'
|
|
||||||
|
|
||||||
@Injectable({providedIn: 'root' })
|
@Injectable({
|
||||||
export class StartupAlertsNotifier {
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class StartupAlertsService {
|
||||||
|
private checks: Check<any>[]
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly alertCtrl: AlertController,
|
private readonly alertCtrl: AlertController,
|
||||||
private readonly navCtrl: NavController,
|
private readonly navCtrl: NavController,
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
private readonly modalCtrl: ModalController,
|
private readonly modalCtrl: ModalController,
|
||||||
private readonly apiService: ApiService,
|
private readonly marketplaceApi: MarketplaceApiService,
|
||||||
private readonly emver: Emver,
|
private readonly emver: Emver,
|
||||||
private readonly osUpdateService: OsUpdateService,
|
|
||||||
private readonly wizardBaker: WizardBaker,
|
private readonly wizardBaker: WizardBaker,
|
||||||
|
private readonly patch: PatchDbService,
|
||||||
) {
|
) {
|
||||||
const welcome: Check<S9Server> = {
|
const welcome: Check<boolean> = {
|
||||||
name: 'welcome',
|
name: 'welcome',
|
||||||
shouldRun: s => this.shouldRunOsWelcome(s),
|
shouldRun: () => this.shouldRunOsWelcome(),
|
||||||
check: async s => s,
|
check: async () => true,
|
||||||
display: s => this.displayOsWelcome(s),
|
display: () => this.displayOsWelcome(),
|
||||||
hasRun: this.config.skipStartupAlerts,
|
hasRun: this.config.skipStartupAlerts,
|
||||||
}
|
}
|
||||||
const osUpdate: Check<ReqRes.GetVersionLatestRes | undefined> = {
|
const osUpdate: Check<RR.GetMarketplaceEOSRes | undefined> = {
|
||||||
name: 'osUpdate',
|
name: 'osUpdate',
|
||||||
shouldRun: s => this.shouldRunOsUpdateCheck(s),
|
shouldRun: () => this.shouldRunOsUpdateCheck(),
|
||||||
check: s => this.osUpdateCheck(s),
|
check: () => this.osUpdateCheck(),
|
||||||
display: vl => this.displayOsUpdateCheck(vl),
|
display: pkg => this.displayOsUpdateCheck(pkg),
|
||||||
hasRun: this.config.skipStartupAlerts,
|
hasRun: this.config.skipStartupAlerts,
|
||||||
}
|
}
|
||||||
const apps: Check<boolean> = {
|
const apps: Check<boolean> = {
|
||||||
name: 'apps',
|
name: 'apps',
|
||||||
shouldRun: s => this.shouldRunAppsCheck(s),
|
shouldRun: () => this.shouldRunAppsCheck(),
|
||||||
check: () => this.appsCheck(),
|
check: () => this.appsCheck(),
|
||||||
display: () => this.displayAppsCheck(),
|
display: () => this.displayAppsCheck(),
|
||||||
hasRun: this.config.skipStartupAlerts,
|
hasRun: this.config.skipStartupAlerts,
|
||||||
}
|
}
|
||||||
this.checks = [welcome, osUpdate, v1StatusUpdate, apps]
|
this.checks = [welcome, osUpdate, apps]
|
||||||
}
|
}
|
||||||
|
|
||||||
// This takes our three checks and filters down to those that should run.
|
// This takes our three checks and filters down to those that should run.
|
||||||
// Then, the reduce fires, quickly iterating through yielding a promise (previousDisplay) to the next element
|
// Then, the reduce fires, quickly iterating through yielding a promise (previousDisplay) to the next element
|
||||||
// Each promise fires more or less concurrently, so each c.check(server) is run concurrently
|
// Each promise fires more or less concurrently, so each c.check(server) is run concurrently
|
||||||
// Then, since we await previoudDisplay before c.display(res), each promise executing gets hung awaiting the display of the previous run
|
// Then, since we await previousDisplay before c.display(res), each promise executing gets hung awaiting the display of the previous run
|
||||||
async runChecks (server: Readonly<S9Server>): Promise<void> {
|
async runChecks (): Promise<void> {
|
||||||
await this.checks
|
await this.checks
|
||||||
.filter(c => !c.hasRun && c.shouldRun(server))
|
.filter(c => !c.hasRun && c.shouldRun())
|
||||||
// returning true in the below block means to continue to next modal
|
// returning true in the below block means to continue to next modal
|
||||||
// returning false means to skip all subsequent modals
|
// returning false means to skip all subsequent modals
|
||||||
.reduce(async (previousDisplay, c) => {
|
.reduce(async (previousDisplay, c) => {
|
||||||
let checkRes: any
|
let checkRes: any
|
||||||
try {
|
try {
|
||||||
checkRes = await c.check(server)
|
checkRes = await c.check()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Exception in ${c.name} check:`, e)
|
console.error(`Exception in ${c.name} check:`, e)
|
||||||
return true
|
return true
|
||||||
@@ -70,44 +75,49 @@ export class StartupAlertsNotifier {
|
|||||||
}, Promise.resolve(true))
|
}, Promise.resolve(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
checks: Check<any>[]
|
private shouldRunOsWelcome (): boolean {
|
||||||
|
const data = this.patch.data
|
||||||
private shouldRunOsWelcome (s: S9Server): boolean {
|
return !data.ui['welcome-ack'] && data['server-info'].version === this.config.version
|
||||||
return !s.welcomeAck && s.versionInstalled === this.config.version
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private shouldRunAppsCheck (server: S9Server): boolean {
|
private shouldRunOsUpdateCheck (): boolean {
|
||||||
return server.autoCheckUpdates
|
return this.patch.data.ui['auto-check-updates']
|
||||||
}
|
}
|
||||||
|
|
||||||
private shouldRunOsUpdateCheck (server: S9Server): boolean {
|
private shouldRunAppsCheck (): boolean {
|
||||||
return server.autoCheckUpdates
|
return this.patch.data.ui['auto-check-updates']
|
||||||
}
|
}
|
||||||
|
|
||||||
private async v1StatusCheck (): Promise<V1Status> {
|
private async osUpdateCheck (): Promise<RR.GetMarketplaceEOSRes | undefined> {
|
||||||
return this.apiService.checkV1Status()
|
const res = await this.marketplaceApi.getEos({ })
|
||||||
}
|
|
||||||
|
|
||||||
private async osUpdateCheck (s: Readonly<S9Server>): Promise<ReqRes.GetVersionLatestRes | undefined> {
|
if (this.emver.compare(this.patch.data['server-info'].version, res.version) === -1) {
|
||||||
const res = await this.apiService.getVersionLatest()
|
return res
|
||||||
return this.osUpdateService.updateIsAvailable(s.versionInstalled, res) ? res : undefined
|
} else {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async appsCheck (): Promise<boolean> {
|
private async appsCheck (): Promise<boolean> {
|
||||||
const availableApps = await this.apiService.getAvailableApps()
|
const pkgs = await this.marketplaceApi.getMarketplacePkgs({
|
||||||
return !!availableApps.find(
|
ids: Object.keys(this.patch.data['package-data']).filter(id => {
|
||||||
app => app.versionInstalled && this.emver.compare(app.versionInstalled, app.versionLatest) === -1,
|
return !!this.patch.data['package-data'][id].installed
|
||||||
)
|
}),
|
||||||
|
})
|
||||||
|
return !!pkgs.find(pkg => {
|
||||||
|
const versionInstalled = this.patch.data['package-data'][pkg.manifest.id].manifest.version
|
||||||
|
return this.emver.compare(versionInstalled, pkg.manifest.version) === -1
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private async displayOsWelcome (s: Readonly<S9Server>): Promise<boolean> {
|
private async displayOsWelcome (): Promise<boolean> {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const modal = await this.modalCtrl.create({
|
const modal = await this.modalCtrl.create({
|
||||||
backdropDismiss: false,
|
backdropDismiss: false,
|
||||||
component: OSWelcomePage,
|
component: OSWelcomePage,
|
||||||
presentingElement: await this.modalCtrl.getTop(),
|
presentingElement: await this.modalCtrl.getTop(),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
version: s.versionInstalled,
|
version: this.patch.data['server-info'].version,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -118,14 +128,15 @@ export class StartupAlertsNotifier {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private async displayOsUpdateCheck (res: ReqRes.GetVersionLatestRes): Promise<boolean> {
|
private async displayOsUpdateCheck (eos: RR.GetMarketplaceEOSRes): Promise<boolean> {
|
||||||
const { update } = await this.presentAlertNewOS(res.versionLatest)
|
const { update } = await this.presentAlertNewOS(eos.version)
|
||||||
if (update) {
|
if (update) {
|
||||||
const { cancelled } = await wizardModal(
|
const { cancelled } = await wizardModal(
|
||||||
this.modalCtrl,
|
this.modalCtrl,
|
||||||
this.wizardBaker.updateOS({
|
this.wizardBaker.updateOS({
|
||||||
version: res.versionLatest,
|
version: eos.version,
|
||||||
releaseNotes: res.releaseNotes,
|
headline: eos.headline,
|
||||||
|
releaseNotes: eos['release-notes'],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
if (cancelled) return true
|
if (cancelled) return true
|
||||||
@@ -134,33 +145,6 @@ export class StartupAlertsNotifier {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
private async displayV1Check (s: V1Status): Promise<boolean> {
|
|
||||||
return new Promise(async resolve => {
|
|
||||||
if (s.status !== 'available') return resolve(true)
|
|
||||||
const alert = await this.alertCtrl.create({
|
|
||||||
backdropDismiss: true,
|
|
||||||
header: `EmbassyOS ${s.version} Now Available!`,
|
|
||||||
message: `Version ${s.version} introduces SSD support and a whole lot more.`,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: 'Cancel',
|
|
||||||
role: 'cancel',
|
|
||||||
handler: () => resolve(true),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'View Instructions',
|
|
||||||
handler: () => {
|
|
||||||
window.open(`https://start9.com/eos-${s.version}`, '_blank')
|
|
||||||
resolve(false)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
await alert.present()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
private async displayAppsCheck (): Promise<boolean> {
|
private async displayAppsCheck (): Promise<boolean> {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const alert = await this.alertCtrl.create({
|
const alert = await this.alertCtrl.create({
|
||||||
@@ -223,9 +207,9 @@ export class StartupAlertsNotifier {
|
|||||||
|
|
||||||
type Check<T> = {
|
type Check<T> = {
|
||||||
// validates whether a check should run based on server properties
|
// validates whether a check should run based on server properties
|
||||||
shouldRun: (s: S9Server) => boolean
|
shouldRun: () => boolean
|
||||||
// executes a check, often requiring api call. It should return a false-y value if there should be no display.
|
// executes a check, often requiring api call. It should return a false-y value if there should be no display.
|
||||||
check: (s: S9Server) => Promise<T>
|
check: () => Promise<T>
|
||||||
// display an alert based on the result of the check.
|
// display an alert based on the result of the check.
|
||||||
// return false if subsequent modals should not be displayed
|
// return false if subsequent modals should not be displayed
|
||||||
display: (a: T) => Promise<boolean>
|
display: (a: T) => Promise<boolean>
|
||||||
Reference in New Issue
Block a user