Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure lan address present before getting cert name #2272

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ <h2><ion-text color="danger">Recover</ion-text></h2>
<h2>
<ion-text color="success">Use Existing Drive</ion-text>
</h2>
<p>
Attach an existing StartOS data drive (
<b>not</b>
a backup)
</p>
<p>Attach an existing StartOS data drive (not a backup)</p>
</ion-label>
</ion-item>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>Setup Complete!</h1>
</ng-container>
<!-- not kiosk -->
<ng-template #notKiosk>
<ion-card>
<ion-card *ngIf="lanAddress">
<ion-row class="ion-align-items-center">
<ion-col responsiveCol sizeXs="12" class="ion-text-center">
<div style="margin-bottom: 4rem">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { DOCUMENT } from '@angular/common'
import {
Component,
ElementRef,
EventEmitter,
Inject,
NgZone,
Output,
ViewChild,
} from '@angular/core'
import { Component, ElementRef, Inject, NgZone, ViewChild } from '@angular/core'
import { DownloadHTMLService, ErrorToastService } from '@start9labs/shared'
import { ApiService } from 'src/app/services/api/api.service'
import { StateService } from 'src/app/services/state.service'
Expand All @@ -23,11 +15,9 @@ export class SuccessPage {
private canvas: ElementRef<HTMLCanvasElement> = {} as ElementRef<HTMLCanvasElement>
private ctx: CanvasRenderingContext2D = {} as CanvasRenderingContext2D

@Output() onDownload = new EventEmitter()

torAddress = ''
lanAddress = ''
cert = ''
torAddress?: string
lanAddress?: string
cert?: string

tileSize = 16
// a higher fade factor will make the characters fade quicker
Expand Down Expand Up @@ -73,15 +63,15 @@ export class SuccessPage {
const torAddress = this.document.getElementById('tor-addr')
const lanAddress = this.document.getElementById('lan-addr')

if (torAddress) torAddress.innerHTML = this.torAddress
if (lanAddress) lanAddress.innerHTML = this.lanAddress
if (torAddress) torAddress.innerHTML = this.torAddress!
if (lanAddress) lanAddress.innerHTML = this.lanAddress!

this.document
.getElementById('cert')
?.setAttribute(
'href',
'data:application/x-x509-ca-cert;base64,' +
encodeURIComponent(this.cert),
encodeURIComponent(this.cert!),
)
let html = this.document.getElementById('downloadable')?.innerHTML || ''
this.downloadHtml.download('StartOS-info.html', html).then(_ => {
Expand Down