oggui/ogWebconsole/src/app/components/login/login.component.html

29 lines
1.5 KiB
HTML

<div>
<form class="login" (ngSubmit)="onLogin()" #loginForm="ngForm" (keydown.enter)="onLogin()">
<img src="assets/images/logo.png" alt="Opengnsys" class="login-logo" [class.rotating]="isLoading">
<h2 i18n="@@headerOpengnsys">Opengnsys</h2>
<mat-form-field>
<mat-label i18n="@@loginlabelUsername">Introduce tu usuario</mat-label>
<input matInput [(ngModel)]="loginObj.username" name="username" required #usernameInput="ngModel"
[ngClass]="{'invalid': !usernameInput.valid && usernameInput.touched}" />
</mat-form-field>
<mat-form-field>
<mat-label i18n="@@loginlabelPassword">Introduce tu contraseña</mat-label>
<input matInput (keydown.enter)="$event.preventDefault()" [type]="hide() ? 'password' : 'text'" required
[(ngModel)]="loginObj.password" name="password" />
<button mat-icon-button matSuffix type="button" (click)="clickEvent($event)" [attr.aria-label]="'Ocultar contraseña'">
<mat-icon>{{hide() ? 'visibility_off' : 'visibility'}}</mat-icon>
</button>
</mat-form-field>
<div class="button-row">
<button mat-flat-button color="primary" type="submit" [disabled]="!loginObj.username || !loginObj.password"
i18n="@@buttonLogin">Iniciar sesión</button>
</div>
</form>
</div>
<!-- BORRAR DESPUES DE LA DEMO -->
<button mat-flat-button (click)="redirectToUrl1()">Español</button>
<!-- Botón para redirigir a http://localhost:4200/auth/login -->
<button mat-flat-button (click)="redirectToUrl2()">Inglés</button>