File
Implements
Metadata
selector |
cd-rgw-daemon-details |
styleUrls |
./rgw-daemon-details.component.scss |
templateUrl |
./rgw-daemon-details.component.html |
Index
Properties
|
|
Methods
|
|
Inputs
|
|
Methods
getMetaData
|
getMetaData()
|
|
|
ngOnChanges
|
ngOnChanges()
|
|
|
serviceId
|
Type : string
|
Default value : ''
|
|
import { Component, Input, OnChanges } from '@angular/core';
import * as _ from 'lodash';
import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service';
import { CdTableSelection } from '../../../shared/models/cd-table-selection';
import { Permission } from '../../../shared/models/permissions';
import { AuthStorageService } from '../../../shared/services/auth-storage.service';
@Component({
selector: 'cd-rgw-daemon-details',
templateUrl: './rgw-daemon-details.component.html',
styleUrls: ['./rgw-daemon-details.component.scss']
})
export class RgwDaemonDetailsComponent implements OnChanges {
metadata: any;
serviceId = '';
grafanaPermission: Permission;
@Input()
selection: CdTableSelection;
constructor(
private rgwDaemonService: RgwDaemonService,
private authStorageService: AuthStorageService
) {
this.grafanaPermission = this.authStorageService.getPermissions().grafana;
}
ngOnChanges() {
// Get the service id of the first selected row.
if (this.selection.hasSelection) {
this.serviceId = this.selection.first().id;
}
}
getMetaData() {
if (_.isEmpty(this.serviceId)) {
return;
}
this.rgwDaemonService.get(this.serviceId).subscribe((resp) => {
this.metadata = resp['rgw_metadata'];
});
}
}
<tabset *ngIf="selection.hasSingleSelection">
<tab i18n-heading
heading="Details">
<cd-table-key-value [data]="metadata"
(fetchData)="getMetaData()">
</cd-table-key-value>
</tab>
<tab i18n-heading
heading="Performance Counters">
<cd-table-performance-counter serviceType="rgw"
[serviceId]="serviceId">
</cd-table-performance-counter>
</tab>
<tab i18n-heading
*ngIf="grafanaPermission.read"
heading="Performance Details">
<cd-grafana [grafanaPath]="'rgw-instance-detail?var-rgw_servers=rgw.' + this.selection.first().id"
uid="x5ARzZtmk"
grafanaStyle="one">
</cd-grafana>
</tab>
</tabset>
Legend
Html element with directive