]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts
import 15.2.2 octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / core / layouts / workbench-layout / workbench-layout.component.ts
index 64d3f4c38edbe86b0d64af5d0626bceb92cdabe6..66589c9609c76ce174fa77213d1b64d022c7152e 100644 (file)
@@ -1,9 +1,11 @@
-import { Component } from '@angular/core';
+import { Component, OnDestroy, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 
 import { TooltipConfig } from 'ngx-bootstrap/tooltip';
+import { Subscription } from 'rxjs';
 
-import { NotificationService } from '../../../shared/services/notification.service';
+import { SummaryService } from '../../../shared/services/summary.service';
+import { TaskManagerService } from '../../../shared/services/task-manager.service';
 
 @Component({
   selector: 'cd-workbench-layout',
@@ -19,8 +21,23 @@ import { NotificationService } from '../../../shared/services/notification.servi
     }
   ]
 })
-export class WorkbenchLayoutComponent {
-  constructor(private router: Router, public notificationService: NotificationService) {}
+export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
+  private subs = new Subscription();
+
+  constructor(
+    private router: Router,
+    private summaryService: SummaryService,
+    private taskManagerService: TaskManagerService
+  ) {}
+
+  ngOnInit() {
+    this.subs.add(this.summaryService.startPolling());
+    this.subs.add(this.taskManagerService.init(this.summaryService));
+  }
+
+  ngOnDestroy() {
+    this.subs.unsubscribe();
+  }
 
   isDashboardPage() {
     return this.router.url === '/dashboard';