File
Implements
Metadata
selector |
cd-mirroring |
styleUrls |
./overview.component.scss |
templateUrl |
./overview.component.html |
Methods
ngOnDestroy
|
ngOnDestroy()
|
|
|
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
import { ViewCacheStatus } from '../../../../shared/enum/view-cache-status.enum';
@Component({
selector: 'cd-mirroring',
templateUrl: './overview.component.html',
styleUrls: ['./overview.component.scss']
})
export class OverviewComponent implements OnInit, OnDestroy {
subs: Subscription;
status: ViewCacheStatus;
constructor(private rbdMirroringService: RbdMirroringService) {}
ngOnInit() {
this.subs = this.rbdMirroringService.subscribeSummary((data: any) => {
if (!data) {
return;
}
this.status = data.content_data.status;
});
}
ngOnDestroy(): void {
this.subs.unsubscribe();
}
}
<cd-view-cache [status]="status"></cd-view-cache>
<div class="row">
<div class="col-sm-6">
<legend i18n>Daemons</legend>
<cd-mirroring-daemons>
</cd-mirroring-daemons>
</div>
<div class="col-sm-6">
<legend i18n>Pools</legend>
<cd-mirroring-pools>
</cd-mirroring-pools>
</div>
</div>
<div class="row">
<div class="col-md-12">
<legend i18n>Images</legend>
<cd-mirroring-images>
</cd-mirroring-images>
</div>
</div>
Legend
Html element with directive