1 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4 import { Subscription } from 'rxjs';
6 import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
7 import { CephShortVersionPipe } from '../../../../shared/pipes/ceph-short-version.pipe';
10 selector: 'cd-mirroring-daemons',
11 templateUrl: './daemon-list.component.html',
12 styleUrls: ['./daemon-list.component.scss']
14 export class DaemonListComponent implements OnInit, OnDestroy {
15 @ViewChild('healthTmpl', { static: true })
16 healthTmpl: TemplateRef<any>;
24 private rbdMirroringService: RbdMirroringService,
25 private cephShortVersionPipe: CephShortVersionPipe,
31 { prop: 'instance_id', name: this.i18n('Instance'), flexGrow: 2 },
32 { prop: 'id', name: this.i18n('ID'), flexGrow: 2 },
33 { prop: 'server_hostname', name: this.i18n('Hostname'), flexGrow: 2 },
36 name: this.i18n('Version'),
37 pipe: this.cephShortVersionPipe,
42 name: this.i18n('Health'),
43 cellTemplate: this.healthTmpl,
48 this.subs = this.rbdMirroringService.subscribeSummary((data) => {
49 this.data = data.content_data.daemons;
54 this.subs.unsubscribe();
58 this.rbdMirroringService.refresh();