43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { Component, computed, inject, OnInit } from '@angular/core';
|
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
import { RouterOutlet } from '@angular/router';
|
|
import { BrandMark } from './components/brand-mark';
|
|
import { SignInPage } from './components/sign-in-page/sign-in-page';
|
|
import { WorkspaceNavigation } from './components/workspace-navigation/workspace-navigation';
|
|
import { SessionService } from './services/session.service';
|
|
import { ThemeService } from './services/theme.service';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
imports: [
|
|
BrandMark,
|
|
SignInPage,
|
|
WorkspaceNavigation,
|
|
RouterOutlet,
|
|
MatProgressSpinnerModule,
|
|
MatButtonModule,
|
|
MatDialogModule,
|
|
],
|
|
templateUrl: './app.html',
|
|
styleUrl: './app.css',
|
|
})
|
|
export class App implements OnInit {
|
|
readonly session = inject(SessionService);
|
|
readonly theme = inject(ThemeService);
|
|
readonly userInitial = computed(() => this.session.username().charAt(0).toUpperCase());
|
|
|
|
ngOnInit() {
|
|
this.session.refresh();
|
|
}
|
|
|
|
login() {
|
|
window.location.href = '/oauth2/authorization/oidc';
|
|
}
|
|
|
|
logout() {
|
|
window.location.href = '/logout';
|
|
}
|
|
}
|