1 import { Component, Input, OnChanges } from '@angular/core';
3 import _ from 'lodash';
5 import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
6 import { Permission } from '~/app/shared/models/permissions';
7 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
10 selector: 'cd-rgw-daemon-details',
11 templateUrl: './rgw-daemon-details.component.html',
12 styleUrls: ['./rgw-daemon-details.component.scss']
14 export class RgwDaemonDetailsComponent implements OnChanges {
17 grafanaPermission: Permission;
23 private rgwDaemonService: RgwDaemonService,
24 private authStorageService: AuthStorageService
26 this.grafanaPermission = this.authStorageService.getPermissions().grafana;
30 // Get the service id of the first selected row.
32 this.serviceId = this.selection.id;
37 if (_.isEmpty(this.serviceId)) {
40 this.rgwDaemonService.get(this.serviceId).subscribe((resp: any) => {
41 this.metadata = resp['rgw_metadata'];