last minute changes

This commit is contained in:
Drew Ansbacher
2022-02-27 17:58:11 -07:00
committed by Aiden McClelland
parent a6e00449f6
commit df16943502
8 changed files with 108 additions and 61 deletions

View File

@@ -2,22 +2,44 @@
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col class="ion-text-center"> <ion-col class="ion-text-center">
<div style="padding-bottom: 32px">
<div style="padding-bottom: 32px;"> <img src="assets/img/logo.png" style="max-width: 240px" />
<img src="assets/img/logo.png" style="max-width: 240px;" />
</div> </div>
<success [hidden]="!stateService.embassyLoaded" (onDownload)="download()"></success> <success
[hidden]="!stateService.embassyLoaded"
(onDownload)="download()"
></success>
<ion-card [hidden]="stateService.embassyLoaded" color="dark"> <ion-card [hidden]="stateService.embassyLoaded" color="dark">
<ion-card-header> <ion-card-header>
<ion-card-title style="font-size: 40px;">Initializing Embassy</ion-card-title> <ion-card-title style="font-size: 40px"
>Initializing Embassy</ion-card-title
>
<ion-card-subtitle>Progress: {{ progress }}%</ion-card-subtitle> <ion-card-subtitle>Progress: {{ progress }}%</ion-card-subtitle>
</ion-card-header> </ion-card-header>
<ion-card-content class="ion-margin"> <ion-card-content class="ion-margin">
<ion-progress-bar color="primary" style="max-width: 700px; margin: auto; padding-bottom: 20px; margin-bottom: 40px;" [value]="progress / 100"></ion-progress-bar> <ion-progress-bar
<p class="ion-text-start">After completion, you will be prompted to download a file from your Embassy. Save the file somewhere safe, it is the easiest way to recover your Embassy's addresses and SSL certificate in case you lose them.</p> color="primary"
style="
max-width: 700px;
margin: auto;
padding-bottom: 20px;
margin-bottom: 40px;
"
[value]="progress / 100"
></ion-progress-bar>
<p class="ion-text-start">
After completion, you will be prompted to download a file from
your Embassy. Save the file somewhere safe, it is the easiest way
to recover your Embassy's addresses and SSL certificate in case
you lose them.
</p>
<p class="ion-text-start" style="color: var(--ion-color-danger)">
<b>DO NOT:</b> Close or refresh the browser window during
intialization process.
</p>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ion-col> </ion-col>

View File

@@ -2,20 +2,30 @@
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col class="ion-text-center"> <ion-col class="ion-text-center">
<div style="padding-bottom: 32px">
<div style="padding-bottom: 32px;"> <img src="assets/img/logo.png" style="max-width: 240px" />
<img src="assets/img/logo.png" style="max-width: 240px;" />
</div> </div>
<ion-card color="dark"> <ion-card color="dark">
<ion-card-header> <ion-card-header>
<ion-card-title style="font-size: 40px;">Recovering</ion-card-title> <ion-card-title style="font-size: 40px">Recovering</ion-card-title>
<ion-card-subtitle>Progress: {{ (stateService.dataProgress * 100).toFixed(0) }}%</ion-card-subtitle> <ion-card-subtitle
>Progress: {{ (stateService.dataProgress * 100).toFixed(0)
}}%</ion-card-subtitle
>
</ion-card-header> </ion-card-header>
<ion-card-content class="ion-margin"> <ion-card-content class="ion-margin">
<ion-progress-bar color="primary" style="max-width: 700px; margin: auto; padding-bottom: 20px; margin-bottom: 40px;" [value]="stateService.dataProgress"></ion-progress-bar> <ion-progress-bar
<p class="ion-text-start">After completion, you will be prompted to download a file from your Embassy. Save the file somewhere safe, it is the easiest way to recover your Embassy's addresses and SSL certificate in case you lose them.</p> color="primary"
style="
max-width: 700px;
margin: auto;
padding-bottom: 20px;
margin-bottom: 40px;
"
[value]="stateService.dataProgress"
></ion-progress-bar>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ion-col> </ion-col>

View File

@@ -2,6 +2,7 @@ import { Component, Input } from '@angular/core'
import { ModalController, IonicSafeString } from '@ionic/angular' import { ModalController, IonicSafeString } from '@ionic/angular'
import { ApiService } from 'src/app/services/api/embassy-api.service' import { ApiService } from 'src/app/services/api/embassy-api.service'
import { getErrorMessage } from 'src/app/services/error-toast.service' import { getErrorMessage } from 'src/app/services/error-toast.service'
import { pauseFor } from '../../../../../shared/src/util/misc.util'
@Component({ @Component({
selector: 'markdown', selector: 'markdown',
@@ -25,6 +26,11 @@ export class MarkdownPage {
if (!this.content) { if (!this.content) {
this.content = await this.embassyApi.getStatic(this.contentUrl) this.content = await this.embassyApi.getStatic(this.contentUrl)
} }
} catch (e) {
this.loadingError = getErrorMessage(e)
} finally {
this.loading = false
await pauseFor(50)
const links = document.links const links = document.links
for (let i = 0, linksLength = links.length; i < linksLength; i++) { for (let i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) { if (links[i].hostname != window.location.hostname) {
@@ -33,10 +39,6 @@ export class MarkdownPage {
links[i].className += ' externalLink' links[i].className += ' externalLink'
} }
} }
} catch (e) {
this.loadingError = getErrorMessage(e)
} finally {
this.loading = false
} }
} }

View File

@@ -108,8 +108,11 @@ export class AppShowStatusComponent {
async stop(): Promise<void> { async stop(): Promise<void> {
const { id, title, version } = this.pkg.manifest const { id, title, version } = this.pkg.manifest
const hasDependents = !!Object.keys(
this.pkg.installed['current-dependents'],
).filter(depId => depId !== this.pkg.manifest.id).length
if (isEmptyObject(this.pkg.installed['current-dependents'])) { if (!hasDependents) {
const loader = await this.loadingCtrl.create({ const loader = await this.loadingCtrl.create({
message: `Stopping...`, message: `Stopping...`,
spinner: 'lines', spinner: 'lines',

View File

@@ -90,7 +90,7 @@ export class MarketplacesPage {
async presentAction(id: string) { async presentAction(id: string) {
// no need to view actions if is selected marketplace // no need to view actions if is selected marketplace
if (id === this.patch.getData().ui.marketplace['selected-id']) return if (id === this.patch.getData().ui.marketplace?.['selected-id']) return
const buttons: ActionSheetButton[] = [ const buttons: ActionSheetButton[] = [
{ {

View File

@@ -79,7 +79,9 @@
<!-- not loading --> <!-- not loading -->
<ng-container *ngIf="!loading && wifi.country"> <ng-container *ngIf="!loading && wifi.country">
<ion-item-divider>Saved Networks</ion-item-divider> <ion-item-divider *ngIf="!(wifi.ssids | empty)"
>Saved Networks</ion-item-divider
>
<ion-item <ion-item
button button
detail="false" detail="false"
@@ -126,38 +128,40 @@
</ion-item> </ion-item>
<ion-item-divider>Available Networks</ion-item-divider> <ion-item-divider>Available Networks</ion-item-divider>
<ion-item <ng-container *ngFor="let avWifi of wifi['available-wifi']">
button <ion-item
detail="false" button
*ngFor="let avWifi of wifi['available-wifi']" detail="false"
(click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)" (click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)"
> *ngIf="avWifi.ssid"
<ion-label>{{ avWifi.ssid }}</ion-label> >
<img <ion-label>{{ avWifi.ssid }}</ion-label>
*ngIf="avWifi.strength < 5" <img
slot="end" *ngIf="avWifi.strength < 5"
src="assets/img/icons/wifi-1.png" slot="end"
style="max-width: 32px" src="assets/img/icons/wifi-1.png"
/> style="max-width: 32px"
<img />
*ngIf="avWifi.strength >= 5 && avWifi.strength < 50" <img
slot="end" *ngIf="avWifi.strength >= 5 && avWifi.strength < 50"
src="assets/img/icons/wifi-1.png" slot="end"
style="max-width: 32px" src="assets/img/icons/wifi-1.png"
/> style="max-width: 32px"
<img />
*ngIf="avWifi.strength >= 50 && avWifi.strength < 90" <img
slot="end" *ngIf="avWifi.strength >= 50 && avWifi.strength < 90"
src="assets/img/icons/wifi-2.png" slot="end"
style="max-width: 32px" src="assets/img/icons/wifi-2.png"
/> style="max-width: 32px"
<img />
*ngIf="avWifi.strength >= 90" <img
slot="end" *ngIf="avWifi.strength >= 90"
src="assets/img/icons/wifi-3.png" slot="end"
style="max-width: 32px" src="assets/img/icons/wifi-3.png"
/> style="max-width: 32px"
</ion-item> />
</ion-item>
</ng-container>
<ion-item button detail="false" (click)="presentModalAdd()"> <ion-item button detail="false" (click)="presentModalAdd()">
<ion-icon slot="start" name="add" size="large"></ion-icon> <ion-icon slot="start" name="add" size="large"></ion-icon>
<ion-label>Join other network</ion-label> <ion-label>Join other network</ion-label>

View File

@@ -40,8 +40,16 @@ export class WifiPage {
) {} ) {}
async ngOnInit() { async ngOnInit() {
await this.getWifi()
}
async getWifi(timeout?: number): Promise<void> {
this.loading = true
try { try {
await this.getWifi() this.wifi = await this.api.getWifi({}, timeout)
if (!this.wifi.country) {
await this.presentAlertCountry()
}
} catch (e) { } catch (e) {
this.errToast.present(e) this.errToast.present(e)
} finally { } finally {
@@ -49,13 +57,6 @@ export class WifiPage {
} }
} }
async getWifi(timeout?: number): Promise<void> {
this.wifi = await this.api.getWifi({}, timeout)
if (!this.wifi.country) {
await this.presentAlertCountry()
}
}
async presentAlertCountry(): Promise<void> { async presentAlertCountry(): Promise<void> {
if (!this.config.isLan) { if (!this.config.isLan) {
const alert = await this.alertCtrl.create({ const alert = await this.alertCtrl.create({

View File

@@ -1017,6 +1017,11 @@ export module Mock {
strength: 99, strength: 99,
security: ['1', '2', '3'], security: ['1', '2', '3'],
}, },
{
ssid: '',
strength: 40,
security: [],
},
], ],
} }