Update the login view #55

Merged
jank merged 2 commits from fix/update-login-screen into main 2025-01-08 09:22:59 +00:00
3 changed files with 27 additions and 24 deletions

View file

@ -1,10 +1,10 @@
import { Routes } from '@angular/router'; import { Routes } from "@angular/router";
import { LoginViewComponent } from './components/login-view/login-view.component'; import { LoginViewComponent } from "./components/login-view/login-view.component";
import { MitarbeiterverwaltungViewComponent } from './components/mitarbeiterverwaltung-view/mitarbeiterverwaltung-view.component'; import { MitarbeiterverwaltungViewComponent } from "./components/mitarbeiterverwaltung-view/mitarbeiterverwaltung-view.component";
import { EmployeeDetailComponent } from './components/employee-detail/employee-detail.component'; import { EmployeeDetailComponent } from "./components/employee-detail/employee-detail.component";
import { QualifikatonBearbeitenViewComponent } from './components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component'; import { QualifikatonBearbeitenViewComponent } from "./components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component";
import { KeycloakAuthGuard } from 'keycloak-angular'; import { KeycloakAuthGuard } from "keycloak-angular";
import { AuthGuard } from './service/auth.service'; import { AuthGuard } from "./service/auth.service";
export const routes: Routes = [ export const routes: Routes = [
{ {
@ -26,6 +26,6 @@ export const routes: Routes = [
}, },
{ {
path: "**", path: "**",
redirectTo: '', redirectTo: "",
} },
]; ];

View file

@ -1,15 +1,8 @@
<div class="container" style="width: 100%">
<div class="container" style="width: 100%;">
<h1>Hi-Tec GmbH</h1> <h1>Hi-Tec GmbH</h1>
<img src="img.png" alt="Logout Icon" class="logo-image"> <img src="img.png" alt="Logout Icon" class="logo-image" />
<form> <form>
<label for="username">Username</label> <button (click)="login()" type="submit">Mit KeyCLoak anmelden</button>
<input type="text" id="username" name="username"><br>
<label for="password">Password</label>
<input type="password" id="password" name="password"><br><br>
<button type="submit">Anmelden</button>
</form> </form>
</div> </div>

View file

@ -1,12 +1,22 @@
import { Component } from '@angular/core'; import { Component } from "@angular/core";
import { KeycloakService } from 'keycloak-angular'; import { Router } from "@angular/router";
import { KeycloakService } from "keycloak-angular";
@Component({ @Component({
selector: 'app-login-view', selector: "app-login-view",
standalone: true, standalone: true,
imports: [], imports: [],
templateUrl: './login-view.component.html', templateUrl: "./login-view.component.html",
styleUrl: './login-view.component.css' styleUrl: "./login-view.component.css",
}) })
export class LoginViewComponent { export class LoginViewComponent {
constructor(
private keyCloak: KeycloakService,
private router: Router,
) {}
login(): void {
this.keyCloak.login();
this.router.navigate(["/mitarbeiter"]);
}
} }