* move enter-click directive to shared

* allow enter click to continue to login in kiosk mode; adjust styling

* cleanup

* add styling to ca wizard

* rebase new changes

* mobile fixes

* cleanup

* cleanup

* update styling

* cleanup import

* minor css changes

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
Lucy
2023-11-02 19:35:55 -04:00
committed by GitHub
parent 7ba22f1a09
commit 6a399a7250
9 changed files with 243 additions and 162 deletions

View File

@@ -10,11 +10,12 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { IonicModule } from '@ionic/angular'
import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor'
import {
MarkdownModule,
DarkThemeModule,
EnterModule,
LightThemeModule,
MarkdownModule,
ResponsiveColModule,
SharedPipesModule,
LightThemeModule,
} from '@start9labs/shared'
import { AppComponent } from './app.component'
@@ -25,7 +26,6 @@ import { MarketplaceModule } from './marketplace.module'
import { PreloaderModule } from './app/preloader/preloader.module'
import { FooterModule } from './app/footer/footer.module'
import { MenuModule } from './app/menu/menu.module'
import { EnterModule } from './app/enter/enter.module'
import { APP_PROVIDERS } from './app.providers'
import { PatchDbModule } from './services/patch-db/patch-db.module'
import { ToastContainerModule } from './components/toast-container/toast-container.module'

View File

@@ -1,21 +0,0 @@
import { Directive, HostListener, Inject } from '@angular/core'
import { DOCUMENT } from '@angular/common'
import { debounce } from '@start9labs/shared'
@Directive({
selector: '[appEnter]',
})
export class EnterDirective {
constructor(@Inject(DOCUMENT) private readonly document: Document) {}
@HostListener('document:keydown.enter')
@debounce()
handleKeyboardEvent() {
const elems = this.document.querySelectorAll('.enter-click')
const elem = elems[elems.length - 1] as HTMLButtonElement
if (elem && !elem.classList.contains('no-click') && !elem.disabled) {
elem.click()
}
}
}

View File

@@ -1,9 +0,0 @@
import { NgModule } from '@angular/core'
import { EnterDirective } from './enter.directive'
@NgModule({
declarations: [EnterDirective],
exports: [EnterDirective],
})
export class EnterModule {}

View File

@@ -1,83 +1,99 @@
<ion-content>
<div class="center-container">
<ng-container *ngIf="!caTrusted; else trusted">
<ion-icon name="lock-closed-outline" class="wiz-icon"></ion-icon>
<h1 class="title">Trust Your Root CA</h1>
<p class="subtitle">
Download and trust your server's Root Certificate Authority to establish a
secure (
<b>HTTPS</b>
) connection. You will need to repeat this on every device you use to
connect to your server.
</p>
<ol>
<li>
<b>Download your server's Root CA</b>
. Your server uses its Root CA to generate SSL/TLS certificates for
itself and installed services. These certificates are then used to
encrypt network traffic with your client devices.
<br />
<ion-button strong size="small" (click)="download()">
Download
<ion-icon slot="end" name="download-outline"></ion-icon>
</ion-button>
</li>
<li>
<b>Trust your server's Root CA</b>
. Follow instructions for your OS. By trusting your server's Root CA,
your device can verify the authenticity of encrypted communications with
your server.
<br />
<ion-button
strong
size="small"
href="https://docs.start9.com/0.3.5.x/user-manual/getting-started/trust-ca/#trust-root-ca"
target="_blank"
noreferrer
>
View Instructions
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
</li>
<li>
<b>Test</b>
. If refreshing the page does not work, you may need to quit the browser
and re-open.
<i>Tip: before quitting, bookmark this page or copy the URL.</i>
<br />
<ion-button strong size="small" (click)="refresh()">
Refresh
<ion-icon slot="end" name="refresh"></ion-icon>
</ion-button>
</li>
</ol>
<ion-button
style="--padding-start: 0"
fill="clear"
(click)="launchHttps()"
[disabled]="caTrusted"
>
Skip
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
<ion-card id="untrusted" class="text-center">
<ion-icon name="lock-closed-outline" class="wiz-icon"></ion-icon>
<h1>Trust Your Root CA</h1>
<p>
Download and trust your server's Root Certificate Authority to establish
a secure (HTTPS) connection. You will need to repeat this on every
device you use to connect to your server.
</p>
<ol>
<li>
<b>Download your server's Root CA</b>
- Your server uses its Root CA to generate SSL/TLS certificates for
itself and installed services. These certificates are then used to
encrypt network traffic with your client devices.
<br />
<ion-button
strong
size="small"
shape="round"
color="tertiary"
(click)="download()"
>
Download
<ion-icon slot="end" name="download-outline"></ion-icon>
</ion-button>
</li>
<li>
<b>Trust your server's Root CA</b>
- Follow instructions for your OS. By trusting your server's Root CA,
your device can verify the authenticity of encrypted communications
with your server.
<br />
<ion-button
strong
size="small"
shape="round"
color="primary"
href="https://docs.start9.com/0.3.5.x/user-manual/getting-started/trust-ca/#trust-root-ca"
target="_blank"
noreferrer
>
View Instructions
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
</li>
<li>
<b>Test</b>
- If refreshing the page does not work, you may need to quit the
browser and re-open.
<i>Tip: before quitting, bookmark this page or copy the URL.</i>
<br />
<ion-button
strong
size="small"
shape="round"
class="refresh"
(click)="refresh()"
>
Refresh
<ion-icon slot="end" name="refresh"></ion-icon>
</ion-button>
</li>
</ol>
<ion-button
style="--padding-start: 0"
fill="clear"
(click)="launchHttps()"
[disabled]="caTrusted"
>
Skip
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
</ion-card>
</ng-container>
<ng-template #trusted>
<ion-icon
name="shield-checkmark-outline"
class="wiz-icon"
color="success"
></ion-icon>
<h1 class="title">Root CA Trusted!</h1>
<p class="subtitle">
You have successfully trusted your server's Root CA and may now log in
securely.
</p>
<ion-button strong (click)="launchHttps()">
Go to login
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
<ion-card id="trusted" class="text-center">
<ion-icon
name="shield-checkmark-outline"
class="wiz-icon"
color="success"
></ion-icon>
<h1>Root CA Trusted!</h1>
<p>
You have successfully trusted your server's Root CA and may now log in
securely.
</p>
<ion-button strong (click)="launchHttps()" color="tertiary" shape="round">
Go to login
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
</ion-card>
</ng-template>
</ion-content>
</div>
<a
id="install-cert"

View File

@@ -1,41 +1,76 @@
ion-content {
--padding-top: 2.2rem;
--padding-bottom: 2.2rem;
--padding-start: 2.2rem;
--padding-end: 2.2rem;
#trusted {
max-width: 40%;
}
.title {
font-size: 28px;
font-weight: 600;
#untrusted {
max-width: 50%;
}
.subtitle {
font-size: 21px;
line-height: 26px;
margin-bottom: 30px;
margin-top: 0;
.center-container {
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
ion-card {
color: var(--ion-color-dark);
background: #414141;
box-shadow: 0 4px 4px rgba(17, 17, 17, 0.144);
border-radius: 35px;
padding: 1.5rem;
width: 100%;
h1 {
font-weight: bold;
font-size: 1.5rem;
padding-bottom: 1.5rem;
}
p {
font-size: 21px;
line-height: 25px;
margin-bottom: 30px;
margin-top: 0;
}
}
.text-center {
text-align: center;
}
ol {
font-size: 17px;
line-height: 25px;
text-align: left;
li {
padding-bottom: 24px;
}
ion-button {
margin-top: 8px;
margin-top: 10px;
}
}
a {
cursor: pointer;
color: aquamarine;
text-decoration: underline;
.refresh {
--background: var(--ion-color-success-shade);
}
.wiz-icon {
font-size: 64px;
}
@media (max-width: 700px) {
#trusted, #untrusted {
max-width: 100%;
}
}
@media (min-width: 701px) and (max-width: 1200px) {
#trusted, #untrusted {
max-width: 75%;
}
}