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';
9 selector: 'cd-rgw-daemon-details',
10 templateUrl: './rgw-daemon-details.component.html',
11 styleUrls: ['./rgw-daemon-details.component.scss']
13 export class RgwDaemonDetailsComponent implements OnChanges {
17 @Input() selection: CdTableSelection;
19 constructor(private rgwDaemonService: RgwDaemonService) {}
22 // Get the service id of the first selected row.
23 if (this.selection.hasSelection) {
24 this.serviceId = this.selection.first().id;
29 if (_.isEmpty(this.serviceId)) {
32 this.rgwDaemonService.get(this.serviceId).subscribe((resp) => {
33 this.metadata = resp['rgw_metadata'];