diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts new file mode 100644 index 000000000..f2070be5f --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts @@ -0,0 +1,39 @@ +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +import { Subscription } from 'rxjs'; + +import { FaviconService } from '~/app/shared/services/favicon.service'; +import { SummaryService } from '~/app/shared/services/summary.service'; +import { TaskManagerService } from '~/app/shared/services/task-manager.service'; + +@Component({ + selector: 'cd-workbench-layout', + templateUrl: './workbench-layout.component.html', + styleUrls: ['./workbench-layout.component.scss'], + providers: [FaviconService] +}) +export class WorkbenchLayoutComponent implements OnInit, OnDestroy { + private subs = new Subscription(); + + constructor( + private router: Router, + private summaryService: SummaryService, + private taskManagerService: TaskManagerService, + private faviconService: FaviconService + ) {} + + ngOnInit() { + this.subs.add(this.summaryService.startPolling()); + this.subs.add(this.taskManagerService.init(this.summaryService)); + this.faviconService.init(); + } + + ngOnDestroy() { + this.subs.unsubscribe(); + } + + isDashboardPage() { + return this.router.url === '/dashboard'; + } +} |