[debug] show services backend version in /services global footer, show services global frontend build in /about

This commit is contained in:
nymkappa
2023-08-20 22:53:33 +02:00
parent ef554ad67b
commit 22886cb32d
12 changed files with 63 additions and 20 deletions

View File

@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
import { ApiService } from '../../services/api.service';
import { MenuGroup } from '../../interfaces/services.interface';
import { StorageService } from '../../services/storage.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-menu',
@@ -11,19 +12,29 @@ import { StorageService } from '../../services/storage.service';
})
export class MenuComponent implements OnInit {
@Output() loggedOut = new EventEmitter<boolean>();
navOpen: boolean = false;
userMenuGroups$: Observable<MenuGroup[]> | undefined;
userAuth: any | undefined;
@Output() loggedOut = new EventEmitter<boolean>();
isServices = false;
constructor(
private apiService: ApiService,
private storageService: StorageService
private storageService: StorageService,
private router: Router
) {}
ngOnInit(): void {
this.userAuth = this.storageService.getAuth();
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
this.isServices = this.router.url.includes('/services/');
this.navOpen = this.isServices && !this.isSmallScreen();
}
isSmallScreen() {
return window.innerWidth <= 767.98;
}
logout(): void {
@@ -31,6 +42,12 @@ export class MenuComponent implements OnInit {
this.loggedOut.emit(true);
}
onLinkClick() {
if (!this.isServices || this.isSmallScreen()) {
this.navOpen = false;
}
}
hambugerClick() {
this.navOpen = !this.navOpen;
}