blob: 2410c6dd721068c829f9f4aede0820dde356b276 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="main-content d-flex justify-content-center align-items-center">
<div class="login-section">
<div class="login-section-bg">
<form #loginForm="ngForm" (ngSubmit)="login()">
<app-error
[error]="error"
authError="Invalid username/password">
</app-error>
<div class="form-group">
<input #apiEndpointInp="ngModel" [(ngModel)]="apiEndpoint"
[disabled]="loading"
autofocus
class="form-control"
id="apiEndpoint"
name="apiEndpoint"
placeholder="Server Address"
required>
<div *ngIf="!loading && !(apiEndpointInp.valid || apiEndpointInp.pristine)" class="alert alert-danger">
Value required.
</div>
</div>
<div class="form-group">
<input #emailInp="ngModel" [(ngModel)]="email"
[disabled]="loading"
autofocus
class="form-control"
id="email"
name="email"
placeholder="Email"
required
type="email">
<div *ngIf="!loading && !(emailInp.valid || emailInp.pristine)" class="alert alert-danger">
Value required.
</div>
</div>
<div class="form-group">
<input #passwordInp="ngModel" [(ngModel)]="password"
[disabled]="loading"
class="form-control"
id="password"
name="password"
placeholder="Password"
required
type="password">
<div *ngIf="!loading && !(passwordInp.valid || passwordInp.pristine)" class="alert alert-danger">
Value required.
</div>
</div>
<button [disabled]="loginForm.invalid || loading" class="btn btn-lg btn-primary btn-block" type="submit">
<ng-container *ngIf="!loading">
Sign in
</ng-container>
<ng-container *ngIf="loading">
<fa-icon icon="spinner" pulse="true"></fa-icon>
Signing in...
</ng-container>
</button>
</form>
</div>
</div>
</div>