0.3.0 refactor

ui: adds overlay layer to patch-db-client

ui: getting towards mocks

ui: cleans up factory init

ui: nice type hack

ui: live api for patch

ui: api service source + http

starts up

ui: api source + http

ui: rework patchdb config, pass stashTimeout into patchDbModel

wires in temp patching into api service

ui: example of wiring patchdbmodel into page

begin integration

remove unnecessary method

linting

first data rendering

rework app initialization

http source working for ssh delete call

temp patches working

entire Embassy tab complete

not in kansas anymore

ripping, saving progress

progress for API request response types and endoint defs

Update data-model.ts

shambles, but in a good way

progress

big progress

progress

installed list working

big progress

progress

progress

begin marketplace redesign

Update api-types.ts

Update api-types.ts

marketplace improvements

cosmetic

dependencies and recommendations

begin nym auth approach

install wizard

restore flow and donations
This commit is contained in:
Aaron Greenspan
2021-02-16 13:45:09 -07:00
committed by Aiden McClelland
parent 46f32cb90b
commit 8d01ebe8b2
238 changed files with 25509 additions and 14852 deletions

View File

@@ -10,26 +10,33 @@
<ion-content class="ion-padding-top">
<ion-item-group>
<ion-item lines="none">
<!-- about -->
<ion-item>
<ion-label class="ion-text-wrap">
You can connect to your Embassy over your Local Area Network (LAN). This can be useful for achieving a faster experience, as well as a fallback in case the Tor network is experiencing issues.
</ion-label>
</ion-item>
<ion-item *ngIf="lanDisabled">
<ion-label class="ion-text-wrap">
<ion-text color="warning" [innerHtml]="lanDisabledExplanation[lanDisabled]"></ion-text>
<p style="padding-bottom: 6px;">About</p>
<h2>You can connect to your Embassy over your Local Area Network (LAN). This can be useful for achieving a faster experience, as well as a fallback in case the Tor network is experiencing issues.</h2>
</ion-label>
</ion-item>
<ion-item>
<ion-button slot="start" fill="clear" color="primary" (click)="viewInstructions()">View Instructions</ion-button>
<ion-button slot="start" fill="clear" color="primary" [href]="docsUrl" target="_blank">View Instructions</ion-button>
</ion-item>
<ng-container *ngIf="lanDisabled">
<ion-item-divider></ion-item-divider>
<ion-item>
<ion-label class="ion-text-wrap">
<p style="padding-bottom: 4px;">Setup</p>
<ion-text color="warning" [innerHtml]="lanDisabledExplanation[lanDisabled]"></ion-text>
</ion-label>
</ion-item>
</ng-container>
<!-- Refresh Network -->
<ion-item-divider></ion-item-divider>
<ion-item>
<ion-label class="ion-text-wrap">
If you are having issues connecting to your Embassy or services over LAN, you can try refreshing the network by clicking the button below.
<p style="padding-bottom: 6px;">Troubleshooting</p>
<h2>If you are having issues connecting to your Embassy over LAN, try refreshing the network by clicking the button below.</h2>
</ion-label>
</ion-item>
<ion-item>
@@ -39,10 +46,10 @@
</ion-button>
</ion-item>
<ion-item-divider></ion-item-divider>
<!-- Certificate and Lan Address -->
<ng-container *ngIf="!lanDisabled">
<ion-item-divider class="borderless"></ion-item-divider>
<ion-item-divider>Certificate and Address</ion-item-divider>
<!-- Certificate -->
<ion-item>
<ion-label class="ion-text-wrap">
<h2>Root Certificate Authority</h2>
@@ -52,20 +59,21 @@
<ion-icon slot="icon-only" name="download-outline"></ion-icon>
</ion-button>
</ion-item>
<!-- URL -->
<ion-item>
<ion-label class="ion-text-wrap">
<h2>LAN Address</h2>
<p>{{ lanAddress }}</p>
<p>https://{{ patch.watch$('server-info', 'lan-address') | ngrxPush }}</p>
</ion-label>
<ion-button slot="end" fill="clear" (click)="copyLAN()">
<ion-icon slot="icon-only" name="copy-outline"></ion-icon>
</ion-button>
</ion-item>
<ion-item-divider></ion-item-divider>
</ng-container>
</ion-item-group>
<!-- hidden element for downloading cert -->
<a id="install-cert" href="/api/v0/certificate" download="Embassy Local CA.crt"></a>
<a id="install-cert" href="/public/local.crt" download="Embassy Local CA.crt"></a>
</ion-content>

View File

@@ -1,10 +1,10 @@
import { Component } from '@angular/core'
import { isPlatform, ToastController } from '@ionic/angular'
import { ServerModel } from 'src/app/models/server-model'
import { copyToClipboard } from 'src/app/util/web.util'
import { ConfigService } from 'src/app/services/config.service'
import { LoaderService } from 'src/app/services/loader.service'
import { ApiService } from 'src/app/services/api/api.service'
import { PatchDbModel } from 'src/app/models/patch-db/patch-db-model'
@Component({
selector: 'lan',
@@ -12,40 +12,28 @@ import { ApiService } from 'src/app/services/api/api.service'
styleUrls: ['./lan.page.scss'],
})
export class LANPage {
torDocs = 'docs.privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion/user-manual/general/lan-setup'
lanDocs = 'docs.start9labs.com/user-manual/general/lan-setup'
lanAddress: string
fullDocumentationLink: string
lanDisabled: LanSetupIssue
readonly lanDisabledExplanation: { [k in LanSetupIssue]: string } = {
NotDesktop: `We have detected you are on a mobile device. To setup LAN on a mobile device, use the Start9 Setup App.`,
NotTor: `We have detected you are not using a Tor connection. For security reasons, you must setup LAN over a Tor connection. Please navigate to your Embassy Tor Address and try again.`,
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'
constructor (
private readonly serverModel: ServerModel,
private readonly toastCtrl: ToastController,
private readonly config: ConfigService,
private readonly loader: LoaderService,
private readonly apiService: ApiService,
public readonly patch: PatchDbModel,
) { }
ngOnInit () {
if (isPlatform('ios') || isPlatform('android')) {
this.lanDisabled = 'NotDesktop'
this.lanDisabled = LanSetupIssue.NOT_DESKTOP
} else if (!this.config.isTor()) {
this.lanDisabled = 'NotTor'
this.lanDisabled = LanSetupIssue.NOT_TOR
}
if (this.config.isTor()) {
this.fullDocumentationLink = `http://${this.torDocs}`
} else {
this.fullDocumentationLink = `https://${this.lanDocs}`
}
const server = this.serverModel.peek()
this.lanAddress = `https://${server.serverId}.local`
}
async refreshLAN (): Promise<void> {
@@ -54,20 +42,12 @@ export class LANPage {
spinner: 'lines',
cssClass: 'loader',
}).displayDuringAsync( async () => {
await this.apiService.refreshLAN()
await this.apiService.refreshLan({ })
}).catch(e => {
console.error(e)
})
}
viewInstructions (): void {
if (this.config.isConsulate) {
this.copyInstructions()
} else {
window.open(this.fullDocumentationLink, '_blank')
}
}
async copyLAN (): Promise <void> {
const message = await copyToClipboard(this.lanAddress).then(success => success ? 'copied to clipboard!' : 'failed to copy')
@@ -80,23 +60,12 @@ export class LANPage {
await toast.present()
}
async copyInstructions (): Promise < void > {
const message = await copyToClipboard(this.fullDocumentationLink).then(
success => success ? 'copied link to clipboard!' : 'failed to copy',
)
const toast = await this.toastCtrl.create({
header: message,
position: 'bottom',
duration: 1000,
cssClass: 'notification-toast',
})
await toast.present()
}
installCert (): void {
document.getElementById('install-cert').click()
}
}
type LanSetupIssue = 'NotTor' | 'NotDesktop'
enum LanSetupIssue {
NOT_TOR = 'NotTor',
NOT_DESKTOP = 'NotDesktop',
}