]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts
import ceph 16.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / rgw / rgw-daemon-details / rgw-daemon-details.component.ts
1 import { Component, Input, OnChanges } from '@angular/core';
2
3 import _ from 'lodash';
4
5 import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
6 import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
7 import { Permission } from '~/app/shared/models/permissions';
8 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
9
10 @Component({
11 selector: 'cd-rgw-daemon-details',
12 templateUrl: './rgw-daemon-details.component.html',
13 styleUrls: ['./rgw-daemon-details.component.scss']
14 })
15 export class RgwDaemonDetailsComponent implements OnChanges {
16 metadata: any;
17 serviceId = '';
18 serviceMapId = '';
19 grafanaPermission: Permission;
20
21 @Input()
22 selection: RgwDaemon;
23
24 constructor(
25 private rgwDaemonService: RgwDaemonService,
26 private authStorageService: AuthStorageService
27 ) {
28 this.grafanaPermission = this.authStorageService.getPermissions().grafana;
29 }
30
31 ngOnChanges() {
32 if (this.selection) {
33 this.serviceId = this.selection.id;
34 this.serviceMapId = this.selection.service_map_id;
35 }
36 }
37
38 getMetaData() {
39 if (_.isEmpty(this.serviceId)) {
40 return;
41 }
42 this.rgwDaemonService.get(this.serviceId).subscribe((resp: any) => {
43 this.metadata = resp['rgw_metadata'];
44 });
45 }
46 }