mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
ensure lan address present before getting cert name (#2272)
This commit is contained in:
@@ -78,11 +78,7 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</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">
|
||||
|
||||
@@ -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'
|
||||
@@ -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
|
||||
@@ -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(_ => {
|
||||
|
||||
Reference in New Issue
Block a user