]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Enable per RBD graphs in details of RBD
authorPatrick Seidensal <pseidensal@suse.com>
Fri, 11 Sep 2020 09:47:34 +0000 (11:47 +0200)
committerTatjana Dehler <tdehler@suse.com>
Fri, 16 Oct 2020 12:24:23 +0000 (14:24 +0200)
Fixes: https://tracker.ceph.com/issues/47433
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
(cherry picked from commit 3d3230b99bf075020256bdc7cf082fd54fc61992)

Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.ts
Fixed conflicts because https://github.com/ceph/ceph/pull/35290,
https://github.com/ceph/ceph/pull/35311 and https://github.com/ceph/ceph/pull/35574
have not been backported to octopus.

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-details/rbd-details.component.ts

index 314bde9ece56a049c8effa3c1951155a817441af..88a52b6c7be758a6eb459ae4a8bd5bcc2686d8e5 100644 (file)
        heading="Configuration">
     <cd-rbd-configuration-table [data]="selection['configuration']"></cd-rbd-configuration-table>
   </tab>
+  <tab i18n-heading
+       heading="Performance">
+    <cd-grafana [grafanaPath]="rbdDashboardUrl"
+                uid="YhCYGcuZz"
+                grafanaStyle="one">
+    </cd-grafana>
+  </tab>
 </tabset>
 
 <ng-template
           tooltip="This is the global value. No value for this option has been set for this image.">Global</span>
   </ng-template>
 </ng-template>
-
index 0916391e06633a5e64e67d99c6f60821e7de954b..3e1803cd760865beafeffa237a9e9005f661073f 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, Input, TemplateRef, ViewChild } from '@angular/core';
+import { Component, Input, OnChanges, TemplateRef, ViewChild } from '@angular/core';
 
 import { RbdFormModel } from '../rbd-form/rbd-form.model';
 
@@ -7,7 +7,7 @@ import { RbdFormModel } from '../rbd-form/rbd-form.model';
   templateUrl: './rbd-details.component.html',
   styleUrls: ['./rbd-details.component.scss']
 })
-export class RbdDetailsComponent {
+export class RbdDetailsComponent implements OnChanges {
   @Input()
   selection: RbdFormModel;
   @Input()
@@ -16,4 +16,12 @@ export class RbdDetailsComponent {
   poolConfigurationSourceTpl: TemplateRef<any>;
 
   constructor() {}
+
+  rbdDashboardUrl: string;
+
+  ngOnChanges() {
+    if (this.selection) {
+      this.rbdDashboardUrl = `rbd-details?var-Pool=${this.selection['pool_name']}&var-Image=${this.selection['name']}`;
+    }
+  }
 }