]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / mirroring / overview / overview.component.ts
1 import { Component, OnDestroy, OnInit } from '@angular/core';
2
3 import { Subscription } from 'rxjs';
4
5 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
6 import { ViewCacheStatus } from '../../../../shared/enum/view-cache-status.enum';
7
8 @Component({
9 selector: 'cd-mirroring',
10 templateUrl: './overview.component.html',
11 styleUrls: ['./overview.component.scss']
12 })
13 export class OverviewComponent implements OnInit, OnDestroy {
14 subs: Subscription;
15
16 status: ViewCacheStatus;
17
18 constructor(private rbdMirroringService: RbdMirroringService) {}
19
20 ngOnInit() {
21 this.subs = this.rbdMirroringService.subscribeSummary((data: any) => {
22 if (!data) {
23 return;
24 }
25 this.status = data.content_data.status;
26 });
27 }
28
29 ngOnDestroy(): void {
30 this.subs.unsubscribe();
31 }
32 }