add admin interface, angular migration

This commit is contained in:
_Bastler
2025-11-09 01:58:54 +01:00
parent ff94ca05ce
commit 1acaf07825
100 changed files with 7129 additions and 50 deletions
+5
View File
@@ -64,6 +64,11 @@
<mat-icon>widgets</mat-icon> {{'services' | i18n}}
</a>
}
@if (auth && auth.authenticated && hasAdminRole()) {
<a routerLink="/admin" routerLinkActive="active" mat-list-item>
<mat-icon>admin_panel_settings</mat-icon> {{'admin.title' | i18n}}
</a>
}
<a routerLink="/tokens" mat-list-item>
<mat-icon>card_giftcard</mat-icon> {{'tokens.redeem' | i18n}}
</a>
+7
View File
@@ -158,6 +158,13 @@ export class MainComponent {
}
}
hasAdminRole(): boolean {
if (this.auth && this.auth.authorities) {
return this.auth.authorities.some((auth: any) => auth.authority === 'ROLE_ADMIN');
}
return false;
}
openExternal(url, target = '_self') {
window.open(url, target);
}