adds ui tag and launch button in AIS

This commit is contained in:
Aaron Greenspan
2021-01-11 11:31:47 -07:00
committed by Aiden McClelland
parent 5b248013e5
commit 66c08c730b
4 changed files with 21 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ export interface AppAvailableVersionSpecificInfo {
export interface AppInstalledPreview extends BaseApp { export interface AppInstalledPreview extends BaseApp {
torAddress: string torAddress: string
versionInstalled: string versionInstalled: string
ui: boolean
} }
export interface AppInstalledFull extends AppInstalledPreview { export interface AppInstalledFull extends AppInstalledPreview {

View File

@@ -19,7 +19,8 @@
lastBackup: app.lastBackup | async, lastBackup: app.lastBackup | async,
hasFetchedFull: app.hasFetchedFull | async, hasFetchedFull: app.hasFetchedFull | async,
iconURL: app.iconURL | async, iconURL: app.iconURL | async,
title: app.title | async title: app.title | async,
ui: app.ui | async
} as vars" class="ion-padding-bottom"> } as vars" class="ion-padding-bottom">
<ion-spinner *ngIf="$loading$ | async" class="center" name="lines" color="warning"></ion-spinner> <ion-spinner *ngIf="$loading$ | async" class="center" name="lines" color="warning"></ion-spinner>
@@ -75,6 +76,14 @@
</ion-button> </ion-button>
</ion-label> </ion-label>
</ion-item> </ion-item>
<!-- TODO get rid of || true below lol. -->
<ion-item class="no-cushion-item" *ngIf="vars.ui || true" lines="none">
<ion-label style="margin: 10px 0px; display: flex; justify-content: space-between; align-items: center;" class="ion-text-wrap">
<ion-button [fill]="vars.status !== 'RUNNING' ? 'outline' : 'solid'" [disabled]="vars.status !== 'RUNNING'"style="width: 100%; padding: 0px 10px" (click)="launchUiTab()">
Launch
</ion-button>
</ion-label>
</ion-item>
</div> </div>
<ng-container *ngIf="app && app.id && vars.status !== 'INSTALLING'"> <ng-container *ngIf="app && app.id && vars.status !== 'INSTALLING'">

View File

@@ -93,6 +93,11 @@ export class AppInstalledShowPage extends Cleanup {
} }
} }
async launchUiTab () {
const uiAddress = this.app.torAddress.getValue()
return window.open(uiAddress, '_blank')
}
async checkForUpdates () { async checkForUpdates () {
const app = peekProperties(this.app) const app = peekProperties(this.app)
@@ -146,7 +151,7 @@ export class AppInstalledShowPage extends Cleanup {
async copyTor () { async copyTor () {
const app = peekProperties(this.app) const app = peekProperties(this.app)
let message = '' 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({ const toast = await this.toastCtrl.create({
header: message, header: message,

View File

@@ -20,6 +20,7 @@ export function toInstalledPreview (f: AppInstalledFull): AppInstalledPreview {
title: f.title, title: f.title,
iconURL: f.iconURL, iconURL: f.iconURL,
torAddress: f.torAddress, torAddress: f.torAddress,
ui: f.ui,
} }
} }
@@ -51,6 +52,7 @@ export const bitcoinI: AppInstalledFull = {
lastBackup: new Date().toISOString(), lastBackup: new Date().toISOString(),
configuredRequirements: [], configuredRequirements: [],
hasFetchedFull: true, hasFetchedFull: true,
ui: false,
} }
export const lightningI: AppInstalledFull = { export const lightningI: AppInstalledFull = {
@@ -73,6 +75,7 @@ export const lightningI: AppInstalledFull = {
}), }),
], ],
hasFetchedFull: true, hasFetchedFull: true,
ui: true,
} }
export const cupsI: AppInstalledFull = { export const cupsI: AppInstalledFull = {
@@ -85,6 +88,7 @@ export const cupsI: AppInstalledFull = {
instructions: 'some instructions', instructions: 'some instructions',
lastBackup: new Date().toISOString(), lastBackup: new Date().toISOString(),
ui: true,
configuredRequirements: [ configuredRequirements: [
toServiceRequirement(lightningI, toServiceRequirement(lightningI,
{ {