]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
8ddbddf2fe81493fe93625139df5ddeec7f1844b
[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.multiClusterService.startClusterTokenStatusPolling());
31     this.subs.add(this.summaryService.startPolling());
32     this.subs.add(this.taskManagerService.init(this.summaryService));
33     this.faviconService.init();
34   }
35
36   ngOnDestroy() {
37     this.subs.unsubscribe();
38   }
39 }