mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 16:22:55 -07:00
Moved to webpack and started on new style
This commit is contained in:
parent
03a8319f5c
commit
dbade585e2
118 changed files with 167651 additions and 612 deletions
50
src/Ombi/ClientApp/app/app.component.ts
Normal file
50
src/Ombi/ClientApp/app/app.component.ts
Normal file
|
@ -0,0 +1,50 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { NotificationService } from './services/notification.service';
|
||||
import { SettingsService } from './services/settings.service';
|
||||
import { AuthService } from './auth/auth.service';
|
||||
import { ILocalUser } from './auth/IUserLogin';
|
||||
|
||||
import { ICustomizationSettings } from './interfaces/ISettings';
|
||||
|
||||
@Component({
|
||||
selector: 'ombi',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
|
||||
constructor(public notificationService: NotificationService, public authService: AuthService, private router: Router, private settingsService: SettingsService
|
||||
) {
|
||||
}
|
||||
|
||||
customizationSettings: ICustomizationSettings;
|
||||
user: ILocalUser;
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.user = this.authService.claims();
|
||||
|
||||
|
||||
|
||||
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
|
||||
|
||||
this.router.events.subscribe(() => {
|
||||
|
||||
this.user = this.authService.claims();
|
||||
this.showNav = this.authService.loggedIn();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
hasRole(role: string): boolean {
|
||||
return this.user.roles.some(r => r === role)
|
||||
}
|
||||
|
||||
logOut() {
|
||||
this.authService.logout();
|
||||
this.router.navigate(["login"]);
|
||||
}
|
||||
|
||||
showNav: boolean;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue