in all in one

This commit is contained in:
Kham
2026-04-22 08:48:04 +10:00
parent a994d72640
commit 12504e61f4
215 changed files with 21683 additions and 12 deletions
@@ -0,0 +1,51 @@
import { AuthenticationService } from '../user-services';
import { Subscription } from 'rxjs'
import { Component, EventEmitter, Output, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { Utils } from '../shares';
@Component({
selector: 'app-nav-toolbar',
templateUrl: './nav-toolbar.component.html',
styleUrls: ['./nav-toolbar.component.css']
})
export class NavToolarComponent implements OnInit, OnDestroy {
isExpanded = false;
isAuth = false;
isAdmin = false;
currentUserName = "";
authSubscription: Subscription = new Subscription;
@Output() toggleEvent: EventEmitter<boolean> = new EventEmitter();
constructor(private authService: AuthenticationService,
private router: Router) { }
ngOnInit() {
this.authSubscription = this.authService.authChange.subscribe(currentUser => {
this.isAuth = Utils.getIsAuth();
this.isAdmin = Utils.getIsAdmin();
this.currentUserName = currentUser;
});
}
ngOnDestroy() {
if (this.authSubscription) {
this.authSubscription.unsubscribe();
}
}
onHome() {
this.router.navigate(['/home/concessionvalidation']);
}
onToggle() {
this.isExpanded = !this.isExpanded;
this.toggleEvent.emit(this.isExpanded);
}
onLogout() {
this.authService.logout();
this.router.navigate(['/login']);
}
}