feat: add link to admin panel

This commit is contained in:
Polianin Nikita 2024-08-28 01:53:27 +03:00
parent 6a3a6a8d47
commit c6059a7a60
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,4 @@
<mat-toolbar style="justify-content: space-between;">
<a href="/" style="color: inherit;">Winsomnia</a>
<a href="/admin" style="color: inherit; font-size: 14px" *appHasRole="AuthRoles.Admin">Админ панель</a>
</mat-toolbar>

View File

@ -1,6 +1,8 @@
import { Component } from '@angular/core';
import {MatToolbar} from "@angular/material/toolbar";
import {MatAnchor, MatButton} from "@angular/material/button";
import {HasRoleDirective} from "@/directives/has-role.directive";
import {AuthRoles} from "@model/AuthRoles";
@Component({
selector: 'app-header',
@ -8,11 +10,13 @@ import {MatAnchor, MatButton} from "@angular/material/button";
imports: [
MatToolbar,
MatButton,
MatAnchor
MatAnchor,
HasRoleDirective
],
templateUrl: './header.component.html',
styleUrl: './header.component.css'
})
export class HeaderComponent {
protected readonly AuthRoles = AuthRoles;
}