From 66c08c730b56c4a26ff5c8691c1d4e3ffe8c55d2 Mon Sep 17 00:00:00 2001 From: Aaron Greenspan Date: Mon, 11 Jan 2021 11:31:47 -0700 Subject: [PATCH] adds ui tag and launch button in AIS --- ui/src/app/models/app-types.ts | 1 + .../app-installed-show/app-installed-show.page.html | 11 ++++++++++- .../app-installed-show/app-installed-show.page.ts | 7 ++++++- ui/src/app/services/api/mock-app-fixures.ts | 4 ++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ui/src/app/models/app-types.ts b/ui/src/app/models/app-types.ts index 7042d34d3..a73503af5 100644 --- a/ui/src/app/models/app-types.ts +++ b/ui/src/app/models/app-types.ts @@ -34,6 +34,7 @@ export interface AppAvailableVersionSpecificInfo { export interface AppInstalledPreview extends BaseApp { torAddress: string versionInstalled: string + ui: boolean } export interface AppInstalledFull extends AppInstalledPreview { diff --git a/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.html b/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.html index 65b745bf8..2e1a414c9 100644 --- a/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.html +++ b/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.html @@ -19,7 +19,8 @@ lastBackup: app.lastBackup | async, hasFetchedFull: app.hasFetchedFull | async, iconURL: app.iconURL | async, - title: app.title | async + title: app.title | async, + ui: app.ui | async } as vars" class="ion-padding-bottom"> @@ -75,6 +76,14 @@ + + + + + Launch + + + diff --git a/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.ts b/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.ts index 1d906bc5a..d44d61c49 100644 --- a/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.ts +++ b/ui/src/app/pages/apps-routes/app-installed-show/app-installed-show.page.ts @@ -93,6 +93,11 @@ export class AppInstalledShowPage extends Cleanup { } } + async launchUiTab () { + const uiAddress = this.app.torAddress.getValue() + return window.open(uiAddress, '_blank') + } + async checkForUpdates () { const app = peekProperties(this.app) @@ -146,7 +151,7 @@ export class AppInstalledShowPage extends Cleanup { async copyTor () { const app = peekProperties(this.app) let message = '' - await copyToClipboard(app.torAddress || '').then(success => { message = success ? 'copied to clipboard!' : 'failed to copy'}) + await copyToClipboard(app.torAddress || '').then(success => { message = success ? 'copied to clipboard!' : 'failed to copy' }) const toast = await this.toastCtrl.create({ header: message, diff --git a/ui/src/app/services/api/mock-app-fixures.ts b/ui/src/app/services/api/mock-app-fixures.ts index a65644e91..b6d3c5858 100644 --- a/ui/src/app/services/api/mock-app-fixures.ts +++ b/ui/src/app/services/api/mock-app-fixures.ts @@ -20,6 +20,7 @@ export function toInstalledPreview (f: AppInstalledFull): AppInstalledPreview { title: f.title, iconURL: f.iconURL, torAddress: f.torAddress, + ui: f.ui, } } @@ -51,6 +52,7 @@ export const bitcoinI: AppInstalledFull = { lastBackup: new Date().toISOString(), configuredRequirements: [], hasFetchedFull: true, + ui: false, } export const lightningI: AppInstalledFull = { @@ -73,6 +75,7 @@ export const lightningI: AppInstalledFull = { }), ], hasFetchedFull: true, + ui: true, } export const cupsI: AppInstalledFull = { @@ -85,6 +88,7 @@ export const cupsI: AppInstalledFull = { instructions: 'some instructions', lastBackup: new Date().toISOString(), + ui: true, configuredRequirements: [ toServiceRequirement(lightningI, {