ui: fix lan launchable

This commit is contained in:
Aaron Greenspan
2021-02-04 17:02:59 -07:00
committed by Aiden McClelland
parent c0e08df221
commit e1a6a3d9ed
3 changed files with 16 additions and 3 deletions

View File

@@ -26,7 +26,7 @@
<ion-card class="installed-card" [class.installed-card-on]="vars.status === 'RUNNING'" style="position:relative" [routerLink]="['/services', 'installed', app.id]">
<div class="launch-container" *ngIf="vars.ui && !isConsulate">
<div class="launch-button-triangle" (click)="launchUiTab(vars.tor, app.id, $event)" [class.disabled]="vars.status !== AppStatus.RUNNING || !isTor">
<div class="launch-button-triangle" (click)="launchUiTab(vars.tor, app.id, $event)" [class.disabled]="vars.status !== AppStatus.RUNNING">
<ion-icon class="launch-button-triangle-icon" name="globe-outline"></ion-icon>
</div>
</div>

View File

@@ -83,7 +83,7 @@
<ion-icon color="medium" name="information-circle-outline">
</ion-icon>
</ion-button>
<ion-button [disabled]="vars.status !== 'RUNNING' || !isTor" class="launch-button" [class.launch-button-off]="vars.status !== 'RUNNING' || !isTor" (click)="launchUiTab()">
<ion-button [disabled]="vars.status !== 'RUNNING'" class="launch-button" [class.launch-button-off]="vars.status !== 'RUNNING'" (click)="launchUiTab()">
<ion-icon style="position: absolute; z-index: 1; left: 0;" name="globe-outline"></ion-icon>
<ion-text>LAUNCH</ion-text>
</ion-button>
@@ -108,7 +108,7 @@
<h2>LAN Address</h2>
<p>{{ lanAddress }}</p>
</ion-label>
<ion-button slot="end" fill="clear" (click)="copyTor()">
<ion-button slot="end" fill="clear" (click)="copyLan()">
<ion-icon slot="icon-only" name="copy-outline" color="primary"></ion-icon>
</ion-button>
</ion-item>

View File

@@ -182,6 +182,19 @@ export class AppInstalledShowPage extends Cleanup {
await toast.present()
}
async copyLan () {
let message = ''
await copyToClipboard(this.lanAddress).then(success => { message = success ? 'copied to clipboard!' : 'failed to copy' })
const toast = await this.toastCtrl.create({
header: message,
position: 'bottom',
duration: 1000,
cssClass: 'notification-toast',
})
await toast.present()
}
async stop (): Promise<void> {
const app = peekProperties(this.app)