]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: change deprecated grafana URL in daemon logs 55544/head
authorNizamudeen A <nia@redhat.com>
Thu, 8 Jun 2023 06:43:54 +0000 (12:13 +0530)
committerNizamudeen A <nia@redhat.com>
Mon, 12 Feb 2024 14:39:45 +0000 (20:09 +0530)
See https://github.com/grafana/grafana/issues/51276

I am also increasting the height of the panel

Fixes: https://tracker.ceph.com/issues/61618
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit f428b1468844345915b4cf607a104732b1b967f3)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts

index 202e937af3a5a4f47ad78680b2bbcb23ea388cfc..f92674e50743d724004522ecf0007f9710c6146f 100644 (file)
@@ -85,7 +85,7 @@
                         [grafanaPath]="'explore?'"
                         [type]="'logs'"
                         uid="CrAHE0iZz"
-                        grafanaStyle="two">
+                        grafanaStyle="three">
             </cd-grafana>
           </div>
         </ng-container>
index 07fd97965cedb7dd23625f28e9c2b826a4898fb4..da1e25662e45024b675ec4f5244b076a3281add7 100644 (file)
@@ -21,7 +21,7 @@ describe('GrafanaComponent', () => {
   const expected_url =
     'http:localhost:3000/d/foo/somePath&refresh=2s&var-datasource=Dashboard1&kiosk&from=now-1h&to=now';
   const expected_logs_url =
-    'http:localhost:3000/explore?orgId=1&left=["now-1h","now","Loki",{"refId":"A"}]&kiosk';
+    'http:localhost:3000/explore?orgId=1&left={"datasource": "Loki", "queries": [{"refId": "A"}], "range": {"from": "now-1h", "to": "now"}}&kiosk';
 
   configureTestBed({
     declarations: [GrafanaComponent, AlertPanelComponent, LoadingPanelComponent, DocComponent],
index d82d414ae955cb07170accf364ae16edb459bdad..b650f6694cf5cc442c0d651b7a81130846c32d27 100644 (file)
@@ -176,9 +176,9 @@ export class GrafanaComponent implements OnInit, OnChanges {
     if (this.type === 'metrics') {
       this.url = `${this.baseUrl}${this.uid}/${this.grafanaPath}&refresh=2s&var-datasource=${this.datasource}${this.mode}&${this.time}`;
     } else {
-      this.url = `${this.baseUrl.slice(0, -2)}${this.grafanaPath}orgId=1&left=["now-1h","now","${
+      this.url = `${this.baseUrl.slice(0, -2)}${this.grafanaPath}orgId=1&left={"datasource": "${
         this.datasource
-      }",{"refId":"A"}]${this.mode}`;
+      }", "queries": [{"refId": "A"}], "range": {"from": "now-1h", "to": "now"}}${this.mode}`;
     }
     this.grafanaSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.url);
   }