summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/app.component.ts')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/app.component.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts
new file mode 100644
index 00000000..363a213d
--- /dev/null
+++ b/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts
@@ -0,0 +1,34 @@
+import { Component } from '@angular/core';
+import { Router } from '@angular/router';
+
+import { TooltipConfig } from 'ngx-bootstrap/tooltip';
+
+import { AuthStorageService } from './shared/services/auth-storage.service';
+
+@Component({
+ selector: 'cd-root',
+ templateUrl: './app.component.html',
+ styleUrls: ['./app.component.scss'],
+ providers: [
+ {
+ provide: TooltipConfig,
+ useFactory: (): TooltipConfig =>
+ Object.assign(new TooltipConfig(), {
+ container: 'body'
+ })
+ }
+ ]
+})
+export class AppComponent {
+ title = 'cd';
+
+ constructor(private authStorageService: AuthStorageService, private router: Router) {}
+
+ isLoginActive() {
+ return this.router.url === '/login' || !this.authStorageService.isLoggedIn();
+ }
+
+ isDashboardPage() {
+ return this.router.url === '/dashboard';
+ }
+}