parent
1f942b0da1
commit
b73c809eff
@ -0,0 +1,36 @@
|
|||||||
|
<nav class="bg-white shadow">
|
||||||
|
<div class="container mx-auto px-4">
|
||||||
|
<div class="flex justify-between h-16">
|
||||||
|
<div class="flex">
|
||||||
|
<div class="flex-shrink-0 flex items-center">
|
||||||
|
<a routerLink="/" class="text-xl font-bold text-gray-800">MemoryMap Admin</a>
|
||||||
|
</div>
|
||||||
|
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
|
||||||
|
<a
|
||||||
|
routerLink="/dashboard"
|
||||||
|
routerLinkActive="border-blue-500 text-gray-900"
|
||||||
|
[routerLinkActiveOptions]="{exact: true}"
|
||||||
|
class="inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||||
|
>
|
||||||
|
Tableau de bord
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
routerLink="/config"
|
||||||
|
routerLinkActive="border-blue-500 text-gray-900"
|
||||||
|
class="inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||||
|
>
|
||||||
|
Configuration
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<button
|
||||||
|
(click)="logout()"
|
||||||
|
class="ml-3 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700"
|
||||||
|
>
|
||||||
|
Déconnexion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
@ -0,0 +1,19 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { Router, RouterModule } from '@angular/router';
|
||||||
|
import { AuthService } from '../../services/auth.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-navbar',
|
||||||
|
templateUrl: './navbar.component.html',
|
||||||
|
styleUrl: './navbar.component.css',
|
||||||
|
imports: [CommonModule, RouterModule]
|
||||||
|
})
|
||||||
|
export class NavbarComponent {
|
||||||
|
constructor(private authService: AuthService, private router: Router) {}
|
||||||
|
|
||||||
|
logout(): void {
|
||||||
|
this.authService.logout();
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue