From 952205f85a0ce1269b2c3da4511c31fdccd8e3b8 Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Mon, 30 Aug 2021 14:04:01 -0600 Subject: [PATCH] misc changes --- .../complete/complete.component.ts | 3 +- .../app/modals/app-config/app-config.page.ts | 2 - .../backup-confirmation.component.ts | 3 +- .../apps-routes/app-list/app-list.page.html | 2 +- .../app-properties/app-properties.page.ts | 1 + .../apps-routes/app-show/app-show.page.html | 284 +++++++++--------- .../apps-routes/app-show/app-show.page.ts | 1 + .../app-release-notes.page.html | 2 +- .../app-release-notes.page.ts | 16 +- .../security-routes/ssh-keys/ssh-keys.page.ts | 2 +- ui/src/app/services/config.service.ts | 8 + 11 files changed, 172 insertions(+), 152 deletions(-) diff --git a/ui/src/app/components/install-wizard/complete/complete.component.ts b/ui/src/app/components/install-wizard/complete/complete.component.ts index dc71236d7..ea239117f 100644 --- a/ui/src/app/components/install-wizard/complete/complete.component.ts +++ b/ui/src/app/components/install-wizard/complete/complete.component.ts @@ -13,7 +13,7 @@ import { WizardAction } from '../wizard-types' export class CompleteComponent implements OnInit, Loadable { @Input() params: { action: WizardAction - verb: string //loader verb: '*stopping* ...' + verb: string // loader verb: '*stopping* ...' title: string executeAction: () => Promise skipCompletionDialogue?: boolean @@ -26,7 +26,6 @@ export class CompleteComponent implements OnInit, Loadable { error: (e: Error) => void } - loading$ = new BehaviorSubject(false) color$ = new BehaviorSubject('medium') cancel$ = new Subject() diff --git a/ui/src/app/modals/app-config/app-config.page.ts b/ui/src/app/modals/app-config/app-config.page.ts index 66558c084..4872cc676 100644 --- a/ui/src/app/modals/app-config/app-config.page.ts +++ b/ui/src/app/modals/app-config/app-config.page.ts @@ -43,11 +43,9 @@ export class AppConfigPage { async ngOnInit () { const rec = history.state?.configRecommendation as Recommendation - try { this.loadingText = 'Loading Config' const { spec, config } = await this.embassyApi.getPackageConfig({ id: this.pkgId }) - let depConfig: object if (rec) { this.loadingText = `Setting properties to accommodate ${rec.dependentTitle}...` diff --git a/ui/src/app/modals/backup-confirmation/backup-confirmation.component.ts b/ui/src/app/modals/backup-confirmation/backup-confirmation.component.ts index 56edf0e6f..7fc35e536 100644 --- a/ui/src/app/modals/backup-confirmation/backup-confirmation.component.ts +++ b/ui/src/app/modals/backup-confirmation/backup-confirmation.component.ts @@ -1,6 +1,7 @@ import { Component, Input } from '@angular/core' import { IonicSafeString, LoadingController, ModalController } from '@ionic/angular' -import { getErrorMessage } from 'src/app/services/error-toast.service' +import { ApiService } from 'src/app/services/api/embassy-api.service' +import { ErrorToastService, getErrorMessage } from 'src/app/services/error-toast.service' @Component({ selector: 'backup-confirmation', diff --git a/ui/src/app/pages/apps-routes/app-list/app-list.page.html b/ui/src/app/pages/apps-routes/app-list/app-list.page.html index fd55a7c55..c1215b267 100644 --- a/ui/src/app/pages/apps-routes/app-list/app-list.page.html +++ b/ui/src/app/pages/apps-routes/app-list/app-list.page.html @@ -25,7 +25,7 @@
-
+
diff --git a/ui/src/app/pages/apps-routes/app-properties/app-properties.page.ts b/ui/src/app/pages/apps-routes/app-properties/app-properties.page.ts index 70de05dcf..c295d4b43 100644 --- a/ui/src/app/pages/apps-routes/app-properties/app-properties.page.ts +++ b/ui/src/app/pages/apps-routes/app-properties/app-properties.page.ts @@ -122,6 +122,7 @@ export class AppPropertiesPage { this.properties = await this.embassyApi.getPackageProperties({ id: this.pkgId }) this.node = JsonPointer.get(this.properties, this.pointer || '') } catch (e) { + console.log('catching') this.errToast.present(e) } finally { this.loading = false diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.html b/ui/src/app/pages/apps-routes/app-show/app-show.page.html index 392623b6d..f1444a48b 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.html +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.html @@ -1,156 +1,158 @@ - - - - - - - - - - -

- {{ pkg.manifest.title }} -

-

{{ pkg.manifest.version | displayEmver }}

-
-
-
-
+ + + + + + + + + + + +

+ {{ pkg.manifest.title }} +

+

{{ pkg.manifest.version | displayEmver }}

+
+
+
+
- - - - Status - - - - - - - Open UI - - - - Configure + + + + Status + + + + + + + Open UI - - Stop - - - Fix - - - Start - - - - - - - - - - - Health Checks - - - - - - - - - - - - - - - - - - -

{{ health.key }}

-

{{ health.value.result }}

-

{{ health.value.error }}

-
-
-
+ + + Configure + + + Stop + + + Fix + + + Start + + - - Menu - - - {{ button.title }} - + + + + + + + Health Checks + + + + + + + + + + + + + + + + + + +

{{ health.key }}

+

{{ health.value.result }}

+

{{ health.value.error }}

+
+
+
+
- - - Dependencies - - - - - - -

{{ pkg.installed['dependency-info'][dep.key].manifest.title }}

-

{{ pkg.manifest.dependencies[dep.key].version | displayEmver }}

-

{{ pkg.installed.status['dependency-errors'][dep.key] ? pkg.installed.status['dependency-errors'][dep.key].type : 'satisfied' }}

-
+ + Menu + + + {{ button.title }} + - - View - + + + Dependencies + + + + + + +

{{ pkg.installed['dependency-info'][dep.key].manifest.title }}

+

{{ pkg.manifest.dependencies[dep.key].version | displayEmver }}

+

{{ pkg.installed.status['dependency-errors'][dep.key] ? pkg.installed.status['dependency-errors'][dep.key].type : 'satisfied' }}

+
- - - Install + + View - - - Start + + + Install - - Update - - - Configure - - -
- -
-
-
-
+ + + Start + + + Update + + + Configure + + + +
+ +
+
+ +
+
+ + App is undergoing maintenance. +
- - App is undergoing maintenance. - -
-
+ - -
-

Downloading: {{ (pkg['install-progress'] | installState).downloadProgress }}%

- + +
+

Downloading: {{ (pkg['install-progress'] | installState).downloadProgress }}%

+ -

Validating: {{ (pkg['install-progress'] | installState).validateProgress }}%

- +

Validating: {{ (pkg['install-progress'] | installState).validateProgress }}%

+ -

Installing: {{ (pkg['install-progress'] | installState).unpackProgress }}%

- -
- +

Installing: {{ (pkg['install-progress'] | installState).unpackProgress }}%

+ +
+
+
\ No newline at end of file diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index ea48f7085..9e05ee079 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -32,6 +32,7 @@ export class AppShowPage { mainStatus: MainStatus PackageMainStatus = PackageMainStatus connectionFailure: boolean + loading = true @ViewChild(IonContent) content: IonContent subs: Subscription[] = [] diff --git a/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.html b/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.html index a42d165e9..4db212249 100644 --- a/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.html +++ b/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.html @@ -8,7 +8,7 @@ - +
diff --git a/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.ts b/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.ts index 7621c8494..76e2e5ce5 100644 --- a/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.ts +++ b/ui/src/app/pages/marketplace-routes/app-release-notes/app-release-notes.page.ts @@ -1,6 +1,7 @@ import { Component, ViewChild } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { IonContent } from '@ionic/angular' +import { ErrorToastService } from 'src/app/services/error-toast.service' import { MarketplaceService } from '../marketplace.service' @Component({ @@ -12,17 +13,26 @@ export class AppReleaseNotes { @ViewChild(IonContent) content: IonContent selected: string pkgId: string + loading = true constructor ( private readonly route: ActivatedRoute, public marketplaceService: MarketplaceService, + public errToast: ErrorToastService, ) { } - ngOnInit () { + async ngOnInit () { this.pkgId = this.route.snapshot.paramMap.get('pkgId') - if (!this.marketplaceService.releaseNotes[this.pkgId]) { - this.marketplaceService.getReleaseNotes(this.pkgId) + try { + if (!this.marketplaceService.releaseNotes[this.pkgId]) { + await this.marketplaceService.getReleaseNotes(this.pkgId) + } + } catch (e) { + this.errToast.present(e) + } finally { + this.loading = false } + } ngAfterViewInit () { diff --git a/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts b/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts index c594ab766..903fd2b6d 100644 --- a/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts +++ b/ui/src/app/pages/server-routes/security-routes/ssh-keys/ssh-keys.page.ts @@ -46,7 +46,7 @@ export class SSHKeysPage { title: name, message: description, label: name, - submitFn: this.add, + submitFn: async (pk: string) => await this.add(pk), }, cssClass: 'alertlike-modal', }) diff --git a/ui/src/app/services/config.service.ts b/ui/src/app/services/config.service.ts index 276bbb46e..149e2e61a 100644 --- a/ui/src/app/services/config.service.ts +++ b/ui/src/app/services/config.service.ts @@ -50,6 +50,14 @@ export class ConfigService { } isLaunchable (state: PackageState, status: PackageMainStatus, interfaces: { [id: string]: InterfaceDef }): boolean { + console.log('is launchable', this.isLaunchable) + console.log('state', state) + console.log('status', status) + console.log('ret val', status === PackageMainStatus.Running && + ( + (hasTorUi(interfaces) && this.isTor()) || + (hasLanUi(interfaces) && !this.isTor()) + )) if (this.isConsulate || state !== PackageState.Installed) { return false }