minor cosmetics

This commit is contained in:
Matt Hill
2021-08-17 21:44:16 -06:00
committed by Aiden McClelland
parent 62b523ebde
commit 3ee06a556e
7 changed files with 21 additions and 62 deletions

View File

@@ -1 +1 @@
<qr-code [value]="text"></qr-code>
<qr-code [value]="text" size="400"></qr-code>

View File

@@ -6,7 +6,8 @@
<ion-title>Logs</ion-title>
<ion-buttons slot="end">
<ion-button (click)="getLogs()">
<ion-icon slot="icon-only" name="refresh-outline"></ion-icon>
<ion-icon slot="start" name="refresh-outline"></ion-icon>
Refresh
</ion-button>
</ion-buttons>
</ion-toolbar>

View File

@@ -50,7 +50,7 @@
<ion-label>
<ion-skeleton-text animated style="width: 150px; height: 18px; margin-bottom: 8px;"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 400px;"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 400px;"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 100px;"></ion-skeleton-text>
</ion-label>
</ion-item>
</ion-col>

View File

@@ -14,9 +14,13 @@
<ion-item class="ion-padding-bottom">
<ion-label>
<h2>
Connecting to your Embassy over the Local Area Network (LAN) is great for achieving a faster experience, as well as a fallback in case Tor is experiencing issues.
<a [href]="docsUrl" target="_blank">View instructions</a>
Connecting to your Embassy over LAN is fast and a great fallback in case the Tor network is experiencing issues.
<a href="https://docs.start9.com/user-manual/general/lan-setup" target="_blank">View instructions</a>
</h2>
<ng-container *ngIf="lanDisabled">
<br />
<ion-text color="warning" [innerHtml]="lanDisabled"></ion-text>
</ng-container>
</ion-label>
</ion-item>
@@ -24,20 +28,10 @@
<ion-icon slot="start" name="download-outline" size="large"></ion-icon>
<ion-label>
<h1>Download Root CA</h1>
<p>Download and trust your Embassy's Root Certificate Authority to achieve a secure connection on the LAN.</p>
<p>Download and trust your Embassy's Root Certificate Authority to establish a secure connection on the LAN.</p>
</ion-label>
</ion-item>
<ng-container *ngIf="lanDisabled">
<ion-item-divider></ion-item-divider>
<ion-item>
<ion-label>
<p class="ion-padding-bottom">Setup</p>
<ion-text color="warning" [innerHtml]="lanDisabledExplanation[lanDisabled]"></ion-text>
</ion-label>
</ion-item>
</ng-container>
<!-- Refresh Network -->
<ion-item button (click)="refreshLAN()" detail="false">
<ion-icon slot="start" name="refresh-outline" size="large"></ion-icon>

View File

@@ -1,10 +1,7 @@
import { Component } from '@angular/core'
import { isPlatform, LoadingController, ToastController } from '@ionic/angular'
import { copyToClipboard } from 'src/app/util/web.util'
import { LoadingController, ToastController } from '@ionic/angular'
import { ConfigService } from 'src/app/services/config.service'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
import { Subscription } from 'rxjs'
import { ErrorToastService } from 'src/app/services/error-toast.service'
@Component({
@@ -14,13 +11,7 @@ import { ErrorToastService } from 'src/app/services/error-toast.service'
})
export class LANPage {
lanAddress: string
lanDisabled: LanSetupIssue
readonly lanDisabledExplanation: { [k in LanSetupIssue]: string } = {
NotDesktop: `You are using a mobile device. To setup LAN on a mobile device, please use the Start9 Setup App.`,
NotTor: `For security reasons, you must setup LAN over a Tor connection. Please navigate to your Embassy Tor Address and try again.`,
}
readonly docsUrl = 'https://docs.start9.com/user-manual/general/lan-setup'
subs: Subscription[] = []
lanDisabled: string
constructor (
private readonly toastCtrl: ToastController,
@@ -28,25 +19,16 @@ export class LANPage {
private readonly loadingCtrl: LoadingController,
private readonly errToast: ErrorToastService,
private readonly embassyApi: ApiService,
private readonly patch: PatchDbService,
) { }
ngOnInit () {
if (isPlatform('ios') || isPlatform('android')) {
this.lanDisabled = LanSetupIssue.NOT_DESKTOP
} else if (!this.config.isTor()) {
this.lanDisabled = LanSetupIssue.NOT_TOR
if (!this.config.isTor()) {
this.lanDisabled = 'For security reasons, you must setup LAN over a Tor connection. Please navigate to your Embassy Tor Address and try again.'
}
this.subs = [
this.patch.watch$('server-info', 'lan-address')
.subscribe(addr => {
this.lanAddress = `https://${addr}`
}),
]
}
ngOnDestroy () {
this.subs.forEach(sub => sub.unsubscribe())
installCert (): void {
document.getElementById('install-cert').click()
}
async refreshLAN (): Promise<void> {
@@ -67,21 +49,6 @@ export class LANPage {
}
}
async copyLAN (): Promise <void> {
const message = await copyToClipboard(this.lanAddress).then(success => success ? 'copied to clipboard!' : 'failed to copy')
const toast = await this.toastCtrl.create({
header: message,
position: 'bottom',
duration: 1000,
})
await toast.present()
}
installCert (): void {
document.getElementById('install-cert').click()
}
private async presentToastSuccess (): Promise<void> {
const toast = await this.toastCtrl.create({
header: 'Success',
@@ -103,8 +70,3 @@ export class LANPage {
await toast.present()
}
}
enum LanSetupIssue {
NOT_TOR = 'NotTor',
NOT_DESKTOP = 'NotDesktop',
}

View File

@@ -6,7 +6,8 @@
<ion-title>Logs</ion-title>
<ion-buttons slot="end">
<ion-button (click)="getLogs()">
<ion-icon slot="icon-only" name="refresh-outline"></ion-icon>
<ion-icon slot="start" name="refresh-outline"></ion-icon>
Refresh
</ion-button>
</ion-buttons>
</ion-toolbar>

View File

@@ -14,7 +14,8 @@
<ion-item>
<ion-label>
<h2>
Embassy will automatically connect to saved WiFi networks when they are available, allowing you to remove the Ethernet cable.
Adding WiFi credentials to your Embassy allows you to remove the Ethernet cable and move the device anywhere you want. Embassy will automatically connect to available networks.
<a href="https://docs.start9.com/user-manual/general/wifi.html" target="_blank">View instructions</a>
</h2>
</ion-label>
</ion-item>