]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
1d7c4bb751cb6ae1fba1f5f4b828fa1e8e5565bf
[ceph.git] /
1 import { Component, OnDestroy, OnInit } from '@angular/core';
2 import { Router } from '@angular/router';
3
4 import { Subscription } from 'rxjs';
5 import { MultiClusterService } from '~/app/shared/api/multi-cluster.service';
6
7 import { FaviconService } from '~/app/shared/services/favicon.service';
8 import { SummaryService } from '~/app/shared/services/summary.service';
9 import { TaskManagerService } from '~/app/shared/services/task-manager.service';
10
11 @Component({
12   selector: 'cd-workbench-layout',
13   templateUrl: './workbench-layout.component.html',
14   styleUrls: ['./workbench-layout.component.scss'],
15   providers: [FaviconService]
16 })
17 export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
18   private subs = new Subscription();
19
20   constructor(
21     public router: Router,
22     private summaryService: SummaryService,
23     private taskManagerService: TaskManagerService,
24     private multiClusterService: MultiClusterService,
25     private faviconService: FaviconService
26   ) {}
27
28   ngOnInit() {
29     this.subs.add(this.multiClusterService.startPolling());
30     this.subs.add(this.summaryService.startPolling());
31     this.subs.add(this.taskManagerService.init(this.summaryService));
32     this.faviconService.init();
33   }
34
35   ngOnDestroy() {
36     this.subs.unsubscribe();
37   }
38 }