1 import { Component, Input, OnChanges } from '@angular/core';
3 import * as _ from 'lodash';
5 import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service';
6 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
7 import { Permission } from '../../../shared/models/permissions';
8 import { AuthStorageService } from '../../../shared/services/auth-storage.service';
11 selector: 'cd-rgw-daemon-details',
12 templateUrl: './rgw-daemon-details.component.html',
13 styleUrls: ['./rgw-daemon-details.component.scss']
15 export class RgwDaemonDetailsComponent implements OnChanges {
18 grafanaPermission: Permission;
21 selection: CdTableSelection;
24 private rgwDaemonService: RgwDaemonService,
25 private authStorageService: AuthStorageService
27 this.grafanaPermission = this.authStorageService.getPermissions().grafana;
31 // Get the service id of the first selected row.
32 if (this.selection.hasSelection) {
33 this.serviceId = this.selection.first().id;
38 if (_.isEmpty(this.serviceId)) {
41 this.rgwDaemonService.get(this.serviceId).subscribe((resp: any) => {
42 this.metadata = resp['rgw_metadata'];