]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Made grafana iframe scrollable and height consistent 64698/head
authorAbhishek Desai <abhishek.desai1@ibm.com>
Fri, 25 Jul 2025 18:32:44 +0000 (00:02 +0530)
committerAbhishek Desai <abhishek.desai1@ibm.com>
Wed, 6 Aug 2025 09:42:47 +0000 (15:12 +0530)
Fixes : https://tracker.ceph.com/issues/72044

Signed-off-by: Abhishek Desai <abhishek.desai1@ibm.com>
23 files changed:
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-details/host-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade-progress/upgrade-progress.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/upgrade/upgrade.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.scss
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-topic-details/rgw-topic-details.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-overview/smb-overview.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/frontend/src/styles.scss

index 8894f8cc5c14e2e8b800e5bc8abd7296dc9ccaaf..55688f9240b66eff20f8181dc23236f6d74e1760 100644 (file)
@@ -61,7 +61,7 @@
     [type]="'metrics'"
     uid="718Bruins"
     *ngIf="permissions.grafana.read"
-    grafanaStyle="two"
+    grafanaStyle="three"
   >
   </cd-grafana>
 </ng-template>
index be2555e6a46ea0dc4577f1b5fee976da97d2a96d..045106ff62498464513d176189283ee462469151 100644 (file)
@@ -88,7 +88,8 @@
           [grafanaPath]="'ceph-filesystem-overview?var-name=' + details.name"
           [type]="'metrics'"
           uid="718Bruins"
-          grafanaStyle="one"
+          grafanaStyle="five"
+          scrollable="no"
         >
         </cd-grafana>
       </ng-template>
index 386d5b3c99b8b825a9bb0174155ca7017244ea17..a1d91928d1b844af735d78a479072b0f7369b38a 100644 (file)
@@ -39,7 +39,7 @@
                     [grafanaPath]="'host-details?var-ceph_hosts=' + selectedHostname"
                     [type]="'metrics'"
                     uid="rtOg0AiWz"
-                    grafanaStyle="four">
+                    grafanaStyle="five">
         </cd-grafana>
       </ng-template>
     </ng-container>
index 2b73a710ac34883fe916943b9cdd95325d538254..49f7317348b662ceade21d70f9e8fbb58ce41771 100644 (file)
@@ -62,6 +62,7 @@
                     [grafanaPath]="'osd-device-details?var-osd=osd.' + osd['id']"
                     [type]="'metrics'"
                     uid="CrAHE0iZz"
+                    scrollable="no"
                     grafanaStyle="three">
         </cd-grafana>
       </ng-template>
index a56877512f99ae90b6db44b006e22a845b99c8df..7a7fc9b01e801008c88be515fc0327d31ad0ba8d 100644 (file)
@@ -50,7 +50,7 @@
                   [grafanaPath]="'osd-overview?'"
                   [type]="'metrics'"
                   uid="lo02I1Aiz"
-                  grafanaStyle="four">
+                  grafanaStyle="three">
       </cd-grafana>
     </ng-template>
   </ng-container>
index c561594e23b1930e050ef3d450ab4bfaf24d8c86..162d031aedea0e9cd123778152ddd164073a6b47 100644 (file)
@@ -43,4 +43,4 @@
            [showFilterTools]="false"
            [showDownloadCopyButton]="false"
            defaultTab="cluster-logs"
-           [scrollable]="true"></cd-logs>
+           ></cd-logs>
index 85a7333437e0a8eb49e76f9c5b567569531bffc1..0049996098ce18cac9267137a4403c409d076fad 100644 (file)
              [showNavLinks]="false"
              [showFilterTools]="false"
              [showDownloadCopyButton]="false"
-             defaultTab="cluster-logs"
-             [scrollable]="true"></cd-logs>
+             defaultTab="cluster-logs"></cd-logs>
 
 
     <ng-template #upgradeStatusTpl>
index b5645eee56129cda5c811d790df568d563cce259..07b15e42f8be4a0c3f2f4b6584200510723c319c 100644 (file)
@@ -42,7 +42,7 @@
                   [grafanaPath]="'ceph-pools-overview?'"
                   [type]="'metrics'"
                   uid="z99hzWtmk"
-                  grafanaStyle="two">
+                  grafanaStyle="three">
       </cd-grafana>
     </ng-template>
   </ng-container>
index 538436fb3df7b6b4707b4c096af618a48ddb1edd..3c51747db8e1a4b14bd5203b0c04816515c9c173 100644 (file)
       <a ngbNavLink
          i18n>Policies</a>
       <ng-template ngbNavContent>
-        <div class="table-scroller">
+        <div>
           <table class="cds--data-table--sort cds--data-table--no-border cds--data-table cds--data-table--md">
             <tbody>
               <tr>
index 4412732255e2c141e0a9ac81e4d8102e7a05eb01..08d2559ef26f957c90f5e7ffc7ed534ae760f510 100644 (file)
@@ -8,12 +8,6 @@ table td {
   word-wrap: break-word;
 }
 
-.table-scroller {
-  height: 100%;
-  max-height: 50vh;
-  overflow: auto;
-}
-
 .spacing-left {
   margin-left: layout.$spacing-03;
 }
index 14045669a33a2907fd60e0e359c6d2c6eb0f5caa..ede4deb91eb8e9b5014c31a48d24f6d856803c2a 100644 (file)
@@ -28,7 +28,7 @@
                   [grafanaPath]="'rgw-overview?'"
                   [type]="'metrics'"
                   uid="WAkugZpiz"
-                  grafanaStyle="two">
+                  grafanaStyle="three">
       </cd-grafana>
     </ng-template>
   </ng-container>
index dec284392da5946ca7c96039575b83a6fc58708b..9f583d3a54ad4bb9c74e25e2dc798d60dbe8d04f 100644 (file)
@@ -61,7 +61,7 @@
     </cds-tab>
     <cds-tab heading="Policies"
              i18n-heading>
-      <div class="table-scroller">
+      <div>
         <table class="cds--data-table--sort cds--data-table--no-border cds--data-table cds--data-table--md">
           <tbody>
             <tr>
index e2212cb576756b00d0bde850d9a23aad541206d7..06cd3609438cbe47695dbca6f94af095d7e40eda 100644 (file)
@@ -6,5 +6,5 @@
   [grafanaPath]="'smb-overview?'"
   [type]="'metrics'"
   uid="feem6ehrmi2o0b"
-  grafanaStyle="two">
+  grafanaStyle="three">
 </cd-grafana>
index 5b1ef2a6cb532d4d8fd44619bedd7bd6a3c002d3..2db4f505f70f174a96c22bf46069217059021cff 100644 (file)
@@ -61,7 +61,7 @@
                 class="grafana"
                 [ngClass]="panelStyle"
                 frameborder="0"
-                scrolling="no"
+                [(scrolling)]="scrollable"
                 [title]="title"
                 i18n-title>
         </iframe>
index 7b43a460ff42da3c79c45933bf07bb8a0f445a31..5990cc234394d8551228680d40b79705b62ef01d 100644 (file)
@@ -1,3 +1,5 @@
+@use '@carbon/layout';
+
 .grafana {
   height: 600px;
   width: 100%;
@@ -5,7 +7,7 @@
 }
 
 .grafana_one {
-  height: 400px;
+  height: layout.rem(450px);
 }
 
 .grafana_two {
   height: 1160px;
 }
 
+.grafana_five {
+  height: layout.rem(1600px);
+}
+
 .timepicker {
   label {
     font-weight: 700;
index d3c7012bcbb3cf402a7f65cd2f70952c04f9a636..acbcde87e82b3554a88e94a46ac5a0c198c66ea5 100644 (file)
@@ -39,6 +39,8 @@ export class GrafanaComponent implements OnInit, OnChanges {
   uid: string;
   @Input()
   title: string;
+  @Input()
+  scrollable: string = 'yes';
 
   constructor(private sanitizer: DomSanitizer, private settingsService: SettingsService) {
     this.grafanaTimes = [
@@ -155,7 +157,8 @@ export class GrafanaComponent implements OnInit, OnChanges {
       one: 'grafana_one',
       two: 'grafana_two',
       three: 'grafana_three',
-      four: 'grafana_four'
+      four: 'grafana_four',
+      five: 'grafana_five'
     };
 
     this.datasource = this.type === 'metrics' ? 'Dashboard1' : 'Loki';
index 72ca4e47990ec285cb7affdf4fa61006e162de79..4dc625459d5b0ec68fd9cd419b208c2348ff029b 100644 (file)
@@ -1,4 +1,4 @@
-<div class="table-scroller">
+<div>
   <cd-table #table
             [data]="tableData || []"
             [columns]="columns"
index a530d728420aa6bf348acd917ba5bb56e9bbbca7..c0409b1ac5a7f2355a685b02afa6dc5ad94807cb 100644 (file)
 
 <ng-template #rowDetailTpl
              let-row="data">
-  <div *ngIf="row[identifier] === expanded?.[identifier]"
-       (mouseenter)="onRowDetailHover($event)"
-       data-testid="datatable-row-detail">
+  @if (row[identifier] === expanded?.[identifier] && !scrollable) {
+  <div
+    (mouseenter)="onRowDetailHover($event)"
+    data-testid="datatable-row-detail">
     <ng-template [ngTemplateOutlet]="rowDetail.template"></ng-template>
   </div>
+  } @else if (row[identifier] === expanded?.[identifier] && scrollable) {
+  <div
+    (mouseenter)="onRowDetailHover($event)"
+    data-testid="datatable-row-detail"
+    class="scrollable-expanded-row">
+    <ng-template [ngTemplateOutlet]="rowDetail.template"></ng-template>
+  </div>
+  }
 </ng-template>
 
 <ng-template #defaultValueTpl
index 7d10e491e246e408cae574de44d31184821c2cc9..1cc0a0e9ae4b9f7ae83cc25ff3efe3a30fabdb82 100644 (file)
@@ -1,5 +1,6 @@
 @use './src/styles/vendor/variables' as vv;
 @use './src/styles/defaults/mixins';
+@use '@carbon/layout';
 
 @mixin row-details-icon {
   color: vv.$gray-900;
 ::ng-deep div.cds--batch-summary {
   background-color: vv.$primary;
 }
+
+.scrollable-expanded-row {
+  max-height: 40vh;
+  overflow-y: auto;
+  overflow-x: hidden;
+  scrollbar-width: thin;
+  scrollbar-color: rgba(128, 128, 128, 30%) transparent;
+}
+
+.scrollable-expanded-row::-webkit-scrollbar {
+  width: layout.rem(6px);
+  height: layout.rem(6px);
+}
+
+.scrollable-expanded-row::-webkit-scrollbar-thumb {
+  background-color: rgba(128, 128, 128, 30%); /* Grey with transparency */
+  border-radius: layout.rem(10px);
+}
+
+.scrollable-expanded-row::-webkit-scrollbar-track {
+  background: transparent;
+}
index 787d0417331240c2410063bee3df2f38d036a772..5fa71834c494f5b618867ca56b3aead1a79109be 100644 (file)
@@ -205,6 +205,12 @@ export class TableComponent implements AfterViewInit, OnInit, OnChanges, OnDestr
   @Input()
   theme: string;
 
+  /**
+   * Use to make the expandable row scrollable with max-height
+   */
+  @Input()
+  scrollable: boolean = true;
+
   /**
    * Should be a function to update the input data if undefined nothing will be triggered
    *
index ca286cd0a816d578adc7b75e942bfefa42fcd309..4066af126ce51f1071c3c457e5a569d7d19b58cc 100644 (file)
@@ -238,7 +238,7 @@ input:-webkit-autofill,
 input:-webkit-autofill:hover,
 input:-webkit-autofill:focus,
 input:-webkit-autofill:active {
-  box-shadow: 0 0 0 10px white inset !important;
-  -webkit-text-fill-color: inherit !important;
+  box-shadow: 0 0 0 10px white inset;
+  -webkit-text-fill-color: inherit;
   transition: background-color 5000s ease-in-out 0s;
 }